Thread (6 messages) 6 messages, 4 authors, 2026-03-10

Re: [PATCH v2] pinctrl: sunxi: Implement gpiochip::get_direction()

From: Linus Walleij <linusw@kernel.org>
Date: 2026-02-24 09:52:35
Also in: linux-gpio, linux-sunxi, lkml

On Tue, Feb 24, 2026 at 10:24 AM Chen-Yu Tsai [off-list ref] wrote:
After commit 471e998c0e31 ("gpiolib: remove redundant callback check"),
a warning will be printed if the gpio driver does not implement this
callback. The warning was added in commit e623c4303ed1 ("gpiolib:
sanitize the return value of gpio_chip::get_direction()"), but was
masked by the "redundant" check.

The warning can be triggered by any action that calls the callback,
such as dumping the GPIO state from /sys/kernel/debug/gpio.

Implement it for the sunxi driver. This is simply a matter of reading
out the mux value from the registers, then checking if it is one of
the GPIO functions and which direction it is.

Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Bartosz Golaszewski <redacted>
Pulled out v1 of my tree and put in this one instead!

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help