linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/5] input: Update omap_keypad to use MATRIX_KEY macro
@ 2009-01-30 18:46 hartleys
  2009-02-06 22:54 ` hartleys
  0 siblings, 1 reply; 3+ messages in thread
From: hartleys @ 2009-01-30 18:46 UTC (permalink / raw)
  To: linux-input

Update the omap_keypad driver to use common MATRIX_KEY macro.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

---

diff --git a/arch/arm/plat-omap/include/mach/keypad.h
b/arch/arm/plat-omap/include/mach/keypad.h
index 232923a..c8269c3 100644
--- a/arch/arm/plat-omap/include/mach/keypad.h
+++ b/arch/arm/plat-omap/include/mach/keypad.h
@@ -13,7 +13,7 @@
 struct omap_kp_platform_data {
 	int rows;
 	int cols;
-	int *keymap;
+	unsigned int *keymap;
 	unsigned int keymapsize;
 	unsigned int rep:1;
 	unsigned long delay;
@@ -33,7 +33,5 @@ struct omap_kp_platform_data {
 #define GROUP_3		(3 << 16)
 #define GROUP_MASK	GROUP_3

-#define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val))
-
 #endif

diff --git a/drivers/input/keyboard/omap-keypad.c
b/drivers/input/keyboard/omap-keypad.c
index 3f3d119..d5e9f24 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -64,7 +64,7 @@ struct omap_kp {

 static DECLARE_TASKLET_DISABLED(kp_tasklet, omap_kp_tasklet, 0);

-static int *keymap;
+static unsigned int *keymap;
 static unsigned int *row_gpios;
 static unsigned int *col_gpios;

@@ -151,9 +151,10 @@ static void omap_kp_scan_keypad(struct omap_kp
*omap_kp, unsigned char *state)

 static inline int omap_kp_find_key(int col, int row)
 {
-	int i, key;
+	unsigned int key;
+	int i;

-	key = KEY(col, row, 0);
+	key = MATRIX_KEY(col, row, 0);
 	for (i = 0; keymap[i] != 0; i++)
 		if ((keymap[i] & 0xff000000) == key)
 			return keymap[i] & 0x00ffffff; 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-08 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-30 18:46 [PATCH 2/5] input: Update omap_keypad to use MATRIX_KEY macro hartleys
2009-02-06 22:54 ` hartleys
2009-02-08 16:44   ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).