Input: cros_ec_keyb - fix clearing keyboard state on wakeup
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Mon, 6 Apr 2015 16:44:59 +0000 (09:44 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 6 Apr 2015 17:01:20 +0000 (10:01 -0700)
As the comment right before explains, the keyboard state is to be cleared
only if the EC wasn't a wakeup source in the last suspend.

Without this commit, there's an unneeded delay when resuming from suspend
and we also lose the key that was pressed while suspended.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/cros_ec_keyb.c

index ffa989f2c785100a0006f145816ca73e4f90c462..64b9b59ad4cbf434e658336dc7351496ba38d94e 100644 (file)
@@ -338,7 +338,7 @@ static int cros_ec_keyb_resume(struct device *dev)
         * wake source (e.g. the lid is open and the user might press a key to
         * wake) then the key scan buffer should be preserved.
         */
-       if (ckdev->ec->was_wake_device)
+       if (!ckdev->ec->was_wake_device)
                cros_ec_keyb_clear_keyboard(ckdev);
 
        return 0;