diff options
author | Nitin Kumbhar <nkumbhar@nvidia.com> | 2011-01-28 14:43:53 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:41:53 -0800 |
commit | 6a17252e8158a7dba2243e50c9213d073b708466 (patch) | |
tree | 50d9391c84fe77a0e1294ae53333466c16c5ec58 /drivers/input/keyboard | |
parent | e24c6418b127782ba976c1985f4a107eac7fcbf4 (diff) |
input: gpio-keys: report wakeup key on resume
During resume, gpio-keys does not get updated state of gpios which
fails to report wakeup key event. Update resume routine to report
key event based on wakeup source.
BUG 745149
Original-Change-Id: Iff7a9b431f9da8d226c8d3cd522725c3049fef07
Reviewed-on: http://git-master/r/17455
Tested-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Rebase-Id: Rde589cdb4f74683e9ea46933c7f949da16c5f884
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 67df91af8424..d6681e0775fc 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -714,15 +714,29 @@ static int gpio_keys_suspend(struct device *dev) static int gpio_keys_resume(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); + struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; + int wakeup_key = KEY_RESERVED; int i; + if (pdata && pdata->wakeup_key) + wakeup_key = pdata->wakeup_key(); + for (i = 0; i < ddata->n_buttons; i++) { struct gpio_keys_button *button = ddata->data[i].button; if (button->wakeup && device_may_wakeup(dev)) { int irq = gpio_to_irq(button->gpio); disable_irq_wake(irq); + + if (wakeup_key == button->code) { + unsigned int type = button->type ?: EV_KEY; + + input_event(ddata->input, type, button->code, 1); + input_event(ddata->input, type, button->code, 0); + input_sync(ddata->input); + } } gpio_keys_report_event(&ddata->data[i]); |