summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTapio Reijonen <tapio.reijonen@vaisala.com>2026-08-25 04:15:57 +0000
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-08-26 12:30:59 +0200
commited14364ae8c310cc3f3f649ffcbc7f82befe1579 (patch)
tree9972c32f45463130e81944d66fa4444e84a11ef9 /scripts
parent78c0baf85cd0ab61939b6d4670158d5c53dada69 (diff)
downloadlinux-next-ed14364ae8c310cc3f3f649ffcbc7f82befe1579.tar.gz
linux-next-ed14364ae8c310cc3f3f649ffcbc7f82befe1579.zip
gpio: pcf857x: implement get_direction()
The GPIO core warns (and taints the kernel) when a gpiochip lacks .get_direction() and a consumer queries a line's direction, for example via /sys/kernel/debug/gpio. pcf857x provided direction_input/output but no get_direction. These quasi-bidirectional expanders cannot report direction in hardware, and the 'out' software latch alone is ambiguous - a released (input) line and an output driven high both read back as a set bit. Track the direction explicitly in a 'dir' latch updated by the direction_input(), direction_output() and set_multiple() paths, and return it from get_direction(). Initialise it from the same reset state as 'out': released lines are inputs, lines flagged in the power-on latch are driven-low outputs. Fixes: 15fae37d9f5f ("gpiolib: pcf857x i2c gpio expander support") Signed-off-by: Tapio Reijonen <tapio.reijonen@vaisala.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/20260825-b4-gpio-pcf857x-get-direction-v1-1-de15996ae354@vaisala.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions