summaryrefslogtreecommitdiff
path: root/lib/earlycpio.c
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>2024-05-30 13:20:00 +0300
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-06-03 15:13:13 +0300
commit9d6a811b522ba558bcb4ec01d12e72a0af8e9f6e (patch)
treeed5be53934f9af30f8f6ec34e666b8518e416535 /lib/earlycpio.c
parent8c219e52ca4d9a67cd6a7074e91bf29b55edc075 (diff)
downloadlinux-9d6a811b522ba558bcb4ec01d12e72a0af8e9f6e.tar.xz
gpio: tqmx86: introduce shadow register for GPIO output value
The TQMx86 GPIO controller uses the same register address for input and output data. Reading the register will always return current inputs rather than the previously set outputs (regardless of the current direction setting). Therefore, using a RMW pattern does not make sense when setting output values. Instead, the previously set output register value needs to be stored as a shadow register. As there is no reliable way to get the current output values from the hardware, also initialize all channels to 0, to ensure that stored and actual output values match. This should usually not have any effect in practise, as the TQMx86 UEFI sets all outputs to 0 during boot. Also prepare for extension of the driver to more than 8 GPIOs by using DECLARE_BITMAP. Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller") Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/d0555933becd45fa92a85675d26e4d59343ddc01.1717063994.git.matthias.schiffer@ew.tq-group.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'lib/earlycpio.c')
0 files changed, 0 insertions, 0 deletions