gpio: pca953x: use regmap_update_bits() to improve performance
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Mon, 14 Jul 2025 13:37:30 +0000 (09:37 -0400)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 15 Jul 2025 14:29:37 +0000 (16:29 +0200)
commit2aa8ccab5ae67281e4d3660f8d9ee68d8b76fcef
treee5551c41c1ebdd9ebd3c1441667afae1757abf70
parente70513bd98e3912b431b196e3cf53ac821598e6a
gpio: pca953x: use regmap_update_bits() to improve performance

Using regmap_update_bits() allows to reduce the number of I2C transfers
when updating bits that haven't changed on non-volatile registers.

For example on a PCAL6416, when changing a GPIO direction from input to
output, the number of I2C transfers can be reduced from 4 to just 1 if
the pull resistors configuration hasn't changed and the output value
is the same as before.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20250714133730.6353-1-hugo@hugovil.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-pca953x.c