summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorSander Vanheule <sander@svanheule.net>2025-10-21 16:23:56 +0200
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2025-10-23 14:05:26 +0200
commited2bd02d24947e36c9438bee1449d9bf87671b16 (patch)
treedfb4678ee036c2d78fbd877291da2085deb9f6a8 /tools/lib/python
parentd5376026f9269601e239545e2ec4aea0cc62bf2a (diff)
gpio: regmap: Force writes for aliased data regs
GPIO chips often have data input and output fields aliased to the same offset. Since gpio-regmap performs a value update before the direction update (to prevent glitches), a pin currently configured as input may cause regmap_update_bits() to not perform a write. This may cause unexpected line states when the current input state equals the requested output state: OUT IN OUT DIR ''''''\...|.../'''''' pin ....../'''|'''\...... (1) (2) (3) 1. Line was configurad as out-low, but is reconfigured to input. External logic results in high value. 2. Set output value high. regmap_update_bits() sees the value is already high and discards the register write. 3. Line is switched to output, maintaining the stale output config (low) instead of the requested config (high). By switching to regmap_write_bits(), a write of the requested output value can be forced, irrespective of the read state. Do this only for aliased registers, so the more efficient regmap_update_bits() can still be used for distinct registers. Signed-off-by: Sander Vanheule <sander@svanheule.net> Reviewed-by: Michael Walle <mwalle@kernel.org> Link: https://lore.kernel.org/r/20251021142407.307753-2-sander@svanheule.net Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions