Messages in this thread Patch in this message | | | From | Guenter Roeck <> | Subject | [PATCH 2/6] extcon-gpio: If the gpio driver/chip supports debounce, use it | Date | Thu, 29 Aug 2013 21:29:34 -0700 |
| |
Signed-off-by: Guenter Roeck <linux@roeck-us.net> --- drivers/extcon/extcon-gpio.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c index 77d35a7..973600e 100644 --- a/drivers/extcon/extcon-gpio.c +++ b/drivers/extcon/extcon-gpio.c @@ -111,6 +111,11 @@ static int gpio_extcon_probe(struct platform_device *pdev) if (ret < 0) goto err; + /* Use gpio debounce if available. If so, don't debounce in software. */ + if (pdata->debounce && + !gpio_set_debounce(extcon_data->gpio, pdata->debounce * 1000)) + extcon_data->debounce_jiffies = 0; + INIT_DELAYED_WORK(&extcon_data->work, gpio_extcon_work); extcon_data->irq = gpio_to_irq(extcon_data->gpio); -- 1.7.9.7
| |