Re: [PATCH RESEND] gpio: pcf857x: implement get_direction()

From: Bartosz Golaszewski

Date: Wed Aug 26 2026 - 09:41:04 EST



On Tue, 25 Aug 2026 04:15:57 +0000, Tapio Reijonen wrote:
> 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.
>
> [...]

Applied, thanks!

[1/1] gpio: pcf857x: implement get_direction()
https://git.kernel.org/brgl/c/ed14364ae8c310cc3f3f649ffcbc7f82befe1579

Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>