Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346963
b: refs/heads/master
c: dda19a9
h: refs/heads/master
i:
  346961: 3c87d41
  346959: da81719
v: v3
  • Loading branch information
Jonas Aaberg authored and Dmitry Torokhov committed Nov 28, 2012
1 parent 08e2e99 commit 958c71f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5b76d7b4cd965a84d922f303fe51a49cca89f9bb
refs/heads/master: dda19a92f033399641e47db0b75beb01d001146b
27 changes: 22 additions & 5 deletions trunk/drivers/input/keyboard/gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ static int gpio_keys_remove(struct platform_device *pdev)
static int gpio_keys_suspend(struct device *dev)
{
struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
struct input_dev *input = ddata->input;
int i;

if (device_may_wakeup(dev)) {
Expand All @@ -811,6 +812,11 @@ static int gpio_keys_suspend(struct device *dev)
if (bdata->button->wakeup)
enable_irq_wake(bdata->irq);
}
} else {
mutex_lock(&input->mutex);
if (input->users)
gpio_keys_close(input);
mutex_unlock(&input->mutex);
}

return 0;
Expand All @@ -819,16 +825,27 @@ static int gpio_keys_suspend(struct device *dev)
static int gpio_keys_resume(struct device *dev)
{
struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
struct input_dev *input = ddata->input;
int error = 0;
int i;

for (i = 0; i < ddata->pdata->nbuttons; i++) {
struct gpio_button_data *bdata = &ddata->data[i];
if (bdata->button->wakeup && device_may_wakeup(dev))
disable_irq_wake(bdata->irq);
if (device_may_wakeup(dev)) {
for (i = 0; i < ddata->pdata->nbuttons; i++) {
struct gpio_button_data *bdata = &ddata->data[i];
if (bdata->button->wakeup)
disable_irq_wake(bdata->irq);
}
} else {
mutex_lock(&input->mutex);
if (input->users)
error = gpio_keys_open(input);
mutex_unlock(&input->mutex);
}

gpio_keys_report_state(ddata);
if (error)
return error;

gpio_keys_report_state(ddata);
return 0;
}
#endif
Expand Down

0 comments on commit 958c71f

Please sign in to comment.