Skip to content

Commit

Permalink
Input: twl4030-pwrbutton - report a wakeup_event on button press
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
neilbrown authored and dtor committed Aug 22, 2012
1 parent 2fba26c commit 112b51c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/input/misc/twl4030-pwrbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 112b51c

Please sign in to comment.