Skip to content

Commit 2d325e5

Browse files
raagjadavandy-shev
authored andcommitted
pinctrl: baytrail: fix debounce disable case
We don't need to update debounce pulse value in case debounce is to be disabled. Break such a case where arg value is zero. Fixes: 4cfff5b ("pinctrl: baytrail: consolidate common mask operation") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/linux-gpio/d164d471-5432-4c3c-afdb-33dc8f53d043@moroto.mountain/ Signed-off-by: Raag Jadav <raag.jadav@intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 0bb80ec commit 2d325e5

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

drivers/pinctrl/intel/pinctrl-baytrail.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,11 +983,18 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev,
983983

984984
break;
985985
case PIN_CONFIG_INPUT_DEBOUNCE:
986-
if (arg)
986+
if (arg) {
987987
conf |= BYT_DEBOUNCE_EN;
988-
else
988+
} else {
989989
conf &= ~BYT_DEBOUNCE_EN;
990990

991+
/*
992+
* No need to update the pulse value.
993+
* Debounce is going to be disabled.
994+
*/
995+
break;
996+
}
997+
991998
switch (arg) {
992999
case 375:
9931000
db_pulse = BYT_DEBOUNCE_PULSE_375US;

0 commit comments

Comments
 (0)