Skip to content

Commit 31b62a9

Browse files
Kwiboolinusw
authored andcommitted
pinctrl: rockchip: fix reading pull type on rk3568
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]>
1 parent 937e7a3 commit 31b62a9

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
@@ -2436,10 +2436,19 @@ static int rockchip_get_pull(struct rockchip_pin_bank *bank, int pin_num)
24362436
case RK3308:
24372437
case RK3368:
24382438
case RK3399:
2439+
case RK3568:
24392440
case RK3588:
24402441
pull_type = bank->pull_type[pin_num / 8];
24412442
data >>= bit;
24422443
data &= (1 << RK3188_PULL_BITS_PER_PIN) - 1;
2444+
/*
2445+
* In the TRM, pull-up being 1 for everything except the GPIO0_D3-D6,
2446+
* where that pull up value becomes 3.
2447+
*/
2448+
if (ctrl->type == RK3568 && bank->bank_num == 0 && pin_num >= 27 && pin_num <= 30) {
2449+
if (data == 3)
2450+
data = 1;
2451+
}
24432452

24442453
return rockchip_pull_list[pull_type][data];
24452454
default:
@@ -2497,7 +2506,7 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank,
24972506
}
24982507
}
24992508
/*
2500-
* In the TRM, pull-up being 1 for everything except the GPIO0_D0-D6,
2509+
* In the TRM, pull-up being 1 for everything except the GPIO0_D3-D6,
25012510
* where that pull up value becomes 3.
25022511
*/
25032512
if (ctrl->type == RK3568 && bank->bank_num == 0 && pin_num >= 27 && pin_num <= 30) {

0 commit comments

Comments
 (0)