Loading
pinctrl: sunxi: Implement gpiochip::get_direction()
After commit 471e998c ("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 e623c430 ("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>