summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-02-11 01:25:16 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-02-11 01:25:16 -0800
commit70df1c39815ae638586fbaec26d95dbaba8dad05 (patch)
tree4eb6067502f3260c7a0e9f580dcec1358946083b /drivers
parente884d847c27fe281a0e1f17a56b216b67ed5e9c7 (diff)
parenteaaf79250da5ddf05378f2b1c6f5eb3129aef686 (diff)
Merge "input: keyboard: correct suspend/resume for gpio_keys"
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/keyboard/gpio_keys.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 517b08b3bc0c..cf29f2756b84 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -870,6 +870,14 @@ static int gpio_keys_suspend(struct device *dev)
struct input_dev *input = ddata->input;
int i, ret;
+ if (ddata->key_pinctrl) {
+ ret = gpio_keys_pinctrl_configure(ddata, false);
+ if (ret) {
+ dev_err(dev, "failed to put the pin in suspend state\n");
+ return ret;
+ }
+ }
+
if (device_may_wakeup(dev)) {
for (i = 0; i < ddata->pdata->nbuttons; i++) {
struct gpio_button_data *bdata = &ddata->data[i];
@@ -883,14 +891,6 @@ static int gpio_keys_suspend(struct device *dev)
mutex_unlock(&input->mutex);
}
- if (ddata->key_pinctrl) {
- ret = gpio_keys_pinctrl_configure(ddata, false);
- if (ret) {
- dev_err(dev, "failed to put the pin in suspend state\n");
- return ret;
- }
- }
-
return 0;
}
@@ -901,6 +901,14 @@ static int gpio_keys_resume(struct device *dev)
int error = 0;
int i;
+ if (ddata->key_pinctrl) {
+ error = gpio_keys_pinctrl_configure(ddata, true);
+ if (error) {
+ dev_err(dev, "failed to put the pin in resume state\n");
+ return error;
+ }
+ }
+
if (device_may_wakeup(dev)) {
for (i = 0; i < ddata->pdata->nbuttons; i++) {
struct gpio_button_data *bdata = &ddata->data[i];
@@ -917,15 +925,6 @@ static int gpio_keys_resume(struct device *dev)
if (error)
return error;
- if (ddata->key_pinctrl) {
- error = gpio_keys_pinctrl_configure(ddata, true);
- if (error) {
- dev_err(dev, "failed to put the pin in resume state\n");
- return error;
- }
- }
-
-
gpio_keys_report_state(ddata);
return 0;
}