]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: Enable Keypad input on P2
authorMartin Fouts <Martin.Fouts@palmsource.com>
Thu, 18 Aug 2005 08:47:05 +0000 (01:47 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 18 Aug 2005 08:47:05 +0000 (01:47 -0700)
This patch allows the P2 keypad to operate if selected

drivers/input/keyboard/Kconfig
drivers/input/keyboard/omap-keypad.c
include/linux/input.h

index 2c8413337de33632a5ff6993b966d757b0f18b87..2f8419d6e629b45865363c39b3d8aeb360956a2e 100644 (file)
@@ -186,7 +186,7 @@ endif
 
 config KEYBOARD_OMAP
        tristate "TI OMAP keypad support"
-       depends on (ARCH_OMAP1510 || ARCH_OMAP16XX) && INPUT && INPUT_KEYBOARD
+       depends on (ARCH_OMAP730 || ARCH_OMAP1510 || ARCH_OMAP16XX) && INPUT && INPUT_KEYBOARD
        help
          Say Y here if you want to use the OMAP keypad.
 
index d9bc34f45ae39de467581df2ee079f978e159275..34f7dab92f9d718d39dcba42bc06ed52050f67a2 100644 (file)
@@ -46,6 +46,7 @@ static void omap_kp_timer(unsigned long);
 
 static struct input_dev omap_kp_dev;
 static unsigned char keypad_state[8];
+static unsigned int keypad_irq = INT_KEYBOARD;
 
 static struct timer_list kp_timer;
 DECLARE_TASKLET_DISABLED(kp_tasklet, omap_kp_tasklet, 0);
@@ -130,6 +131,40 @@ static int osk_keymap[] = {
        0 
 }; 
 
+static int p2_keymap[] = {
+       KEY(0,0,KEY_UP),
+       KEY(0,1,KEY_RIGHT),
+       KEY(0,2,KEY_LEFT),
+       KEY(0,3,KEY_DOWN),
+       KEY(0,4,KEY_CENTER),
+       KEY(0,5,KEY_0_5),
+       KEY(1,0,KEY_SOFT2),
+       KEY(1,1,KEY_SEND),
+       KEY(1,2,KEY_END),
+       KEY(1,3,KEY_VOLUMEDOWN),
+       KEY(1,4,KEY_VOLUMEUP),
+       KEY(1,5,KEY_RECORD),
+       KEY(2,0,KEY_SOFT1),
+       KEY(2,1,KEY_3),
+       KEY(2,2,KEY_6),
+       KEY(2,3,KEY_9),
+       KEY(2,4,KEY_SHARP),
+       KEY(2,5,KEY_2_5),
+       KEY(3,0,KEY_BACK),
+       KEY(3,1,KEY_2),
+       KEY(3,2,KEY_5),
+       KEY(3,3,KEY_8),
+       KEY(3,4,KEY_0),
+       KEY(3,5,KEY_HEADSETHOOK),
+       KEY(4,0,KEY_HOME),
+       KEY(4,1,KEY_1),
+       KEY(4,2,KEY_4),
+       KEY(4,3,KEY_7),
+       KEY(4,4,KEY_STAR),
+       KEY(4,5,KEY_POWER),
+       0
+};
+
 static int *keymap;
 
 static irqreturn_t omap_kp_interrupt(int irq, void *dev_id,
@@ -159,7 +194,7 @@ static void omap_kp_scan_keypad(unsigned char *state)
                if (machine_is_omap_osk() || machine_is_omap_h2() || machine_is_omap_h3()) {
                        udelay(9);
                } else {
-                       udelay(2);
+                       udelay(4);
                }
 
                state[col] = ~omap_readw(OMAP_MPUIO_BASE + OMAP_MPUIO_KBR_LATCH) & 0xff;
@@ -247,6 +282,9 @@ static int __init omap_kp_init(void)
                keymap = innovator_keymap;
        } else if (machine_is_omap_osk()) {
                keymap = osk_keymap;
+       } else if (machine_is_omap_perseus2()) {
+               keymap = p2_keymap;
+               keypad_irq = INT_730_MPUIO_KEYPAD;
        } else {
                keymap = test_keymap;
        }
@@ -256,7 +294,7 @@ static int __init omap_kp_init(void)
 
        /* get the irq and init timer*/
        tasklet_enable(&kp_tasklet);
-       if (request_irq(INT_KEYBOARD, omap_kp_interrupt, 0,
+       if (request_irq(keypad_irq, omap_kp_interrupt, 0,
                        "omap-keypad", 0) < 0)
                return -EINVAL;
 
@@ -297,7 +335,7 @@ static void __exit omap_kp_exit(void)
        tasklet_disable(&kp_tasklet);
        omap_writew(1, OMAP_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT);
 
-       free_irq(INT_KEYBOARD, 0);
+       free_irq(keypad_irq, 0);
        del_timer_sync(&kp_timer);
 
        /* unregister everything */
index bdc53c6cc962ad78989fbbb0cfbac2a68cb57aa2..595649e995fbcefdc0c4b3db09e662ae195c1c6d 100644 (file)
@@ -328,10 +328,22 @@ struct input_absinfo {
 #define KEY_BRIGHTNESSUP       225
 #define KEY_MEDIA              226
 
-#define KEY_SWITCHVIDEOMODE    227
-#define KEY_KBDILLUMTOGGLE     228
-#define KEY_KBDILLUMDOWN       229
-#define KEY_KBDILLUMUP         230
+
+/*Zeus: these keys are defined for OMAP730 Perseus2*/
+#define KEY_STAR               227
+#define KEY_SHARP              228
+#define KEY_SOFT1              229
+#define KEY_SOFT2              230
+#define KEY_SEND               231
+#define KEY_CENTER             232
+#define KEY_HEADSETHOOK                233
+#define KEY_0_5                        234
+#define KEY_2_5                        235
+
+#define KEY_SWITCHVIDEOMODE    236
+#define KEY_KBDILLUMTOGGLE     237
+#define KEY_KBDILLUMDOWN       238
+#define KEY_KBDILLUMUP         239
 
 #define KEY_UNKNOWN            240