aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c
diff options
context:
space:
mode:
authorXiaolong CHEN <a21785@motorola.com>2010-06-24 22:10:40 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-06-24 22:13:10 -0400
commit69a4af606ed4836faa2ec69b1d217f384b8235e7 (patch)
tree56ca639c35e5eaa2029c900ced2a989bf5476375 /include/linux/i2c
parente725a4945d6eedd400dd5d0ead293d980a2f76ec (diff)
Input: adp5588-keys - support GPI events for ADP5588 devices
A column or row configured as a GPI can be programmed to be part of the key event table and therefore also capable of generating a key event interrupt. A key event interrupt caused by a GPI follows the same process flow as a key event interrupt caused by a key press. GPIs configured as part of the key event table allow single key switches and other GPI interrupts to be monitored. As part of the event table, GPIs are represented by the decimal value 97 (0x61 or 1100001) through the decimal value 114 (0x72 or 1110010). See table below for GPI event number assignments for rows and columns. GPI Event Number Assignments for Rows Row0 Row1 Row2 Row3 Row4 Row5 Row6 Row7 97 98 99 100 101 102 103 104 GPI Event Number Assignments for Cols Col0 Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9 105 106 107 108 109 110 111 112 113 114 Signed-off-by: Xiaolong Chen <xiao-long.chen@motorola.com> Signed-off-by: Yuanbo Ye <yuan-bo.ye@motorola.com> Signed-off-by: Tao Hu <taohu@motorola.com> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'include/linux/i2c')
-rw-r--r--include/linux/i2c/adp5588.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h
index 02c9af374741..b5f57c498e24 100644
--- a/include/linux/i2c/adp5588.h
+++ b/include/linux/i2c/adp5588.h
@@ -78,6 +78,40 @@
78 78
79#define ADP5588_KEYMAPSIZE 80 79#define ADP5588_KEYMAPSIZE 80
80 80
81#define GPI_PIN_ROW0 97
82#define GPI_PIN_ROW1 98
83#define GPI_PIN_ROW2 99
84#define GPI_PIN_ROW3 100
85#define GPI_PIN_ROW4 101
86#define GPI_PIN_ROW5 102
87#define GPI_PIN_ROW6 103
88#define GPI_PIN_ROW7 104
89#define GPI_PIN_COL0 105
90#define GPI_PIN_COL1 106
91#define GPI_PIN_COL2 107
92#define GPI_PIN_COL3 108
93#define GPI_PIN_COL4 109
94#define GPI_PIN_COL5 110
95#define GPI_PIN_COL6 111
96#define GPI_PIN_COL7 112
97#define GPI_PIN_COL8 113
98#define GPI_PIN_COL9 114
99
100#define GPI_PIN_ROW_BASE GPI_PIN_ROW0
101#define GPI_PIN_ROW_END GPI_PIN_ROW7
102#define GPI_PIN_COL_BASE GPI_PIN_COL0
103#define GPI_PIN_COL_END GPI_PIN_COL9
104
105#define GPI_PIN_BASE GPI_PIN_ROW_BASE
106#define GPI_PIN_END GPI_PIN_COL_END
107
108#define ADP5588_GPIMAPSIZE_MAX (GPI_PIN_END - GPI_PIN_BASE + 1)
109
110struct adp5588_gpi_map {
111 unsigned short pin;
112 unsigned short sw_evt;
113};
114
81struct adp5588_kpad_platform_data { 115struct adp5588_kpad_platform_data {
82 int rows; /* Number of rows */ 116 int rows; /* Number of rows */
83 int cols; /* Number of columns */ 117 int cols; /* Number of columns */
@@ -87,6 +121,8 @@ struct adp5588_kpad_platform_data {
87 unsigned en_keylock:1; /* Enable Key Lock feature */ 121 unsigned en_keylock:1; /* Enable Key Lock feature */
88 unsigned short unlock_key1; /* Unlock Key 1 */ 122 unsigned short unlock_key1; /* Unlock Key 1 */
89 unsigned short unlock_key2; /* Unlock Key 2 */ 123 unsigned short unlock_key2; /* Unlock Key 2 */
124 const struct adp5588_gpi_map *gpimap;
125 unsigned short gpimapsize;
90}; 126};
91 127
92struct adp5588_gpio_platform_data { 128struct adp5588_gpio_platform_data {