aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-09-10 22:16:18 -0400
committerChanwoo Choi <cw00.choi@samsung.com>2013-09-26 20:37:00 -0400
commit338de0ca682ca95d3f6185459e11540c37dd8a2a (patch)
tree68bf1fdd6a040e8838755449bbe7e0566e4af09f /drivers/extcon
parent1073514b11c221081c7c1f4a14b3eee5365385fa (diff)
extcon: gpio: Use gpio driver/chip debounce if supported
This patch use gpio_set_debounce() API provided from gpiolib if SoC or device driver with gpio support gpio_set_debounce() function. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-gpio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
index 6368a0f3ae6d..862743bc825f 100644
--- a/drivers/extcon/extcon-gpio.c
+++ b/drivers/extcon/extcon-gpio.c
@@ -100,7 +100,13 @@ static int gpio_extcon_probe(struct platform_device *pdev)
100 extcon_data->state_off = pdata->state_off; 100 extcon_data->state_off = pdata->state_off;
101 if (pdata->state_on && pdata->state_off) 101 if (pdata->state_on && pdata->state_off)
102 extcon_data->edev.print_state = extcon_gpio_print_state; 102 extcon_data->edev.print_state = extcon_gpio_print_state;
103 extcon_data->debounce_jiffies = msecs_to_jiffies(pdata->debounce); 103 if (pdata->debounce) {
104 ret = gpio_set_debounce(extcon_data->gpio,
105 pdata->debounce * 1000);
106 if (ret < 0)
107 extcon_data->debounce_jiffies =
108 msecs_to_jiffies(pdata->debounce);
109 }
104 110
105 ret = extcon_dev_register(&extcon_data->edev, &pdev->dev); 111 ret = extcon_dev_register(&extcon_data->edev, &pdev->dev);
106 if (ret < 0) 112 if (ret < 0)