Input: twl4030-pwrbutton - report a wakeup_event on button press
authorNeilBrown <neilb@suse.de>
Mon, 30 Jul 2012 05:25:51 +0000 (22:25 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 22 Aug 2012 05:29:48 +0000 (22:29 -0700)
As the power button causes a wake from suspend, we need to register
the event with the pm sustem to avoid racing with suspend.

As the input event is reported in the interrupt handler, as simple
pm_wakeup_event() is sufficient.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/twl4030-pwrbutton.c

index 38e4b507b94cc629ef330cf173b1b41d3765e904..b3dd96d6448b324569bdf8dc64b2af6a50e40d58 100644 (file)
@@ -42,6 +42,7 @@ static irqreturn_t powerbutton_irq(int irq, void *_pwr)
        err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &value,
                                STS_HW_CONDITIONS);
        if (!err)  {
+               pm_wakeup_event(pwr->dev.parent, 0);
                input_report_key(pwr, KEY_POWER, value & PWR_PWRON_IRQ);
                input_sync(pwr);
        } else {