aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/plat-pxa/include/plat/pxa27x_keypad.h2
-rw-r--r--drivers/input/keyboard/pxa27x_keypad.c10
2 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h b/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
index abcc36eb1242..7ffb16b80639 100644
--- a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
+++ b/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
@@ -44,6 +44,8 @@ struct pxa27x_keypad_platform_data {
44 /* direct keys */ 44 /* direct keys */
45 int direct_key_num; 45 int direct_key_num;
46 unsigned int direct_key_map[MAX_DIRECT_KEY_NUM]; 46 unsigned int direct_key_map[MAX_DIRECT_KEY_NUM];
47 /* the key output may be low active */
48 int direct_key_low_active;
47 49
48 /* rotary encoders 0 */ 50 /* rotary encoders 0 */
49 int enable_rotary0; 51 int enable_rotary0;
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 5d717202aad8..a60f14e7983e 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -311,7 +311,15 @@ static void pxa27x_keypad_scan_direct(struct pxa27x_keypad *keypad)
311 if (pdata->enable_rotary0 || pdata->enable_rotary1) 311 if (pdata->enable_rotary0 || pdata->enable_rotary1)
312 pxa27x_keypad_scan_rotary(keypad); 312 pxa27x_keypad_scan_rotary(keypad);
313 313
314 new_state = KPDK_DK(kpdk) & keypad->direct_key_mask; 314 /*
315 * The KPDR_DK only output the key pin level, so it relates to board,
316 * and low level may be active.
317 */
318 if (pdata->direct_key_low_active)
319 new_state = ~KPDK_DK(kpdk) & keypad->direct_key_mask;
320 else
321 new_state = KPDK_DK(kpdk) & keypad->direct_key_mask;
322
315 bits_changed = keypad->direct_key_state ^ new_state; 323 bits_changed = keypad->direct_key_state ^ new_state;
316 324
317 if (bits_changed == 0) 325 if (bits_changed == 0)