]> git.baikalelectronics.ru Git - kernel.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)
committerBartosz Golaszewski <brgl@bgdev.pl>
Thu, 10 Mar 2022 09:00:27 +0000 (10:00 +0100)
commit8c9aabffe782f8f3d9617c44341f02f95cbf33e0
tree81d8f01cbc76e3bbe1fca4a3189f72b94a00fb95
parente12f61c6dbcb6e41bdf3a58d1bc3c58309f1f953
gpio: ts4900: Do not set DAT and OE together

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: d5cb0ea1b968 ("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>
drivers/gpio/gpio-ts4900.c