aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/Kconfig2
-rw-r--r--drivers/input/keyboard/twl4030_keypad.c17
-rw-r--r--drivers/input/keyboard/w90p910_keypad.c2
3 files changed, 13 insertions, 8 deletions
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 3525f533e186..1ba25145b333 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -124,7 +124,7 @@ config KEYBOARD_ATKBD_RDI_KEYCODES
124 right-hand column will be interpreted as the key shown in the 124 right-hand column will be interpreted as the key shown in the
125 left-hand column. 125 left-hand column.
126 126
127config QT2160 127config KEYBOARD_QT2160
128 tristate "Atmel AT42QT2160 Touch Sensor Chip" 128 tristate "Atmel AT42QT2160 Touch Sensor Chip"
129 depends on I2C && EXPERIMENTAL 129 depends on I2C && EXPERIMENTAL
130 help 130 help
diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
index 7aa59e07b689..fb16b5e5ea13 100644
--- a/drivers/input/keyboard/twl4030_keypad.c
+++ b/drivers/input/keyboard/twl4030_keypad.c
@@ -51,8 +51,12 @@
51 */ 51 */
52#define TWL4030_MAX_ROWS 8 /* TWL4030 hard limit */ 52#define TWL4030_MAX_ROWS 8 /* TWL4030 hard limit */
53#define TWL4030_MAX_COLS 8 53#define TWL4030_MAX_COLS 8
54#define TWL4030_ROW_SHIFT 3 54/*
55#define TWL4030_KEYMAP_SIZE (TWL4030_MAX_ROWS * TWL4030_MAX_COLS) 55 * Note that we add space for an extra column so that we can handle
56 * row lines connected to the gnd (see twl4030_col_xlate()).
57 */
58#define TWL4030_ROW_SHIFT 4
59#define TWL4030_KEYMAP_SIZE (TWL4030_MAX_ROWS << TWL4030_ROW_SHIFT)
56 60
57struct twl4030_keypad { 61struct twl4030_keypad {
58 unsigned short keymap[TWL4030_KEYMAP_SIZE]; 62 unsigned short keymap[TWL4030_KEYMAP_SIZE];
@@ -182,7 +186,7 @@ static int twl4030_read_kp_matrix_state(struct twl4030_keypad *kp, u16 *state)
182 return ret; 186 return ret;
183} 187}
184 188
185static int twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state) 189static bool twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state)
186{ 190{
187 int i; 191 int i;
188 u16 check = 0; 192 u16 check = 0;
@@ -191,12 +195,12 @@ static int twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state)
191 u16 col = key_state[i]; 195 u16 col = key_state[i];
192 196
193 if ((col & check) && hweight16(col) > 1) 197 if ((col & check) && hweight16(col) > 1)
194 return 1; 198 return true;
195 199
196 check |= col; 200 check |= col;
197 } 201 }
198 202
199 return 0; 203 return false;
200} 204}
201 205
202static void twl4030_kp_scan(struct twl4030_keypad *kp, bool release_all) 206static void twl4030_kp_scan(struct twl4030_keypad *kp, bool release_all)
@@ -225,7 +229,8 @@ static void twl4030_kp_scan(struct twl4030_keypad *kp, bool release_all)
225 if (!changed) 229 if (!changed)
226 continue; 230 continue;
227 231
228 for (col = 0; col < kp->n_cols; col++) { 232 /* Extra column handles "all gnd" rows */
233 for (col = 0; col < kp->n_cols + 1; col++) {
229 int code; 234 int code;
230 235
231 if (!(changed & (1 << col))) 236 if (!(changed & (1 << col)))
diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c
index 4ef764cc493c..ee2bf6bcf291 100644
--- a/drivers/input/keyboard/w90p910_keypad.c
+++ b/drivers/input/keyboard/w90p910_keypad.c
@@ -258,7 +258,7 @@ static struct platform_driver w90p910_keypad_driver = {
258 .probe = w90p910_keypad_probe, 258 .probe = w90p910_keypad_probe,
259 .remove = __devexit_p(w90p910_keypad_remove), 259 .remove = __devexit_p(w90p910_keypad_remove),
260 .driver = { 260 .driver = {
261 .name = "nuc900-keypad", 261 .name = "nuc900-kpi",
262 .owner = THIS_MODULE, 262 .owner = THIS_MODULE,
263 }, 263 },
264}; 264};