gpio: rockchip: request GPIO mux to pinctrl when setting direction
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>
Fri, 30 Sep 2022 13:20:33 +0000 (15:20 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 4 Oct 2022 07:20:41 +0000 (09:20 +0200)
commit8ea8af6c8469156ac2042d83d73f6b74eb4b4b45
tree19eb125337fd5ad9eda478f7f48296cf546a002c
parent4635c0e2a7f7f3568cbfccae70121f9835efa62c
gpio: rockchip: request GPIO mux to pinctrl when setting direction

Before the split of gpio and pinctrl sections in their own driver,
rockchip_set_mux was called in pinmux_ops.gpio_set_direction for
configuring a pin in its GPIO function.

This is essential for cases where pinctrl is "bypassed" by gpio
consumers otherwise the GPIO function is not configured for the pin and
it does not work. Such was the case for the sysfs/libgpiod userspace
GPIO handling.

Let's call pinctrl_gpio_direction_input/output when setting the
direction of a GPIO so that the pinctrl core requests from the rockchip
pinctrl driver to put the pin in its GPIO function.

Fixes: 9ce9a02039de ("pinctrl/rockchip: drop the gpio related codes")
Fixes: 936ee2675eee ("gpio/rockchip: add driver for rockchip gpio")
Cc: stable@vger.kernel.org
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Link: https://lore.kernel.org/r/20220930132033.4003377-3-foss+kernel@0leil.net
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-rockchip.c