Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 658b476c742f ("pinctrl: baytrail: Add debounce configuration")
Depends-on: 04ff5a095d66 ("pinctrl: baytrail: Rectify debounce support")
Depends-on: 827e1579e1d5 ("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>

+7 -1
+7 -1
drivers/pinctrl/intel/pinctrl-baytrail.c
··· 1049 1049 break; 1050 1050 case PIN_CONFIG_INPUT_DEBOUNCE: 1051 1051 debounce = readl(db_reg); 1052 - debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1053 1052 1054 1053 if (arg) 1055 1054 conf |= BYT_DEBOUNCE_EN; ··· 1057 1058 1058 1059 switch (arg) { 1059 1060 case 375: 1061 + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1060 1062 debounce |= BYT_DEBOUNCE_PULSE_375US; 1061 1063 break; 1062 1064 case 750: 1065 + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1063 1066 debounce |= BYT_DEBOUNCE_PULSE_750US; 1064 1067 break; 1065 1068 case 1500: 1069 + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1066 1070 debounce |= BYT_DEBOUNCE_PULSE_1500US; 1067 1071 break; 1068 1072 case 3000: 1073 + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1069 1074 debounce |= BYT_DEBOUNCE_PULSE_3MS; 1070 1075 break; 1071 1076 case 6000: 1077 + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1072 1078 debounce |= BYT_DEBOUNCE_PULSE_6MS; 1073 1079 break; 1074 1080 case 12000: 1081 + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1075 1082 debounce |= BYT_DEBOUNCE_PULSE_12MS; 1076 1083 break; 1077 1084 case 24000: 1085 + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1078 1086 debounce |= BYT_DEBOUNCE_PULSE_24MS; 1079 1087 break; 1080 1088 default: