All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] pinctrl: imx8mq: Add suspend/resume ops
@ 2019-04-08 18:38 ` Abel Vesa
  0 siblings, 0 replies; 9+ messages in thread
From: Abel Vesa @ 2019-04-08 18:38 UTC (permalink / raw)
  To: Aisheng Dong, Fabio Estevam, Shawn Guo, Stefan Agner,
	Linus Walleij, Sascha Hauer
  Cc: dl-linux-imx, linux-gpio, linux-arm-kernel,
	Linux Kernel Mailing List, Abel Vesa, Robin Gong

To support pinctl hog restore after LPSR resume back,
add the generic suspend/resume in pinctrl-imx along with the
generic pm ops to be used by platform specific drivers. Then
make use of the newly added ops in i.MX8MQ platform specific
driver.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
---

Changes since v2:
 * removed the pinctrl-imx8mq with imx8mq in the subject
 * added static and __maybe_unused to both suspend and resume
 * removed the useless null checks

 drivers/pinctrl/freescale/pinctrl-imx.c    | 19 +++++++++++++++++++
 drivers/pinctrl/freescale/pinctrl-imx.h    |  1 +
 drivers/pinctrl/freescale/pinctrl-imx8mq.c |  1 +
 3 files changed, 21 insertions(+)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 188001b..93a86d2 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -887,3 +887,22 @@ int imx_pinctrl_probe(struct platform_device *pdev,
 
 	return ret;
 }
+
+static int __maybe_unused imx_pinctrl_suspend(struct device *dev)
+{
+	struct imx_pinctrl *ipctl = dev_get_drvdata(dev);
+
+	return pinctrl_force_sleep(ipctl->pctl);
+}
+
+static int __maybe_unused imx_pinctrl_resume(struct device *dev)
+{
+	struct imx_pinctrl *ipctl = dev_get_drvdata(dev);
+
+	return pinctrl_force_default(ipctl->pctl);
+}
+
+const struct dev_pm_ops imx_pinctrl_pm_ops = {
+	SET_LATE_SYSTEM_SLEEP_PM_OPS(imx_pinctrl_suspend,
+					imx_pinctrl_resume)
+};
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h
index 98a4889..333d32b 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.h
+++ b/drivers/pinctrl/freescale/pinctrl-imx.h
@@ -17,6 +17,7 @@
 struct platform_device;
 
 extern struct pinmux_ops imx_pmx_ops;
+extern const struct dev_pm_ops imx_pinctrl_pm_ops;
 
 /**
  * struct imx_pin_mmio - MMIO pin configurations
diff --git a/drivers/pinctrl/freescale/pinctrl-imx8mq.c b/drivers/pinctrl/freescale/pinctrl-imx8mq.c
index 8d39af5..50aa1c0 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx8mq.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx8mq.c
@@ -339,6 +339,7 @@ static struct platform_driver imx8mq_pinctrl_driver = {
 	.driver = {
 		.name = "imx8mq-pinctrl",
 		.of_match_table = of_match_ptr(imx8mq_pinctrl_of_match),
+		.pm = &imx_pinctrl_pm_ops,
 		.suppress_bind_attrs = true,
 	},
 	.probe = imx8mq_pinctrl_probe,
-- 
2.7.4

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

* [PATCH v3] pinctrl: imx8mq: Add suspend/resume ops
@ 2019-04-08 18:38 ` Abel Vesa
  0 siblings, 0 replies; 9+ messages in thread
From: Abel Vesa @ 2019-04-08 18:38 UTC (permalink / raw)
  To: Aisheng Dong, Fabio Estevam, Shawn Guo, Stefan Agner,
	Linus Walleij, Sascha Hauer
  Cc: dl-linux-imx, linux-gpio, linux-arm-kernel,
	Linux Kernel Mailing List, Abel Vesa, Robin Gong

To support pinctl hog restore after LPSR resume back,
add the generic suspend/resume in pinctrl-imx along with the
generic pm ops to be used by platform specific drivers. Then
make use of the newly added ops in i.MX8MQ platform specific
driver.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
---

