]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
Input: mark serio and i8042 as suspended when hibernating too
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Wed, 8 Jul 2009 05:10:02 +0000 (22:10 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 8 Jul 2009 05:46:58 +0000 (22:46 -0700)
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>
drivers/input/serio/i8042.c
drivers/input/serio/serio.c

index f919bf57293c9fad56d625aa1e497655eda5a04a..582245c497ebfe1e6ff5b8fbe513a31e483de35f 100644 (file)
@@ -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;
 }
index fb17573f8f2d90e88072714b0a8fc4b7eb142616..d66f4944f2a0efc0a18508d9c4707bf069567830 100644 (file)
@@ -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;
 }