All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] bus: uniphier-system-bus: set up registers when resuming
@ 2017-07-31  5:49 ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2017-07-31  5:49 UTC (permalink / raw)
  To: arm
  Cc: linux-arm-kernel, Olof Johansson, Arnd Bergmann,
	Masami Hiramatsu, Jassi Brar, Masahiro Yamada, linux-kernel

When resuming, set up registers that have been lost in the sleep state.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v2:
  - Fix define but not used warning

 drivers/bus/uniphier-system-bus.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/bus/uniphier-system-bus.c b/drivers/bus/uniphier-system-bus.c
index 1e6e0269edcc..f76be6bd6eb3 100644
--- a/drivers/bus/uniphier-system-bus.c
+++ b/drivers/bus/uniphier-system-bus.c
@@ -256,10 +256,23 @@ static int uniphier_system_bus_probe(struct platform_device *pdev)
 
 	uniphier_system_bus_set_reg(priv);
 
+	platform_set_drvdata(pdev, priv);
+
 	/* Now, the bus is configured.  Populate platform_devices below it */
 	return of_platform_default_populate(dev->of_node, NULL, dev);
 }
 
+static int __maybe_unused uniphier_system_bus_resume(struct device *dev)
+{
+	uniphier_system_bus_set_reg(dev_get_drvdata(dev));
+
+	return 0;
+}
+
+static const struct dev_pm_ops uniphier_system_bus_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(NULL, uniphier_system_bus_resume)
+};
+
 static const struct of_device_id uniphier_system_bus_match[] = {
 	{ .compatible = "socionext,uniphier-system-bus" },
 	{ /* sentinel */ }
@@ -271,6 +284,7 @@ static struct platform_driver uniphier_system_bus_driver = {
 	.driver = {
 		.name	= "uniphier-system-bus",
 		.of_match_table = uniphier_system_bus_match,
+		.pm = &uniphier_system_bus_pm_ops,
 	},
 };
 module_platform_driver(uniphier_system_bus_driver);
-- 
2.7.4

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

* [PATCH v2] bus: uniphier-system-bus: set up registers when resuming
@ 2017-07-31  5:49 ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2017-07-31  5:49 UTC (permalink / raw)
  To: linux-arm-kernel

When resuming, set up registers that have been lost in the sleep state.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v2:
  - Fix define but not used warning

 drivers/bus/uniphier-system-bus.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/bus/uniphier-system-bus.c b/drivers/bus/uniphier-system-bus.c
index 1e6e0269edcc..f76be6bd6eb3 100644
--- a/drivers/bus/uniphier-system-bus.c
+++ b/drivers/bus/uniphier-system-bus.c
@@ -256,10 +256,23 @@ static int uniphier_system_bus_probe(struct platform_device *pdev)
 
 	uniphier_system_bus_set_reg(priv);
 
+	platform_set_drvdata(pdev, priv);
+
 	/* Now, the bus is configured.  Populate platform_devices below it */
 	return of_platform_default_populate(dev->of_node, NULL, dev);
 }
 
+static int __maybe_unused uniphier_system_bus_resume(struct device *dev)
+{
+	uniphier_system_bus_set_reg(dev_get_drvdata(dev));
+
+	return 0;
+}
+
+static const struct dev_pm_ops uniphier_system_bus_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(NULL, uniphier_system_bus_resume)
+};
+
 static const struct of_device_id uniphier_system_bus_match[] = {
 	{ .compatible = "socionext,uniphier-system-bus" },
 	{ /* sentinel */ }
@@ -271,6 +284,7 @@ static struct platform_driver uniphier_system_bus_driver = {
 	.driver = {
 		.name	= "uniphier-system-bus",
 		.of_match_table = uniphier_system_bus_match,
+		.pm = &uniphier_system_bus_pm_ops,
 	},
 };
 module_platform_driver(uniphier_system_bus_driver);
-- 
2.7.4

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

* Re: [PATCH v2] bus: uniphier-system-bus: set up registers when resuming
  2017-07-31  5:49 ` Masahiro Yamada
@ 2017-08-04 10:58   ` Arnd Bergmann
  -1 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2017-08-04 10:58 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: arm-soc, Linux ARM, Olof Johansson, Masami Hiramatsu, Jassi Brar,
	Linux Kernel Mailing List

On Mon, Jul 31, 2017 at 7:49 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> When resuming, set up registers that have been lost in the sleep state.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied to fixes. I assume you want this in 4.13, but not backported
to stable kernels.
If that is incorrect, please let me know. Ideally that information
should be in the email
though, after the --- line.

Thanks,

       Arnd

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

* [PATCH v2] bus: uniphier-system-bus: set up registers when resuming
@ 2017-08-04 10:58   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2017-08-04 10:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 31, 2017 at 7:49 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> When resuming, set up registers that have been lost in the sleep state.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied to fixes. I assume you want this in 4.13, but not backported
to stable kernels.
If that is incorrect, please let me know. Ideally that information
should be in the email
though, after the --- line.

Thanks,

       Arnd

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

end of thread, other threads:[~2017-08-04 10:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-31  5:49 [PATCH v2] bus: uniphier-system-bus: set up registers when resuming Masahiro Yamada
2017-07-31  5:49 ` Masahiro Yamada
2017-08-04 10:58 ` Arnd Bergmann
2017-08-04 10:58   ` Arnd Bergmann

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.