Skip to contentSkip to conversation

pinctrl: rockchip: fix restore error in resume

PATCH In review Jianqun Xu 3 participants 5 messages Feb 23, 2021 – Mar 2, 2021

Subsystems (3)
lore
Share & tools
lore

Jianqun Xu

author
#0 lore raw

PATCH 1/1 pinctrl: rockchip: fix restore error in resume

From: Wang Panzhenzhuan <[email protected]>

The restore in resume should match to suspend which only set for RK3288 SoCs pinctrl.

Fixes 8dca933127024 ("pinctrl: rockchip: save and restore gpio6_c6 pinmux in suspend/resume")
---
 drivers/pinctrl/pinctrl-rockchip.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/pinctrl/pinctrl-rockchip.c +8 -5
index aa1a1c850d05..53a0badc6b03 100644
@@ -3727,12 +3727,15 @@ static int __maybe_unused rockchip_pinctrl_suspend(struct device *dev)
 static int __maybe_unused rockchip_pinctrl_resume(struct device *dev)
 {
 	struct rockchip_pinctrl *info = dev_get_drvdata(dev);
-	int ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
-			       rk3288_grf_gpio6c_iomux |
-			       GPIO6C6_SEL_WRITE_ENABLE);
+	int ret;
 
-	if (ret)
-		return ret;
+	if (info->ctrl->type == RK3288) {
+		ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
+				   rk3288_grf_gpio6c_iomux |
+				   GPIO6C6_SEL_WRITE_ENABLE);
+		if (ret)
+			return ret;
+	}
 
 	return pinctrl_force_default(info->pctl_dev);
 }
Signature · 9 lines
2.25.1




_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am Dienstag, 23. Februar 2021, 07:48:07 CET schrieb Jianqun Xu:

Quoted 9 lines

From: Wang Panzhenzhuan <[email protected]>

The restore in resume should match to suspend which only set for RK3288 SoCs pinctrl.

Fixes 8dca933127024 ("pinctrl: rockchip: save and restore gpio6_c6 pinmux in suspend/resume")

Very good catch. Writing something to that register even on non-rk3288 socs probably can cause strange effects.

Quoted 30 lines
---
 drivers/pinctrl/pinctrl-rockchip.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/pinctrl/pinctrl-rockchip.c +8 -5
index aa1a1c850d05..53a0badc6b03 100644
@@ -3727,12 +3727,15 @@ static int __maybe_unused rockchip_pinctrl_suspend(struct device *dev)
 static int __maybe_unused rockchip_pinctrl_resume(struct device *dev)
 {
 	struct rockchip_pinctrl *info = dev_get_drvdata(dev);
-	int ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
-			       rk3288_grf_gpio6c_iomux |
-			       GPIO6C6_SEL_WRITE_ENABLE);
+	int ret;
 
-	if (ret)
-		return ret;
+	if (info->ctrl->type == RK3288) {
+		ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
+				   rk3288_grf_gpio6c_iomux |
+				   GPIO6C6_SEL_WRITE_ENABLE);
+		if (ret)
+			return ret;
+	}
 
 	return pinctrl_force_default(info->pctl_dev);
 }
author
#2 lore raw

PATCH 1/1 pinctrl: rockchip: fix restore error in resume

In reply to Jianqun Xu

From: Wang Panzhenzhuan <[email protected]>

The restore in resume should match to suspend which only set for RK3288 SoCs pinctrl.

Fixes 8dca933127024 ("pinctrl: rockchip: save and restore gpio6_c6 pinmux in suspend/resume")
---
 drivers/pinctrl/pinctrl-rockchip.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/pinctrl/pinctrl-rockchip.c +8 -5
index aa1a1c850d05..53a0badc6b03 100644
@@ -3727,12 +3727,15 @@ static int __maybe_unused rockchip_pinctrl_suspend(struct device *dev)
 static int __maybe_unused rockchip_pinctrl_resume(struct device *dev)
 {
 	struct rockchip_pinctrl *info = dev_get_drvdata(dev);
-	int ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
-			       rk3288_grf_gpio6c_iomux |
-			       GPIO6C6_SEL_WRITE_ENABLE);
+	int ret;
 
-	if (ret)
-		return ret;
+	if (info->ctrl->type == RK3288) {
+		ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
+				   rk3288_grf_gpio6c_iomux |
+				   GPIO6C6_SEL_WRITE_ENABLE);
+		if (ret)
+			return ret;
+	}
 
 	return pinctrl_force_default(info->pctl_dev);
 }
Signature · 9 lines
2.25.1




_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
maintainer
#3 lore raw

Hi Jianqun,

Please add a version to the subject when sending updated patches.

So this would be :
[PATCH v2] pinctrl: rockchip: fix restore error in resume

And in general, kernel tooling will grab received Reviewed-by tags automatically nowadays, so no need to send new versions just for that.

Heiko

Am Dienstag, 23. Februar 2021, 11:07:25 CET schrieb Jianqun Xu:

Quoted 30 lines

From: Wang Panzhenzhuan <[email protected]>

The restore in resume should match to suspend which only set for RK3288 SoCs pinctrl.

Fixes 8dca933127024 ("pinctrl: rockchip: save and restore gpio6_c6 pinmux in suspend/resume")
---
 drivers/pinctrl/pinctrl-rockchip.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/pinctrl/pinctrl-rockchip.c +1 -5
index aa1a1c850d05..53a0badc6b03 100644
@@ -3727,12 +3727,15 @@ static int __maybe_unused rockchip_pinctrl_suspend(struct device *dev)
 static int __maybe_unused rockchip_pinctrl_resume(struct device *dev)
 {
 	struct rockchip_pinctrl *info = dev_get_drvdata(dev);
-	int ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
-			       rk3288_grf_gpio6c_iomux |
-			       GPIO6C6_SEL_WRITE_ENABLE);
+	int ret;
 
-	if (ret)
-		return ret;

drivers/pinctrl/pinctrl-rockchip.c static int __maybe_unused rockchip_pinctrl_suspend(struct device *dev) · line 3741

Quoted 10 lines
drivers/pinctrl/pinctrl-rockchip.c +7 -0
+	if (info->ctrl->type == RK3288) {
+		ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
+				   rk3288_grf_gpio6c_iomux |
+				   GPIO6C6_SEL_WRITE_ENABLE);
+		if (ret)
+			return ret;
+	}
 
 	return pinctrl_force_default(info->pctl_dev);
 }

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#4 lore raw
In reply to Jianqun Xu
Quoted 10 lines · Jianqun Xu

From: Wang Panzhenzhuan <[email protected]>

The restore in resume should match to suspend which only set for RK3288 SoCs pinctrl.

Fixes 8dca933127024 ("pinctrl: rockchip: save and restore gpio6_c6 pinmux in suspend/resume")

Patch applied for fixes!

Yours,
Linus Walleij