]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: ts4900: Do not set DAT and OE together
authorMark Featherston <mark@embeddedTS.com>
Thu, 10 Mar 2022 01:16:16 +0000 (17:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Mar 2022 11:49:01 +0000 (12:49 +0100)
commit0c9a947a6818b3b0c52c49e40eceede597602e78
tree74aa33d45dfe51751ae5fe5549aa99de155ba386
parent205c4ec78e71cbf561794e6043da80e7bae6790f
gpio: ts4900: Do not set DAT and OE together

[ Upstream commit 03fe003547975680fdb9ff5ab0e41cb68276c4f2 ]

This works around an issue with the hardware where both OE and
DAT are exposed in the same register. If both are updated
simultaneously, the harware makes no guarantees that OE or DAT
will actually change in any given order and may result in a
glitch of a few ns on a GPIO pin when changing direction and value
in a single write.

Setting direction to input now only affects OE bit. Setting
direction to output updates DAT first, then OE.

Fixes: 9c6686322d74 ("gpio: add Technologic I2C-FPGA gpio support")
Signed-off-by: Mark Featherston <mark@embeddedTS.com>
Signed-off-by: Kris Bahnsen <kris@embeddedTS.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-ts4900.c