diff options
author | Andy Shevchenko <[email protected]> | 2017-01-26 19:24:07 +0200 |
---|---|---|
committer | Linus Walleij <[email protected]> | 2017-01-30 15:46:33 +0100 |
commit | 827e1579e1d5cb66e340e7be1944b825b542bbdf (patch) | |
tree | 6eb8389acb1e9d1fabd496eedd861734f832d90b | |
parent | 19b26d92dfb70f56440c187a20c49102ab648b97 (diff) |
pinctrl: baytrail: Rectify debounce support (part 2)
The commit 04ff5a095d66 ("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: Jean Delvare <[email protected]>
Fixes: 04ff5a095d66 ("pinctrl: baytrail: Rectify debounce support")
Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Jean Delvare <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-baytrail.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index c123488266ce..3eb7c2bde87e 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -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: - ret = -EINVAL; + if (arg) + ret = -EINVAL; + break; } if (!ret) |