Skip to contentSkip to conversation

Fix pxa27x keypad KPC macros

PATCH Applied Samuel Ortiz 3 participants 3 messages Feb 19, 2008 – Mar 20, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix pxa27x keypad KPC macros

Hi Dmitry,

On the pxa27x keypad driver, 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.

This patch is against your input git tree.

---
 drivers/input/keyboard/pxa27x_keypad.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/input/keyboard/pxa27x_keypad.c +3 -3
Index: linux-2.6-input/drivers/input/keyboard/pxa27x_keypad.c
===================================================================
@@ -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 */
#1 lore raw

Yes, indeed. Sorry I'm replying this late as I just come across.

Quoted 37 lines · Samuel Ortiz

Hi Dmitry,

On the pxa27x keypad driver, 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.

This patch is against your input git tree.

---

  drivers/input/keyboard/pxa27x_keypad.c |    6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6-input/drivers/input/keyboard/pxa27x_keypad.c
===================================================================
--- linux-2.6-input.orig/drivers/input/keyboard/pxa27x_keypad.c 2008-02-19 11:10:04.000000000 +0100
+++ linux-2.6-input/drivers/input/keyboard/pxa27x_keypad.c 2008-02-19 11:11:00.000000000 +0100
@@ -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 */

-
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Cheers
- eric

A message that is not in the archive (sent off-list or not yet received): [email protected]