diff --git a/drivers/input/input.c b/drivers/input/input.c index 8921c6180c5..661e7ae3328 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -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; } diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index b69fee86ef8..9f03500288b 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -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",