aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorChao Xie <chao.xie@marvell.com>2012-04-01 10:08:03 +0800
committerHaojian Zhuang <haojian.zhuang@gmail.com>2012-04-27 16:49:07 +0800
commitee1d8040a6b0a8106c7d9e80b9193077224493ba (patch)
treeafb16aa484c7843ef88cf093355d370e8cb5f8db /drivers/input/keyboard
parentInput: pxa27x_keypad bug fix for direct_key_mask (diff)
downloadlinux-dev-ee1d8040a6b0a8106c7d9e80b9193077224493ba.tar.xz
linux-dev-ee1d8040a6b0a8106c7d9e80b9193077224493ba.zip
Input: pxa27x_keypad direct key may be low active
KPDK_DK only indicates the pin level of direct key. So it is related to board, and low level may be active which indicates that a key is pressed. Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/pxa27x_keypad.c10
1 files changed, 9 insertions, 1 deletions
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)
if (pdata->enable_rotary0 || pdata->enable_rotary1)
pxa27x_keypad_scan_rotary(keypad);
- new_state = KPDK_DK(kpdk) & keypad->direct_key_mask;
+ /*
+ * The KPDR_DK only output the key pin level, so it relates to board,
+ * and low level may be active.
+ */
+ if (pdata->direct_key_low_active)
+ new_state = ~KPDK_DK(kpdk) & keypad->direct_key_mask;
+ else
+ new_state = KPDK_DK(kpdk) & keypad->direct_key_mask;
+
bits_changed = keypad->direct_key_state ^ new_state;
if (bits_changed == 0)