Skip to content

Commit 5f71477

Browse files
committed
pinctrl: baytrail: Avoid clearing debounce value when turning it off
Baytrail pin control has a common register to set up debounce timeout. When a pin configuration requested debounce to be disabled, the rest of the pins may still want to have debounce enabled and thus rely on the common timeout value. Avoid clearing debounce value when turning it off for one pin while others may still use it. Fixes: 658b476 ("pinctrl: baytrail: Add debounce configuration") Depends-on: 04ff5a0 ("pinctrl: baytrail: Rectify debounce support") Depends-on: 827e157 ("pinctrl: baytrail: Rectify debounce support (part 2)") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
1 parent 03a61f1 commit 5f71477

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/pinctrl/intel/pinctrl-baytrail.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,6 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev,
10491049
break;
10501050
case PIN_CONFIG_INPUT_DEBOUNCE:
10511051
debounce = readl(db_reg);
1052-
debounce &= ~BYT_DEBOUNCE_PULSE_MASK;
10531052

10541053
if (arg)
10551054
conf |= BYT_DEBOUNCE_EN;
@@ -1058,24 +1057,31 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev,
10581057

10591058
switch (arg) {
10601059
case 375:
1060+
debounce &= ~BYT_DEBOUNCE_PULSE_MASK;
10611061
debounce |= BYT_DEBOUNCE_PULSE_375US;
10621062
break;
10631063
case 750:
1064+
debounce &= ~BYT_DEBOUNCE_PULSE_MASK;
10641065
debounce |= BYT_DEBOUNCE_PULSE_750US;
10651066
break;
10661067
case 1500:
1068+
debounce &= ~BYT_DEBOUNCE_PULSE_MASK;
10671069
debounce |= BYT_DEBOUNCE_PULSE_1500US;
10681070
break;
10691071
case 3000:
1072+
debounce &= ~BYT_DEBOUNCE_PULSE_MASK;
10701073
debounce |= BYT_DEBOUNCE_PULSE_3MS;
10711074
break;
10721075
case 6000:
1076+
debounce &= ~BYT_DEBOUNCE_PULSE_MASK;
10731077
debounce |= BYT_DEBOUNCE_PULSE_6MS;
10741078
break;
10751079
case 12000:
1080+
debounce &= ~BYT_DEBOUNCE_PULSE_MASK;
10761081
debounce |= BYT_DEBOUNCE_PULSE_12MS;
10771082
break;
10781083
case 24000:
1084+
debounce &= ~BYT_DEBOUNCE_PULSE_MASK;
10791085
debounce |= BYT_DEBOUNCE_PULSE_24MS;
10801086
break;
10811087
default:

0 commit comments

Comments
 (0)