Skip to content

Commit 17013f0

Browse files
Prathamesh Shetelinusw
authored andcommitted
pinctrl: tegra: Set SFIO mode to Mux Register
Tegra devices have an 'sfsel' bit field that determines whether a pin operates in SFIO (Special Function I/O) or GPIO mode. Currently, tegra_pinctrl_gpio_disable_free() sets this bit when releasing a GPIO. However, tegra_pinctrl_set_mux() can be called independently in certain code paths where gpio_disable_free() is not invoked. In such cases, failing to set the SFIO mode could lead to incorrect pin configurations, resulting in functional issues for peripherals relying on SFIO. This patch ensures that whenever set_mux() is called, the SFIO mode is correctly set in the Mux Register if the 'sfsel' bit is present. This prevents situations where the pin remains in GPIO mode despite being configured for SFIO use. Fixes: 971dac7 ("pinctrl: add a driver for NVIDIA Tegra") Signed-off-by: Prathamesh Shete <pshete@nvidia.com> Link: https://lore.kernel.org/20250306050542.16335-1-pshete@nvidia.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent c12bfa0 commit 17013f0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/pinctrl/tegra/pinctrl-tegra.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ static int tegra_pinctrl_set_mux(struct pinctrl_dev *pctldev,
271271
val = pmx_readl(pmx, g->mux_bank, g->mux_reg);
272272
val &= ~(0x3 << g->mux_bit);
273273
val |= i << g->mux_bit;
274+
/* Set the SFIO/GPIO selection to SFIO when under pinmux control*/
275+
if (pmx->soc->sfsel_in_mux)
276+
val |= (1 << g->sfsel_bit);
274277
pmx_writel(pmx, val, g->mux_bank, g->mux_reg);
275278

276279
return 0;

0 commit comments

Comments
 (0)