Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c86f75d authored by Hsin-Yi Wang's avatar Hsin-Yi Wang Committed by Greg Kroah-Hartman
Browse files

pinctrl: mediatek: Fix fallback behavior for bias_set_combo



commit 798a315fc359aa6dbe48e09d802aa59b7e158ffc upstream.

Some pin doesn't support PUPD register, if it fails and fallbacks with
bias_set_combo case, it will call mtk_pinconf_bias_set_pupd_r1_r0() to
modify the PUPD pin again.

Since the general bias set are either PU/PD or PULLSEL/PULLEN, try
bias_set or bias_set_rev1 for the other fallback case. If the pin
doesn't support neither PU/PD nor PULLSEL/PULLEN, it will return
-ENOTSUPP.

Fixes: 81bd1579b43e ("pinctrl: mediatek: Fix fallback call path")
Signed-off-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Reviewed-by: default avatarZhiyong Tao <zhiyong.tao@mediatek.com>
Link: https://lore.kernel.org/r/20210701080955.2660294-1-hsinyi@chromium.org


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3bbbcafb
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -877,12 +877,10 @@ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
			err = hw->soc->bias_set(hw, desc, pullup);
			err = hw->soc->bias_set(hw, desc, pullup);
			if (err)
			if (err)
				return err;
				return err;
		} else if (hw->soc->bias_set_combo) {
			err = hw->soc->bias_set_combo(hw, desc, pullup, arg);
			if (err)
				return err;
		} else {
		} else {
			return -ENOTSUPP;
			err = mtk_pinconf_bias_set_rev1(hw, desc, pullup);
			if (err)
				err = mtk_pinconf_bias_set(hw, desc, pullup);
		}
		}
	}
	}