pinctrl: mediatek: Fix fallback behavior for bias_set_combo
Subsystems (4)
PATCH v2 1/1 pinctrl: mediatek: Fix fallback behavior for bias_set_combo
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.
---
v2: fix v1 comments
--- drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +3 -5
@@ -926,12 +926,10 @@ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw, err = hw->soc->bias_set (hw, desc, pullup);if (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 { -return -ENOTSUPP ; + err =mtk_pinconf_bias_set_rev1 (hw, desc, pullup); +if (err) + err =mtk_pinconf_bias_set (hw, desc, pullup); } }
Signature · 1 line
2.32.0.93.g670b81a890-goog
Quoted 5 lines · Hsin-Yi Wang
Some pin doesn't support PUPD register, if it fails and fallbacks with
bias_set_combocase, it will callmtk_pinconf_bias_set_pupd_r1_r0()to modify the PUPD pin again.
Quoted 7 lines
Since the general bias set are either PU/PD or PULLSEL/PULLEN, try
bias_setorbias_set_rev1for 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 <[email protected]>
zhiyong tao
Reviewed-byQuoted 11 lines · Chen-Yu Tsai
Quoted 10 lines · Hsin-Yi Wang
Some pin doesn't support PUPD register, if it fails and fallbacks with
bias_set_combocase, it will callmtk_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_setorbias_set_rev1for the other fallback case. If the pin doesn't support neither PU/PD nor PULLSEL/PULLEN, it will return-ENOTSUPP.
Quoted 4 lines
Quoted 2 lines
Fixes 81bd1579b43e ("pinctrl: mediatek: Fix fallback call path")Signed-off-by Hsin-Yi Wang <[email protected]>Reviewed-by Chen-Yu Tsai <[email protected]>
Hi Hsin-Yi,
Quoted 10 lines · Hsin-Yi Wang
Some pin doesn't support PUPD register, if it fails and fallbacks with
bias_set_combocase, it will callmtk_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_setorbias_set_rev1for the other fallback case. If the pin doesn't support neither PU/PD nor PULLSEL/PULLEN, it will return-ENOTSUPP.
Quoted 4 lines
Fixes 81bd1579b43e ("pinctrl: mediatek: Fix fallback call path")Signed-off-by Hsin-Yi Wang <[email protected]>---
v2: fix v1 comments
Thanks for fixing this up so nicely, great work.
Patch applied for fixes!
Yours,
Linus Walleij