aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorMike J. Chen <mjchen@sta.samsung.com>2010-10-14 18:04:03 -0700
committerTodd Poynor <toddpoynor@google.com>2011-09-12 17:28:20 -0700
commit7cfb88fe76b676b3db5a0931c1245bbe640de8db (patch)
tree889db957ee50251fc0f3db9f40a0ff76787d0f20 /drivers/input
parent36af2a472ac1b8785f679749c43e47fd37aba2b1 (diff)
downloadkernel_samsung_aries-7cfb88fe76b676b3db5a0931c1245bbe640de8db.zip
kernel_samsung_aries-7cfb88fe76b676b3db5a0931c1245bbe640de8db.tar.gz
kernel_samsung_aries-7cfb88fe76b676b3db5a0931c1245bbe640de8db.tar.bz2
input: misc: gpio; make wake irq conditional, and disable on remove paths
Add a board file option to gpio_input devices to make calling enable_irq_wake conditional. Also disable the wake irq when removing the device. Change-Id: If933b9d3a751d89fa95ae3b7f739dfe70fcb23c8 Signed-off-by: Mike J. Chen <mjchen@sta.samsung.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/gpio_input.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/input/misc/gpio_input.c b/drivers/input/misc/gpio_input.c
index 98d204f..904bd68 100644
--- a/drivers/input/misc/gpio_input.c
+++ b/drivers/input/misc/gpio_input.c
@@ -227,13 +227,25 @@ static int gpio_event_input_request_irqs(struct gpio_input_state *ds)
ds->info->keymap[i].gpio, irq);
goto err_request_irq_failed;
}
- enable_irq_wake(irq);
+ if (ds->info->info.no_suspend) {
+ err = enable_irq_wake(irq);
+ if (err) {
+ pr_err("gpio_event_input_request_irqs: "
+ "enable_irq_wake failed for input %d, "
+ "irq %d\n",
+ ds->info->keymap[i].gpio, irq);
+ goto err_enable_irq_wake_failed;
+ }
+ }
}
return 0;
for (i = ds->info->keymap_size - 1; i >= 0; i--) {
- free_irq(gpio_to_irq(ds->info->keymap[i].gpio),
- &ds->key_state[i]);
+ irq = gpio_to_irq(ds->info->keymap[i].gpio);
+ if (ds->info->info.no_suspend)
+ disable_irq_wake(irq);
+err_enable_irq_wake_failed:
+ free_irq(irq, &ds->key_state[i]);
err_request_irq_failed:
err_gpio_get_irq_num_failed:
;
@@ -341,8 +353,10 @@ int gpio_event_input_func(struct gpio_event_input_devs *input_devs,
hrtimer_cancel(&ds->timer);
if (ds->use_irq) {
for (i = di->keymap_size - 1; i >= 0; i--) {
- free_irq(gpio_to_irq(di->keymap[i].gpio),
- &ds->key_state[i]);
+ int irq = gpio_to_irq(di->keymap[i].gpio);
+ if (ds->info->info.no_suspend)
+ disable_irq_wake(irq);
+ free_irq(irq, &ds->key_state[i]);
}
}
spin_unlock_irqrestore(&ds->irq_lock, irqflags);