diff mbox series

[2/3] pinctrl: rockchip: use dedicated pinctrl type for RK3328

Message ID 20240606060435.765716-3-i@mail.eh5.me (mailing list archive)
State New, archived
Headers show
Series pinctrl: rockchip: fix RK3328 pinmux bits | expand

Commit Message

Huang-Huang Bao June 6, 2024, 6:04 a.m. UTC
rk3328_pin_ctrl uses type of RK3288 which has a hack in
rockchip_pinctrl_suspend and rockchip_pinctrl_resume to restore GPIO6-C6
at assume, the hack is not applicable to RK3328 as GPIO6 is not even
exist in it. So use a dedicated pinctrl type to skip this hack.

Signed-off-by: Huang-Huang Bao <i@eh5.me>
---
 drivers/pinctrl/pinctrl-rockchip.c | 5 ++++-
 drivers/pinctrl/pinctrl-rockchip.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Heiko Stuebner June 6, 2024, 9:43 a.m. UTC | #1
Am Donnerstag, 6. Juni 2024, 08:04:34 CEST schrieb Huang-Huang Bao:
> rk3328_pin_ctrl uses type of RK3288 which has a hack in
> rockchip_pinctrl_suspend and rockchip_pinctrl_resume to restore GPIO6-C6
> at assume, the hack is not applicable to RK3328 as GPIO6 is not even
> exist in it. So use a dedicated pinctrl type to skip this hack.
> 
> Signed-off-by: Huang-Huang Bao <i@eh5.me>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Heiko Stuebner June 6, 2024, 10:11 a.m. UTC | #2
Am Donnerstag, 6. Juni 2024, 11:43:56 CEST schrieb Heiko Stübner:
> Am Donnerstag, 6. Juni 2024, 08:04:34 CEST schrieb Huang-Huang Bao:
> > rk3328_pin_ctrl uses type of RK3288 which has a hack in
> > rockchip_pinctrl_suspend and rockchip_pinctrl_resume to restore GPIO6-C6
> > at assume, the hack is not applicable to RK3328 as GPIO6 is not even
> > exist in it. So use a dedicated pinctrl type to skip this hack.
> > 
> > Signed-off-by: Huang-Huang Bao <i@eh5.me>
> 
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>

I think this actually also warrants a Fixes-tag, because as you said, the
suspend handling for the rk3288 will change GRF registers it should not
touch on the rk3328.

Fixes: 3818e4a7678e ("pinctrl: rockchip: Add rk3328 pinctrl support")
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 23531ea0d088..24ee88863ce3 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -2478,6 +2478,7 @@  static int rockchip_get_pull(struct rockchip_pin_bank *bank, int pin_num)
 	case RK3188:
 	case RK3288:
 	case RK3308:
+	case RK3328:
 	case RK3368:
 	case RK3399:
 	case RK3568:
@@ -2536,6 +2537,7 @@  static int rockchip_set_pull(struct rockchip_pin_bank *bank,
 	case RK3188:
 	case RK3288:
 	case RK3308:
+	case RK3328:
 	case RK3368:
 	case RK3399:
 	case RK3568:
@@ -2798,6 +2800,7 @@  static bool rockchip_pinconf_pull_valid(struct rockchip_pin_ctrl *ctrl,
 	case RK3188:
 	case RK3288:
 	case RK3308:
+	case RK3328:
 	case RK3368:
 	case RK3399:
 	case RK3568:
@@ -3822,7 +3825,7 @@  static struct rockchip_pin_ctrl rk3328_pin_ctrl = {
 		.pin_banks		= rk3328_pin_banks,
 		.nr_banks		= ARRAY_SIZE(rk3328_pin_banks),
 		.label			= "RK3328-GPIO",
-		.type			= RK3288,
+		.type			= RK3328,
 		.grf_mux_offset		= 0x0,
 		.iomux_recalced		= rk3328_mux_recalced_data,
 		.niomux_recalced	= ARRAY_SIZE(rk3328_mux_recalced_data),
diff --git a/drivers/pinctrl/pinctrl-rockchip.h b/drivers/pinctrl/pinctrl-rockchip.h
index 4759f336941e..849266f8b191 100644
--- a/drivers/pinctrl/pinctrl-rockchip.h
+++ b/drivers/pinctrl/pinctrl-rockchip.h
@@ -193,6 +193,7 @@  enum rockchip_pinctrl_type {
 	RK3188,
 	RK3288,
 	RK3308,
+	RK3328,
 	RK3368,
 	RK3399,
 	RK3568,