]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
pinctrl: sunxi: Implement gpiochip::get_direction()
authorChen-Yu Tsai <wens@kernel.org>
Tue, 24 Feb 2026 09:24:18 +0000 (17:24 +0800)
committerLinus Walleij <linusw@kernel.org>
Tue, 24 Feb 2026 09:51:53 +0000 (10:51 +0100)
commit01e10d0272b932f908b4f9b6609a10cb1f35fafe
tree026118167967eacf9aed9da866030ccde67b52dc
parent45fe4592454368df24d18352be700ff40e7df0c0
pinctrl: sunxi: Implement gpiochip::get_direction()

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 <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/sunxi/pinctrl-sunxi.c