pinctrl: mediatek: Fix fallback behavior for bias_set_combo
authorHsin-Yi Wang <hsinyi@chromium.org>
Thu, 1 Jul 2021 08:09:55 +0000 (16:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Aug 2021 07:06:52 +0000 (09:06 +0200)
commit676b964835765a6aea293fa1b277441a9e1b120a
tree10b318debcdcc1bba07938e4ef91a8724fb10fa4
parent73e81f7219aa582d8e55a7b6552f607a8e5a9724
pinctrl: mediatek: Fix fallback behavior for bias_set_combo

[ Upstream commit 798a315fc359aa6dbe48e09d802aa59b7e158ffc ]

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: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
Link: https://lore.kernel.org/r/20210701080955.2660294-1-hsinyi@chromium.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c