Changes since v2:
 * removed the pinctrl-imx8mq with imx8mq in the subject
 * added static and __maybe_unused to both suspend and resume
 * removed the useless null checks

 drivers/pinctrl/freescale/pinctrl-imx.c    | 19 +++++++++++++++++++
 drivers/pinctrl/freescale/pinctrl-imx.h    |  1 +
 drivers/pinctrl/freescale/pinctrl-imx8mq.c |  1 +
 3 files changed, 21 insertions(+)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 188001b..93a86d2 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -887,3 +887,22 @@ int imx_pinctrl_probe(struct platform_device *pdev,
 
 	return ret;
 }
+
+static int __maybe_unused imx_pinctrl_suspend(struct device *dev)
+{
+	struct imx_pinctrl *ipctl = dev_get_drvdata(dev);
+
+	return pinctrl_force_sleep(ipctl->pctl);
+}
+
+static int __maybe_unused imx_pinctrl_resume(struct device *dev)
+{
+	struct imx_pinctrl *ipctl = dev_get_drvdata(dev);
+
+	return pinctrl_force_default(ipctl->pctl);
+}
+
+const struct dev_pm_ops imx_pinctrl_pm_ops = {
+	SET_LATE_SYSTEM_SLEEP_PM_OPS(imx_pinctrl_suspend,
+					imx_pinctrl_resume)
+};
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h
index 98a4889..333d32b 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.h
+++ b/drivers/pinctrl/freescale/pinctrl-imx.h
@@ -17,6 +17,7 @@
 struct platform_device;
 
 extern struct pinmux_ops imx_pmx_ops;
