summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/kdoc_output.py
diff options
context:
space:
mode:
authorSander Vanheule <sander@svanheule.net>2025-10-21 16:23:57 +0200
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2025-10-23 14:06:09 +0200
commit897396b418d1720aac39585b208aada708b5b433 (patch)
treeab7fb6dab9bf0a0363b96fe09444f4d115b60c82 /tools/lib/python/kdoc/kdoc_output.py
parented2bd02d24947e36c9438bee1449d9bf87671b16 (diff)
gpio: regmap: Bypass cache for aliased inputs
GPIO chips often have data input and output registers aliased to the same offset. The output register is non-valitile and could in theory be cached. The input register however is volatile by nature and hence should not be cached, resulting in different requirements for reads and writes. The generic gpio chip implementation stores a shadow value of the pin output data, which is updated and written to hardware on output data changes in bgpio_set(), bgpio_set_set(). Pin input values are always obtained by reading the aliased data register from hardware. For gpio-regmap the situation is more complex as the output data could be in multiple registers, but we can use the regmap cache to shadow the output values when marking the data registers as non-volatile. By using regmap_read_bypassed() we can still treat the input values as volatile, irrespective of the regmap config. This ensures proper functioning of writing the output register with regmap_write_bits(), which will then use and update the cache only on data writes, gaining some performance from the cached output values. Signed-off-by: Sander Vanheule <sander@svanheule.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Michael Walle <mwalle@kernel.org> Link: https://lore.kernel.org/r/20251021142407.307753-3-sander@svanheule.net Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'tools/lib/python/kdoc/kdoc_output.py')
0 files changed, 0 insertions, 0 deletions