event-switches.h 5.79 KB
Newer Older
1 2 3 4 5
/**
 * @file event-switches.h
 * Headers for the switch event provider for the Mode Control Entity
 * <p>
 * Copyright © 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
6
 * Copyright (C) 2014-2019 Jolla Ltd.
7 8
 * <p>
 * @author David Weinehall <david.weinehall@nokia.com>
9
 * @author Simo Piiroinen <simo.piiroinen@jollamobile.com>
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
 *
 * mce is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation.
 *
 * mce is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with mce.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef _EVENT_SWITCHES_H_
#define _EVENT_SWITCHES_H_

#include <glib.h>

/** Path to the SysFS interface for the lock flicker-key status */
29
#define MCE_FLICKER_KEY_STATE_PATH                      "/sys/devices/platform/gpio-switch/kb_lock/state"
30

31
/** Value for the lock flicker-key active state */
32
#define MCE_FLICKER_KEY_ACTIVE                          "closed"
33

34
/** Value for the lock flicker-key inactive state */
35
#define MCE_FLICKER_KEY_INACTIVE                        "open"
36 37

/** Path to the SysFS interface for the keyboard slide status */
38
#define MCE_KBD_SLIDE_STATE_PATH                        "/sys/devices/platform/gpio-switch/slide/state"
39

40
/** Value for the keyboard slide open state */
41
#define MCE_KBD_SLIDE_OPEN                              "open"
42

43
/** Value for the keyboard slide closed state */
44
#define MCE_KBD_SLIDE_CLOSED                            "closed"
45 46

/** Path to the SysFS interface for the camera focus state */
47
#define MCE_CAM_FOCUS_STATE_PATH                        "/sys/devices/platform/gpio-switch/cam_focus/state"
48

49
/** Value for the camera focus active state */
50
#define MCE_CAM_FOCUS_ACTIVE                            "active"
51

52
/** Value for the camera focus inactive state */
53
#define MCE_CAM_FOCUS_INACTIVE                          "inactive"
54

55
/** SysFS interface to enable/disable camera focus IRQs */
56
#define MCE_CAM_FOCUS_DISABLE_PATH                      "/sys/devices/platform/gpio-switch/cam_focus/disable"
57 58

/** Path to the SysFS interface for the camera launch state */
59
#define MCE_CAM_LAUNCH_STATE_PATH                       "/sys/devices/platform/gpio-switch/cam_launch/state"
60

61
/** Value for the camera launch active state */
62
#define MCE_CAM_LAUNCH_ACTIVE                           "active"
63

64
/** Value for the camera launch inactive state */
65
#define MCE_CAM_LAUNCH_INACTIVE                         "inactive"
66 67

/** Path to the SysFS interface for the lid cover status */
68
#define MCE_LID_COVER_STATE_PATH                        "/sys/devices/platform/gpio-switch/prot_shell/cover_switch"
69

70
/** Value for the lid cover open state */
71
#define MCE_LID_COVER_OPEN                              "open"
72

73
/** Value for the lid cover closed state */
74
#define MCE_LID_COVER_CLOSED                            "closed"
75 76

/** Path to the SysFS interface for the proximity sensor status */
77
#define MCE_PROXIMITY_SENSOR_STATE_PATH                 "/sys/devices/platform/gpio-switch/proximity/state"
78

79
/** Value for the proximity sensor open state */
80
#define MCE_PROXIMITY_SENSOR_OPEN                       "open"
81

82
/** Value for the proximity sensor closed state */
83
#define MCE_PROXIMITY_SENSOR_CLOSED                     "closed"
84

85
/** SysFS interface to enable/disable proximity sensor IRQs */
86
#define MCE_PROXIMITY_SENSOR_DISABLE_PATH               "/sys/devices/platform/gpio-switch/proximity/disable"
87 88 89 90 91

/**
 * Path to the SysFS interface for the MUSB HDRC USB cable status;
 * RX-51
 */
92
#define MCE_MUSB_OMAP3_USB_CABLE_STATE_PATH             "/sys/class/i2c-adapter/i2c-1/1-0048/twl4030_usb/vbus"
93

94
/** Value for the MUSB HDRC USB cable connected state */
95
#define MCE_MUSB_OMAP3_USB_CABLE_CONNECTED              "1"
96

97
/** Value for the MUSB HDRC USB cable disconnected state */
98
#define MCE_MUSB_OMAP3_USB_CABLE_DISCONNECTED           "0"
99 100

/** Path to the SysFS interface for the RX-51 MMC0 cover status */
101
#define MCE_MMC0_COVER_STATE_PATH                       "/sys/class/mmc_host/mmc0/cover_switch"
102

103
/** Value for the RX-51 MMC0 cover open state */
104
#define MCE_MMC_COVER_OPEN                              "open"
105

106
/** Value for the RX-51 MMC0 cover closed state */
107
#define MCE_MMC_COVER_CLOSED                            "closed"
108 109

/** Path to the SysFS interface for the MMC cover status */
110
#define MCE_MMC_COVER_STATE_PATH                        "/sys/devices/platform/gpio-switch/mmci-omap.2/cover_switch"
111

112
/** Value for the MMC cover open state */
113
#define MCE_MMC_COVER_OPEN                              "open"
114

115
/** Value for the MMC cover closed state */
116
#define MCE_MMC_COVER_CLOSED                            "closed"
117 118

/** Path to the SysFS interface for the lens cover status */
119
#define MCE_LENS_COVER_STATE_PATH                       "/sys/devices/platform/gpio-switch/cam_shutter/state"
120

121
/** Value for the lens cover open state */
122
#define MCE_LENS_COVER_OPEN                             "open"
123

124
/** Value for the lens cover closed state */
125
#define MCE_LENS_COVER_CLOSED                           "closed"
126 127

/** Path to the SysFS interface for the battery cover status */
128
#define MCE_BATTERY_COVER_STATE_PATH                    "/sys/devices/platform/gpio-switch/bat_cover/cover_switch"
129

130
/** Value for the battery cover open state */
131
#define MCE_BATTERY_COVER_OPEN                          "open"
132

133
/** Value for the battery cover closed state */
134
#define MCE_BATTERY_COVER_CLOSED                        "closed"
135 136 137 138 139 140

/* When MCE is made modular, this will be handled differently */
gboolean mce_switches_init(void);
void mce_switches_exit(void);

#endif /* _EVENT_SWITCHES_H_ */