Skip to content

Commit 620aa67

Browse files
Kwiboogregkh
authored andcommitted
pinctrl: rockchip: fix reading pull type on rk3568
[ Upstream commit 31b62a9 ] When reading pinconf-pins from debugfs it fails to get the configured pull type on RK3568, "unsupported pinctrl type" error messages is also reported. Fix this by adding support for RK3568 in rockchip_get_pull, including a reverse of the pull-up value swap applied in rockchip_set_pull so that pull-up is correctly reported in pinconf-pins. Also update the workaround comment to reflect affected pins, GPIO0_D3-D6. Fixes: c0dadc0 ("pinctrl: rockchip: add support for rk3568") Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Reviewed-by: Jianqun Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent ddca674 commit 620aa67

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/pinctrl/pinctrl-rockchip.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,9 +1893,18 @@ static int rockchip_get_pull(struct rockchip_pin_bank *bank, int pin_num)
18931893
case RK3308:
18941894
case RK3368:
18951895
case RK3399:
1896+
case RK3568:
18961897
pull_type = bank->pull_type[pin_num / 8];
18971898
data >>= bit;
18981899
data &= (1 << RK3188_PULL_BITS_PER_PIN) - 1;
1900+
/*
1901+
* In the TRM, pull-up being 1 for everything except the GPIO0_D3-D6,
1902+
* where that pull up value becomes 3.
1903+
*/
1904+
if (ctrl->type == RK3568 && bank->bank_num == 0 && pin_num >= 27 && pin_num <= 30) {
1905+
if (data == 3)
1906+
data = 1;
1907+
}
18991908

19001909
return rockchip_pull_list[pull_type][data];
19011910
default:
@@ -1951,7 +1960,7 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank,
19511960
}
19521961
}
19531962
/*
1954-
* In the TRM, pull-up being 1 for everything except the GPIO0_D0-D6,
1963+
* In the TRM, pull-up being 1 for everything except the GPIO0_D3-D6,
19551964
* where that pull up value becomes 3.
19561965
*/
19571966
if (ctrl->type == RK3568 && bank->bank_num == 0 && pin_num >= 27 && pin_num <= 30) {

0 commit comments

Comments
 (0)