mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 07:03:37 +02:00
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>
This commit is contained in:
parent
36af2a472a
commit
7cfb88fe76
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user