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);
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,
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;
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;
}
/* 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;
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 */
#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