]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Input: pxa27x - fix keypad KPC macros
authorSamuel Ortiz <sameo@openedhand.com>
Thu, 20 Mar 2008 13:48:14 +0000 (09:48 -0400)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 20 Mar 2008 13:48:14 +0000 (09:48 -0400)
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>
drivers/input/keyboard/pxa27x_keypad.c

index 6224c2fb3b65981aec7e6e8386b587d19ebfaf18..4e651c11c1dad71c64fe033381447cb31212f079 100644 (file)
@@ -50,9 +50,9 @@
 #define KPKDI           0x0048
 
 /* bit definitions */
-#define KPC_MKRN(n)    ((((n) & 0x7) - 1) << 26) /* matrix key row number */
-#define KPC_MKCN(n)    ((((n) & 0x7) - 1) << 23) /* matrix key column number */
-#define KPC_DKN(n)     ((((n) & 0x7) - 1) << 6)  /* direct key number */
+#define KPC_MKRN(n)    ((((n) - 1) & 0x7) << 26) /* matrix key row number */
+#define KPC_MKCN(n)    ((((n) - 1) & 0x7) << 23) /* matrix key column number */
+#define KPC_DKN(n)     ((((n) - 1) & 0x7) << 6)  /* direct key number */
 
 #define KPC_AS          (0x1 << 30)  /* Automatic Scan bit */
 #define KPC_ASACT       (0x1 << 29)  /* Automatic Scan on Activity */