* [PATCH] pinctrl: airoha: fix bias readback in airoha_pinconf_get()
@ 2026-10-23 17:57 Vikrant Yadav
0 siblings, 0 replies; only message in thread
From: Vikrant Yadav @ 2026-10-23 17:57 UTC (permalink / raw)
To: lorenzo, linusw; +Cc: linux-mediatek, linux-gpio, linux-kernel, Vikrant Yadav
In airoha_pinconf_get(), the last branch of bias check
"else if (pull_up || pull_down)", has no check on the requested
parameter. It was meant to reject PIN_CONFIG_BIAS_DISABLE when a pull
is enabled, but it also runs for PIN_CONFIG_BIAS_PULL_UP and
PIN_CONFIG_BIAS_PULL_DOWN. When the pin really has that pull set, the
earlier PULL_UP/PULL_DOWN checks do not reject it, so the execution
reaches this branch, which returns -EINVAL. Reading back a pull-up or
pull-down therefore always fails.
Signed-off-by: Vikrant Yadav <vikrantyadav4802@gmail.com>
---
drivers/pinctrl/airoha/pinctrl-airoha.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/airoha/pinctrl-airoha.c b/drivers/pinctrl/airoha/pinctrl-airoha.c
index f505a3f69c5d..8cf4592cbc73 100644
--- a/drivers/pinctrl/airoha/pinctrl-airoha.c
+++ b/drivers/pinctrl/airoha/pinctrl-airoha.c
@@ -554,7 +554,7 @@ static int airoha_pinconf_get(struct pinctrl_dev *pctrl_dev,
else if (param == PIN_CONFIG_BIAS_PULL_DOWN &&
!(pull_down && !pull_up))
return -EINVAL;
- else if (pull_up || pull_down)
+ else if (param == PIN_CONFIG_BIAS_DISABLE && (pull_up || pull_down))
return -EINVAL;
arg = 1;
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-23 17:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 17:57 [PATCH] pinctrl: airoha: fix bias readback in airoha_pinconf_get() Vikrant Yadav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®