+extern const struct dev_pm_ops imx_pinctrl_pm_ops;
 
 /**
  * struct imx_pin_mmio - MMIO pin configurations
diff --git a/drivers/pinctrl/freescale/pinctrl-imx8mq.c b/drivers/pinctrl/freescale/pinctrl-imx8mq.c
index 8d39af5..50aa1c0 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx8mq.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx8mq.c
@@ -339,6 +339,7 @@ static struct platform_driver imx8mq_pinctrl_driver = {
 	.driver = {
 		.name = "imx8mq-pinctrl",
 		.of_match_table = of_match_ptr(imx8mq_pinctrl_of_match),
+		.pm = &imx_pinctrl_pm_ops,
 		.suppress_bind_attrs = true,
 	},
 	.probe = imx8mq_pinctrl_probe,
-- 
2.7.4


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

* [PATCH v3] pinctrl: imx8mq: Add suspend/resume ops
@ 2019-04-08 18:38 ` Abel Vesa
  0 siblings, 0 replies; 9+ messages in thread
From: Abel Vesa @ 2019-04-08 18:38 UTC (permalink / raw)
  To: Aisheng Dong, Fabio Estevam, Shawn Guo, Stefan Agner,
	Linus Walleij, Sascha Hauer
  Cc: Abel Vesa, Linux Kernel Mailing List, linux-gpio, dl-linux-imx,
	Robin Gong, linux-arm-kernel

To support pinctl hog restore after LPSR resume back,
add the generic suspend/resume in pinctrl-imx along with the
generic pm ops to be used by platform specific drivers. Then
make use of the newly added ops in i.MX8MQ platform specific
driver.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
---

Changes since v2:
 * removed the pinctrl-imx8mq with imx8mq in the subject
 * added static and __maybe_unused to both suspend and resume
 * removed the useless null checks

 drivers/pinctrl/freescale/pinctrl-imx.c    | 19 +++++++++++++++++++
 drivers/pinctrl/freescale/pinctrl-imx.h    |  1 +
 drivers/pinctrl/freescale/pinctrl-imx8mq.c |  1 +
 3 files changed, 21 insertions(+)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 188001b..93a86d2 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -887,3 +887,22 @@ int imx_pinctrl_probe(struct platform_device *pdev,
 
 	return ret;
 }
+
+static int __maybe_unused imx_pinctrl_suspend(struct device *dev)
+{
+	struct imx_pinctrl *ipctl = dev_get_drvdata(dev);
+
+	return pinctrl_force_sleep(ipctl->pctl);
+}
+
+static int __maybe_unused imx_pinctrl_resume(struct device *dev)
+{
+	struct imx_pinctrl *ipctl = dev_get_drvdata(dev);
+
+	return pinctrl_force_default(ipctl->pctl);
+}
+
+const struct dev_pm_ops imx_pinctrl_pm_ops = {
+	SET_LATE_SYSTEM_SLEEP_PM_OPS(imx_pinctrl_suspend,
+					imx_pinctrl_resume)
+};
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h
index 98a4889..333d32b 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.h
+++ b/drivers/pinctrl/freescale/pinctrl-imx.h
@@ -17,6 +17,7 @@
 struct platform_device;
 
 extern struct pinmux_ops imx_pmx_ops;
+extern const struct dev_pm_ops imx_pinctrl_pm_ops;
 
 /**
  * struct imx_pin_mmio - MMIO pin configurations
diff --git a/drivers/pinctrl/freescale/pinctrl-imx8mq.c b/drivers/pinctrl/freescale/pinctrl-imx8mq.c
index 8d39af5..50aa1c0 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx8mq.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx8mq.c
@@ -339,6 +339,7 @@ static struct platform_driver imx8mq_pinctrl_driver = {
 	.driver = {
 		.name = "imx8mq-pinctrl",
 		.of_match_table = of_match_ptr(imx8mq_pinctrl_of_match),
+		.pm = &imx_pinctrl_pm_ops,
 		.suppress_bind_attrs = true,
 	},
 	.probe = imx8mq_pinctrl_probe,
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH v3] pinctrl: imx8mq: Add suspend/resume ops
  2019-04-08 18:38 ` Abel Vesa
  (?)
@ 2019-04-09  3:30   ` Aisheng Dong
  -1 siblings, 0 replies; 9+ messages in thread
From: Aisheng Dong @ 2019-04-09  3:30 UTC (permalink / raw)
  To: Abel Vesa, Fabio Estevam, Shawn Guo, Stefan Agner, Linus Walleij,
	Sascha Hauer
  Cc: dl-linux-imx, linux-gpio, linux-arm-kernel,
	Linux Kernel Mailing List, Robin Gong

> From: Abel Vesa
> Sent: Tuesday, April 9, 2019 2:39 AM
> 
> To support pinctl hog restore after LPSR resume back, add the generic
> suspend/resume in pinctrl-imx along with the generic pm ops to be used by
> platform specific drivers. Then make use of the newly added ops in i.MX8MQ
> platform specific driver.
> 
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

Acked-by: Dong Aisheng <aisheng.dong@nxp.com>

Regards
Dong Aisheng

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

* RE: [PATCH v3] pinctrl: imx8mq: Add suspend/resume ops
@ 2019-04-09  3:30   ` Aisheng Dong
  0 siblings, 0 replies; 9+ messages in thread
From: Aisheng Dong @ 2019-04-09  3:30 UTC (permalink / raw)
  To: Abel Vesa, Fabio Estevam, Shawn Guo, Stefan Agner, Linus Walleij,
	Sascha Hauer
  Cc: dl-linux-imx, linux-gpio, linux-arm-kernel,
	Linux Kernel Mailing List, Robin Gong

> From: Abel Vesa
> Sent: Tuesday, April 9, 2019 2:39 AM
> 
> To support pinctl hog restore after LPSR resume back, add the generic
> suspend/resume in pinctrl-imx along with the generic pm ops to be used by
> platform specific drivers. Then make use of the newly added ops in i.MX8MQ
> platform specific driver.
> 
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

Acked-by: Dong Aisheng <aisheng.dong@nxp.com>

Regards
Dong Aisheng

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

* RE: [PATCH v3] pinctrl: imx8mq: Add suspend/resume ops
@ 2019-04-09  3:30   ` Aisheng Dong
  0 siblings, 0 replies; 9+ messages in thread
From: Aisheng Dong @ 2019-04-09  3:30 UTC (permalink / raw)
  To: Abel Vesa, Fabio Estevam, Shawn Guo, Stefan Agner, Linus Walleij,
	Sascha Hauer
  Cc: linux-gpio, Robin Gong, dl-linux-imx, linux-arm-kernel,
	Linux Kernel Mailing List

> From: Abel Vesa
> Sent: Tuesday, April 9, 2019 2:39 AM
> 
> To support pinctl hog restore after LPSR resume back, add the generic
> suspend/resume in pinctrl-imx along with the generic pm ops to be used by
> platform specific drivers. Then make use of the newly added ops in i.MX8MQ
> platform specific driver.
> 
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

Acked-by: Dong Aisheng <aisheng.dong@nxp.com>

Regards
Dong Aisheng

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3] pinctrl: imx8mq: Add suspend/resume ops
  2019-04-08 18:38 ` Abel Vesa
  (?)
@ 2019-04-11 13:27   ` Linus Walleij
  -1 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2019-04-11 13:27 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Aisheng Dong, Fabio Estevam, Shawn Guo, Stefan Agner,
	Sascha Hauer, dl-linux-imx, linux-gpio, linux-arm-kernel,
	Linux Kernel Mailing List, Robin Gong

On Mon, Apr 8, 2019 at 8:38 PM Abel Vesa <abel.vesa@nxp.com> wrote:

> To support pinctl hog restore after LPSR resume back,
> add the generic suspend/resume in pinctrl-imx along with the
> generic pm ops to be used by platform specific drivers. Then
> make use of the newly added ops in i.MX8MQ platform specific
> driver.
>
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

This v3 version applied with Dong's ACK.

Yours,
Linus Walleij

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

* Re: [PATCH v3] pinctrl: imx8mq: Add suspend/resume ops
@ 2019-04-11 13:27   ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2019-04-11 13:27 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Aisheng Dong, Fabio Estevam, Shawn Guo, Stefan Agner,
	Sascha Hauer, dl-linux-imx, linux-gpio, linux-arm-kernel,
	Linux Kernel Mailing List, Robin Gong

On Mon, Apr 8, 2019 at 8:38 PM Abel Vesa <abel.vesa@nxp.com> wrote:

> To support pinctl hog restore after LPSR resume back,
> add the generic suspend/resume in pinctrl-imx along with the
> generic pm ops to be used by platform specific drivers. Then
> make use of the newly added ops in i.MX8MQ platform specific
> driver.
>
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

This v3 version applied with Dong's ACK.

Yours,
Linus Walleij

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

* Re: [PATCH v3] pinctrl: imx8mq: Add suspend/resume ops
@ 2019-04-11 13:27   ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2019-04-11 13:27 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Aisheng Dong, Linux Kernel Mailing List, Stefan Agner,
	linux-gpio, dl-linux-imx, Sascha Hauer, Fabio Estevam,
	Robin Gong, Shawn Guo, linux-arm-kernel

On Mon, Apr 8, 2019 at 8:38 PM Abel Vesa <abel.vesa@nxp.com> wrote:

> To support pinctl hog restore after LPSR resume back,
> add the generic suspend/resume in pinctrl-imx along with the
> generic pm ops to be used by platform specific drivers. Then
> make use of the newly added ops in i.MX8MQ platform specific
> driver.
>
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

This v3 version applied with Dong's ACK.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-04-11 13:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08 18:38 [PATCH v3] pinctrl: imx8mq: Add suspend/resume ops Abel Vesa
2019-04-08 18:38 ` Abel Vesa
2019-04-08 18:38 ` Abel Vesa
2019-04-09  3:30 ` Aisheng Dong
2019-04-09  3:30   ` Aisheng Dong
2019-04-09  3:30   ` Aisheng Dong
2019-04-11 13:27 ` Linus Walleij
2019-04-11 13:27   ` Linus Walleij
2019-04-11 13:27   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.