Input: omap4-keypad - wake-up on events & long presses
authorMike Turquette <mturquette@ti.com>
Thu, 30 Sep 2010 06:38:01 +0000 (23:38 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 13 Oct 2010 14:49:26 +0000 (07:49 -0700)
Program keyboard controller to generate a wake-up request on events and
on long key presses. It will not generate wake-up requests on timeouts
since driver code does not handle them.

This allows keyboard to wake-up OMAP from suspend.

Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Abraham Arce <x0066660@ti.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/keyboard/omap4-keypad.c

index 07e792e960f17f55d327edde0fda1914e93c9f11..45bd0977d0066622d543a9d51cca96873536f8a9 100644 (file)
@@ -54,6 +54,8 @@
 #define OMAP4_DEF_IRQENABLE_EVENTEN    (1 << 0)
 #define OMAP4_DEF_IRQENABLE_LONGKEY    (1 << 1)
 #define OMAP4_DEF_IRQENABLE_TIMEOUTEN  (1 << 2)
+#define OMAP4_DEF_WUP_EVENT_ENA                (1 << 0)
+#define OMAP4_DEF_WUP_LONG_KEY_ENA     (1 << 1)
 #define OMAP4_DEF_CTRL_NOSOFTMODE      (1 << 1)
 #define OMAP4_DEF_CTRLPTVVALUE         (1 << 2)
 #define OMAP4_DEF_CTRLPTV              (1 << 1)
@@ -88,6 +90,8 @@ static void __devinit omap4_keypad_config(struct omap4_keypad *keypad_data)
                        keypad_data->base + OMAP4_KBD_IRQSTATUS);
        __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
                        keypad_data->base + OMAP4_KBD_IRQENABLE);
+       __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
+                       keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
 }
 
 /* Interrupt handler */