From: Tomeu Vizoso Date: Mon, 6 Apr 2015 16:44:59 +0000 (-0700) Subject: Input: cros_ec_keyb - fix clearing keyboard state on wakeup X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ef30a406468a3eae007210ae0dc5ed8d5eb59b7d;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Input: cros_ec_keyb - fix clearing keyboard state on wakeup 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 Reviewed-by: Javier Martinez Canillas Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index ffa989f2c785..64b9b59ad4cb 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -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;