[go: up one dir, main page]

lkml.org 
[lkml]   [2013]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/6] extcon-gpio: If the gpio driver/chip supports debounce, use it
Date
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


\
 
 \ /
  Last update: 2013-08-30 07:01    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog