Skip to content

Commit 43fd6b4

Browse files
Chi ZhangUlrich Hecht
authored andcommitted
pinctrl: single: fix bias pull up/down handling in pin_config_set
[ Upstream commit 236152dd9b1675a35eee912e79e6c57ca6b6732f ] In the pin_config_set function, when handling PIN_CONFIG_BIAS_PULL_DOWN or PIN_CONFIG_BIAS_PULL_UP, the function calls pcs_pinconf_clear_bias() which writes the register. However, the subsequent operations continue using the stale 'data' value from before the register write, effectively causing the bias clear operation to be overwritten and not take effect. Fix this by reading the 'data' value from the register after calling pcs_pinconf_clear_bias(). This bug seems to have existed when this code was first merged in commit 9dddb4d ("pinctrl: single: support generic pinconf"). Signed-off-by: Chi Zhang <chizhang@asrmicro.com> Link: https://lore.kernel.org/20250807062038.13610-1-chizhang@asrmicro.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org> [uli: backport to 4.19] Signed-off-by: Ulrich Hecht <uli@kernel.org> Reviewed-by: Pavel Machek <pavel@nabladev.com>
1 parent c69561c commit 43fd6b4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/pinctrl/pinctrl-single.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,10 @@ static int pcs_pinconf_set(struct pinctrl_dev *pctldev,
562562
break;
563563
case PIN_CONFIG_BIAS_PULL_DOWN:
564564
case PIN_CONFIG_BIAS_PULL_UP:
565-
if (arg)
565+
if (arg) {
566566
pcs_pinconf_clear_bias(pctldev, pin);
567+
data = pcs->read(pcs->base + offset);
568+
}
567569
/* fall through */
568570
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
569571
data &= ~func->conf[i].mask;

0 commit comments

Comments
 (0)