Prevent input subsystem from resetting key state during resume when wake enabled
Change-Id: I21908b932df5d9a1dc965221d849644101b7a259 Signed-off-by: paris_yeh <paris_yeh@asus.com>
This commit is contained in:
committed by
Android Partner Code Review
parent
fdf1b1cd3a
commit
71db33d591
@@ -1602,7 +1602,10 @@ static int input_dev_resume(struct device *dev)
|
||||
{
|
||||
struct input_dev *input_dev = to_input_dev(dev);
|
||||
|
||||
input_reset_device(input_dev);
|
||||
/* If device is configured to wake device do not reset keys. */
|
||||
if (!device_can_wakeup(dev)) {
|
||||
input_reset_device(input_dev);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -732,6 +732,13 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
|
||||
goto fail2;
|
||||
}
|
||||
|
||||
/* If any single key button can wake the device, we need to inform
|
||||
the input subsystem not to mess with our key state during a suspend
|
||||
and resume cycle. */
|
||||
if (wakeup) {
|
||||
device_set_wakeup_capable(&input->dev, true);
|
||||
}
|
||||
|
||||
error = input_register_device(input);
|
||||
if (error) {
|
||||
dev_err(dev, "Unable to register input device, error: %d\n",
|
||||
|
||||
Reference in New Issue
Block a user