mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-08 02:19:51 +01:00
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 <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
This commit is contained in:
1 parent
1073514b11
commit
338de0ca68
1 file changed
+7
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user