[PATCH 2/5] input: Update omap_keypad to use MATRIX_KEY macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Update the omap_keypad driver to use common MATRIX_KEY macro.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>

---

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; 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux