Commit 827e1579 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: baytrail: Rectify debounce support (part 2)

The commit 04ff5a09 ("pinctrl: baytrail: Rectify debounce support")
almost fixes the logic of debuonce but missed couple of things, i.e.
typo in mask when disabling debounce and lack of enabling it back.

This patch addresses above issues.
Reported-by: default avatarJean Delvare <jdelvare@suse.de>
Fixes: 04ff5a09 ("pinctrl: baytrail: Rectify debounce support")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 19b26d92
......@@ -1243,10 +1243,12 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev,
debounce = readl(db_reg);
debounce &= ~BYT_DEBOUNCE_PULSE_MASK;
if (arg)
conf |= BYT_DEBOUNCE_EN;
else
conf &= ~BYT_DEBOUNCE_EN;
switch (arg) {
case 0:
conf &= BYT_DEBOUNCE_EN;
break;
case 375:
debounce |= BYT_DEBOUNCE_PULSE_375US;
break;
......@@ -1269,7 +1271,9 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev,
debounce |= BYT_DEBOUNCE_PULSE_24MS;
break;
default:
if (arg)
ret = -EINVAL;
break;
}
if (!ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment