]> git.hungrycats.org Git - linux/commit
gpio: 74x164: Enable output pins after registers are reset
authorArturas Moskvinas <arturas.moskvinas@gmail.com>
Fri, 1 Mar 2024 07:12:04 +0000 (09:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:38:50 +0000 (14:38 +0000)
commitc21b5ad4e79dffbe6fefd2066f35c6e04bc79737
tree1f2ed61bc11c28116a6413a61a8e506ffc02bac0
parent6c480d0f131862645d172ca9e25dc152b1a5c3a6
gpio: 74x164: Enable output pins after registers are reset

[ Upstream commit 530b1dbd97846b110ea8a94c7cc903eca21786e5 ]

Chip outputs are enabled[1] before actual reset is performed[2] which might
cause pin output value to flip flop if previous pin value was set to 1.
Fix that behavior by making sure chip is fully reset before all outputs are
enabled.

Flip-flop can be noticed when module is removed and inserted again and one of
the pins was changed to 1 before removal. 100 microsecond flipping is
noticeable on oscilloscope (100khz SPI bus).

For a properly reset chip - output is enabled around 100 microseconds (on 100khz
SPI bus) later during probing process hence should be irrelevant behavioral
change.

Fixes: 7ebc194d0fd4 (gpio: 74x164: Introduce 'enable-gpios' property)
Link: https://elixir.bootlin.com/linux/v6.7.4/source/drivers/gpio/gpio-74x164.c#L130
Link: https://elixir.bootlin.com/linux/v6.7.4/source/drivers/gpio/gpio-74x164.c#L150
Signed-off-by: Arturas Moskvinas <arturas.moskvinas@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-74x164.c