diff options
author | Samuel Ortiz <sameo@openedhand.com> | 2008-03-20 09:48:14 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-03-20 09:48:14 -0400 |
commit | 688dad4f4c9004fcaa4cadad167b064342be5d63 (patch) | |
tree | ac5feec50e0c81552bc3e15e18182a360c0e065a /drivers/input | |
parent | 3c00bb96497a9c1251359a1faf68dddbb8d50a23 (diff) |
Input: pxa27x - fix keypad KPC macros
We want to mask (key_number - 1), not key_number. The current
implementation works fine for all values but the maximum one,
i.e. 8.
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/pxa27x_keypad.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index 6224c2fb3b65..4e651c11c1da 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c | |||
@@ -50,9 +50,9 @@ | |||
50 | #define KPKDI 0x0048 | 50 | #define KPKDI 0x0048 |
51 | 51 | ||
52 | /* bit definitions */ | 52 | /* bit definitions */ |
53 | #define KPC_MKRN(n) ((((n) & 0x7) - 1) << 26) /* matrix key row number */ | 53 | #define KPC_MKRN(n) ((((n) - 1) & 0x7) << 26) /* matrix key row number */ |
54 | #define KPC_MKCN(n) ((((n) & 0x7) - 1) << 23) /* matrix key column number */ | 54 | #define KPC_MKCN(n) ((((n) - 1) & 0x7) << 23) /* matrix key column number */ |
55 | #define KPC_DKN(n) ((((n) & 0x7) - 1) << 6) /* direct key number */ | 55 | #define KPC_DKN(n) ((((n) - 1) & 0x7) << 6) /* direct key number */ |
56 | 56 | ||
57 | #define KPC_AS (0x1 << 30) /* Automatic Scan bit */ | 57 | #define KPC_AS (0x1 << 30) /* Automatic Scan bit */ |
58 | #define KPC_ASACT (0x1 << 29) /* Automatic Scan on Activity */ | 58 | #define KPC_ASACT (0x1 << 29) /* Automatic Scan on Activity */ |