diff mbox series

[1/9] pinctrl: rockchip: rk3188: Fix support for IOMUX_GPIO_ONLY flag

Message ID 20240512121633.1632597-2-jonas@kwiboo.se
State Accepted
Commit 4b488940f5d10833d8bd898db4b7615587a5f86e
Delegated to: Kever Yang
Headers show
Series rockchip: pinctrl: Minor fixes and add support for pinmux status cmd | expand

Commit Message

Jonas Karlman May 12, 2024, 12:16 p.m. UTC
GPIO0_A0-A7 on RK3188 is IOMUX_GPIO_ONLY, however, trying to set gpio
mux return an -ENOTSUPP error code. Fix this by validating using the mux
function type and not the iomux flag.

Based on Linux commit c4a532dee6b6 ("pinctrl: rockchip: handle first
half of rk3188-bank0 correctly").

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
Based on the old Linux commit and TRM it looks like GPIO0_B0-B7 should
also be flagged as IOMUX_GPIO_ONLY.
---
 drivers/pinctrl/rockchip/pinctrl-rockchip-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kever Yang June 7, 2024, 10:26 a.m. UTC | #1
On 2024/5/12 20:16, Jonas Karlman wrote:
> GPIO0_A0-A7 on RK3188 is IOMUX_GPIO_ONLY, however, trying to set gpio
> mux return an -ENOTSUPP error code. Fix this by validating using the mux
> function type and not the iomux flag.
>
> Based on Linux commit c4a532dee6b6 ("pinctrl: rockchip: handle first
> half of rk3188-bank0 correctly").
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
> Based on the old Linux commit and TRM it looks like GPIO0_B0-B7 should
> also be flagged as IOMUX_GPIO_ONLY.
> ---
>   drivers/pinctrl/rockchip/pinctrl-rockchip-core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/rockchip/pinctrl-rockchip-core.c b/drivers/pinctrl/rockchip/pinctrl-rockchip-core.c
> index a423abcafb23..b6e2ab474d0f 100644
> --- a/drivers/pinctrl/rockchip/pinctrl-rockchip-core.c
> +++ b/drivers/pinctrl/rockchip/pinctrl-rockchip-core.c
> @@ -189,7 +189,7 @@ static int rockchip_verify_mux(struct rockchip_pin_bank *bank,
>   	}
>   
>   	if (bank->iomux[iomux_num].type & IOMUX_GPIO_ONLY) {
> -		if (mux != IOMUX_GPIO_ONLY) {
> +		if (mux != RK_FUNC_GPIO) {
>   			debug("pin %d only supports a gpio mux\n", pin);
>   			return -ENOTSUPP;
>   		}
diff mbox series

Patch

diff --git a/drivers/pinctrl/rockchip/pinctrl-rockchip-core.c b/drivers/pinctrl/rockchip/pinctrl-rockchip-core.c
index a423abcafb23..b6e2ab474d0f 100644
--- a/drivers/pinctrl/rockchip/pinctrl-rockchip-core.c
+++ b/drivers/pinctrl/rockchip/pinctrl-rockchip-core.c
@@ -189,7 +189,7 @@  static int rockchip_verify_mux(struct rockchip_pin_bank *bank,
 	}
 
 	if (bank->iomux[iomux_num].type & IOMUX_GPIO_ONLY) {
-		if (mux != IOMUX_GPIO_ONLY) {
+		if (mux != RK_FUNC_GPIO) {
 			debug("pin %d only supports a gpio mux\n", pin);
 			return -ENOTSUPP;
 		}