linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: rockchip: fix restore error in resume
@ 2021-02-23  6:48 Jianqun Xu
  2021-02-23  8:36 ` Heiko Stübner
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jianqun Xu @ 2021-02-23  6:48 UTC (permalink / raw)
  To: linus.walleij, heiko
  Cc: linux-gpio, Jianqun Xu, Wang Panzhenzhuan, linux-rockchip

From: Wang Panzhenzhuan <randy.wang@rock-chips.com>

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")
Reviewed-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
---
 drivers/pinctrl/pinctrl-rockchip.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index aa1a1c850d05..53a0badc6b03 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -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);
 }
-- 
2.25.1




_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] pinctrl: rockchip: fix restore error in resume
  2021-02-23  6:48 [PATCH] pinctrl: rockchip: fix restore error in resume Jianqun Xu
@ 2021-02-23  8:36 ` Heiko Stübner
  2021-02-23 10:07 ` Jianqun Xu
  2021-03-02 13:27 ` Linus Walleij
  2 siblings, 0 replies; 5+ messages in thread
From: Heiko Stübner @ 2021-02-23  8:36 UTC (permalink / raw)
  To: linus.walleij, Jianqun Xu
  Cc: linux-gpio, Jianqun Xu, Wang Panzhenzhuan, linux-rockchip

Am Dienstag, 23. Februar 2021, 07:48:07 CET schrieb Jianqun Xu:
> From: Wang Panzhenzhuan <randy.wang@rock-chips.com>
> 
> 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")
> Reviewed-by: Jianqun Xu <jay.xu@rock-chips.com>
> Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

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

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
>  drivers/pinctrl/pinctrl-rockchip.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
> index aa1a1c850d05..53a0badc6b03 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -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);
>  }
> 





_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] pinctrl: rockchip: fix restore error in resume
  2021-02-23  6:48 [PATCH] pinctrl: rockchip: fix restore error in resume Jianqun Xu
  2021-02-23  8:36 ` Heiko Stübner
@ 2021-02-23 10:07 ` Jianqun Xu
  2021-02-23 10:13   ` Heiko Stübner
  2021-03-02 13:27 ` Linus Walleij
  2 siblings, 1 reply; 5+ messages in thread
From: Jianqun Xu @ 2021-02-23 10:07 UTC (permalink / raw)
  To: linus.walleij, heiko
  Cc: linux-gpio, Jianqun Xu, Wang Panzhenzhuan, linux-rockchip

From: Wang Panzhenzhuan <randy.wang@rock-chips.com>

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")
Reviewed-by: Jianqun Xu <jay.xu@rock-chips.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
---
 drivers/pinctrl/pinctrl-rockchip.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index aa1a1c850d05..53a0badc6b03 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -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);
 }
-- 
2.25.1




_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] pinctrl: rockchip: fix restore error in resume
  2021-02-23 10:07 ` Jianqun Xu
@ 2021-02-23 10:13   ` Heiko Stübner
  0 siblings, 0 replies; 5+ messages in thread
From: Heiko Stübner @ 2021-02-23 10:13 UTC (permalink / raw)
  To: linus.walleij, Jianqun Xu
  Cc: linux-gpio, Jianqun Xu, Wang Panzhenzhuan, linux-rockchip

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:
> From: Wang Panzhenzhuan <randy.wang@rock-chips.com>
> 
> 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")
> Reviewed-by: Jianqun Xu <jay.xu@rock-chips.com>
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
> ---
>  drivers/pinctrl/pinctrl-rockchip.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
> index aa1a1c850d05..53a0badc6b03 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -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);
>  }
> 





_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pinctrl: rockchip: fix restore error in resume
  2021-02-23  6:48 [PATCH] pinctrl: rockchip: fix restore error in resume Jianqun Xu
  2021-02-23  8:36 ` Heiko Stübner
  2021-02-23 10:07 ` Jianqun Xu
@ 2021-03-02 13:27 ` Linus Walleij
  2 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2021-03-02 13:27 UTC (permalink / raw)
  To: Jianqun Xu
  Cc: Heiko Stübner, open list:GPIO SUBSYSTEM,
	open list:ARM/Rockchip SoC...,
	Wang Panzhenzhuan

On Tue, Feb 23, 2021 at 7:48 AM Jianqun Xu <jay.xu@rock-chips.com> wrote:

>
> From: Wang Panzhenzhuan <randy.wang@rock-chips.com>
>
> 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")
> Reviewed-by: Jianqun Xu <jay.xu@rock-chips.com>
> Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Patch applied for fixes!

Yours,
Linus Walleij

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-03 19:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23  6:48 [PATCH] pinctrl: rockchip: fix restore error in resume Jianqun Xu
2021-02-23  8:36 ` Heiko Stübner
2021-02-23 10:07 ` Jianqun Xu
2021-02-23 10:13   ` Heiko Stübner
2021-03-02 13:27 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).