pinctrl: baytrail: fix debounce disable case
[platform/kernel/linux-starfive.git] / drivers / pinctrl / intel / pinctrl-baytrail.c
index faa8b7f..ec76e43 100644 (file)
@@ -983,11 +983,18 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev,
 
                        break;
                case PIN_CONFIG_INPUT_DEBOUNCE:
-                       if (arg)
+                       if (arg) {
                                conf |= BYT_DEBOUNCE_EN;
-                       else
+                       } else {
                                conf &= ~BYT_DEBOUNCE_EN;
 
+                               /*
+                                * No need to update the pulse value.
+                                * Debounce is going to be disabled.
+                                */
+                               break;
+                       }
+
                        switch (arg) {
                        case 375:
                                db_pulse = BYT_DEBOUNCE_PULSE_375US;