Skip to content

Commit

Permalink
pinctrl: baytrail: Rectify debounce support (part 2)
Browse files Browse the repository at this point in the history
[ Upstream commit 827e157 ]

The commit 04ff5a0 ("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: 04ff5a0 ("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]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
andy-shev authored and gregkh committed Jun 17, 2017
1 parent 3564d41 commit 6261471
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/pinctrl/intel/pinctrl-baytrail.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,10 +1250,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;
Expand All @@ -1276,7 +1278,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)
Expand Down

0 comments on commit 6261471

Please sign in to comment.