Input: gpio-keys - do not rely on debouncing capabilities of dedicated irqs
Subsystems (2)
PATCH 1/1 Input: gpio-keys - do not rely on debouncing capabilities of dedicated irqs
If no GPIO interrupts are used, these IRQs are unlikely subject to the same debouncing mechanisms as a GPIO interrupt would be, so stick to software debouncing. Experienced on OMAP4 using pinctrl IRQs.
Fixes 3717194f2492 ("Input: gpio-keys - add system suspend support for dedicated wakeirqs")
Signed-off-by Andreas Kemnade <[email protected]>
--- drivers/input/keyboard/gpio_keys.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/input/keyboard/gpio_keys.c +9 -5
@@ -554,12 +554,16 @@ static int gpio_keys_setup_key(struct platform_device *pdev,bool active_low =gpiod_is_active_low (bdata->gpiod);if (button->debounce_interval) { - error =gpiod_set_debounce (bdata->gpiod, +/* do not rely on non-gpio irqs being subject to debouncing measures */ +if ((button->irq || button->wakeirq)) { + bdata->software_debounce = button->debounce_interval; + }else { + error =gpiod_set_debounce (bdata->gpiod, button->debounce_interval *1000 ); -/* use timer if gpiolib doesn't provide debounce */ -if (error <0 ) - bdata->software_debounce = - button->debounce_interval; +/* use timer if gpiolib doesn't provide debounce */ +if (error <0 ) + bdata->software_debounce = button->debounce_interval; + }/* * If reading the GPIO won't sleep, we can use a
Signature · 1 line
2.47.3
Quoted 6 lines · Andreas Kemnade
If no GPIO interrupts are used, these IRQs are unlikely subject to the same debouncing mechanisms as a GPIO interrupt would be, so stick to software debouncing. Experienced on OMAP4 using pinctrl IRQs.
Fixes 3717194f2492 ("Input: gpio-keys - add system suspend support for dedicated wakeirqs")Signed-off-by Andreas Kemnade <[email protected]>
Applied, thank you.
Signature · 1 line
Dmitry