Skip to content

Commit

Permalink
Input: mark serio and i8042 as suspended when hibernating too
Browse files Browse the repository at this point in the history
Serio ports are not being restarted any longer because resume operations
after hibernate do nothing, since the device has not been marked as
suspended. This happens because suspend is only considering the SUSPEND
event but not the FREEZE event.

Note that this driver has still to migrate to dev_pm_ops, but this fixes
this particular bug now.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and Dmitry Torokhov committed Jul 8, 2009
1 parent bab7614 commit ddaa434
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions drivers/input/serio/i8042.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,10 +934,11 @@ static bool i8042_suspended;

static int i8042_suspend(struct platform_device *dev, pm_message_t state)
{
if (!i8042_suspended && state.event == PM_EVENT_SUSPEND) {
if (!i8042_suspended && state.event == PM_EVENT_SUSPEND)
i8042_controller_reset();
i8042_suspended = true;
}

i8042_suspended = state.event == PM_EVENT_SUSPEND ||
state.event == PM_EVENT_FREEZE;

return 0;
}
Expand Down
7 changes: 4 additions & 3 deletions drivers/input/serio/serio.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,11 @@ static int serio_suspend(struct device *dev, pm_message_t state)
{
struct serio *serio = to_serio_port(dev);

if (!serio->suspended && state.event == PM_EVENT_SUSPEND) {
if (!serio->suspended && state.event == PM_EVENT_SUSPEND)
serio_cleanup(serio);
serio->suspended = true;
}

serio->suspended = state.event == PM_EVENT_SUSPEND ||
state.event == PM_EVENT_FREEZE;

return 0;
}
Expand Down

0 comments on commit ddaa434

Please sign in to comment.