diff options
author | Nitin Kumbhar <nkumbhar@nvidia.com> | 2011-01-28 14:43:53 +0530 |
---|---|---|
committer | Niket Sirsi <nsirsi@nvidia.com> | 2011-01-28 19:38:51 -0800 |
commit | 4ff2f5a056bf5a17aac4cdb256a39b304c9a1314 (patch) | |
tree | 5bd4988a55517a18e0d9e28107b565b216e37124 /drivers/input | |
parent | 174f888131a1e7c5e970a8a94944d7101f8f4fa1 (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
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>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 6069abe31e42..4b75848b6351 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -594,14 +594,26 @@ static int gpio_keys_resume(struct device *dev) struct platform_device *pdev = to_platform_device(dev); struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev); struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; + int wakeup_key = KEY_RESERVED; int i; + if (pdata->wakeup_key) + wakeup_key = pdata->wakeup_key(); + for (i = 0; i < pdata->nbuttons; i++) { struct gpio_keys_button *button = &pdata->buttons[i]; if (button->wakeup && device_may_wakeup(&pdev->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]); |