]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl-tegra: Restore SFSEL bit when freeing pins
authorPrathamesh Shete <pshete@nvidia.com>
Wed, 5 Mar 2025 10:49:39 +0000 (16:19 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:40:06 +0000 (14:40 +0200)
commit7fcfed72a51b8cfce7c9c654f4f8399dffb067c5
tree97947b76c3ee2acf5536f82053ff6eaa205ff848
parent02d850de9495699f2029886a6a69f0ed07a39b84
pinctrl-tegra: Restore SFSEL bit when freeing pins

[ Upstream commit c12bfa0fee65940b10ff5187349f76c6f6b1df9c ]

Each pin can be configured as a Special Function IO (SFIO) or GPIO,
where the SFIO enables the pin to operate in alternative modes such as
I2C, SPI, etc.

The current implementation sets all the pins back to SFIO mode
even if they were initially in GPIO mode. This can cause glitches
on the pins when pinctrl_gpio_free() is called.

Avoid these undesired glitches by storing the pin's SFIO/GPIO
state on GPIO request and restoring it on GPIO free.

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Link: https://lore.kernel.org/20250305104939.15168-2-pshete@nvidia.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/tegra/pinctrl-tegra.c
drivers/pinctrl/tegra/pinctrl-tegra.h