提交 338de0ca 编写于 作者: G Guenter Roeck 提交者: Chanwoo Choi

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: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
上级 1073514b
......@@ -100,7 +100,13 @@ static int gpio_extcon_probe(struct platform_device *pdev)
extcon_data->state_off = pdata->state_off;
if (pdata->state_on && pdata->state_off)
extcon_data->edev.print_state = extcon_gpio_print_state;
extcon_data->debounce_jiffies = msecs_to_jiffies(pdata->debounce);
if (pdata->debounce) {
ret = gpio_set_debounce(extcon_data->gpio,
pdata->debounce * 1000);
if (ret < 0)
extcon_data->debounce_jiffies =
msecs_to_jiffies(pdata->debounce);
}
ret = extcon_dev_register(&extcon_data->edev, &pdev->dev);
if (ret < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册