All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
@ 2014-04-24 10:26 ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Several platform support codes combine pm_generic_runtime_suspend() and
pm_clk_suspend(), resp. pm_clk_resume() and pm_generic_runtime_resume() in
their .runtime_suspend resp. .runtime_resume callbacks.

Create helpers to consolidate.

  - [1/6] PM / clock_ops: Add helpers combining generic runtime and generic
	  clock PM
  - [2/6] ARM: davinci: Use generic runtime and clock helpers
  - [3/6] ARM: keystone: Use generic runtime and clock helpers
  - [4/6] ARM: omap: Use generic runtime and clock helpers
  - [5/6] drivers: sh: Use generic runtime and clock helpers
  - [6/6] of/clk: Use generic runtime and clock helpers

Patches 5 and 6 have dependencies (listed in the individual patches),
but they can be postponed and handled later.

Thanks!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 0/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
@ 2014-04-24 10:26 ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-pm, linux-kernel
  Cc: Ben Dooks, linux-arm-kernel, linux-omap, linux-sh, devicetree

Several platform support codes combine pm_generic_runtime_suspend() and
pm_clk_suspend(), resp. pm_clk_resume() and pm_generic_runtime_resume() in
their .runtime_suspend resp. .runtime_resume callbacks.

Create helpers to consolidate.

  - [1/6] PM / clock_ops: Add helpers combining generic runtime and generic
	  clock PM
  - [2/6] ARM: davinci: Use generic runtime and clock helpers
  - [3/6] ARM: keystone: Use generic runtime and clock helpers
  - [4/6] ARM: omap: Use generic runtime and clock helpers
  - [5/6] drivers: sh: Use generic runtime and clock helpers
  - [6/6] of/clk: Use generic runtime and clock helpers

Patches 5 and 6 have dependencies (listed in the individual patches),
but they can be postponed and handled later.

Thanks!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 0/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
@ 2014-04-24 10:26 ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Several platform support codes combine pm_generic_runtime_suspend() and
pm_clk_suspend(), resp. pm_clk_resume() and pm_generic_runtime_resume() in
their .runtime_suspend resp. .runtime_resume callbacks.

Create helpers to consolidate.

  - [1/6] PM / clock_ops: Add helpers combining generic runtime and generic
	  clock PM
  - [2/6] ARM: davinci: Use generic runtime and clock helpers
  - [3/6] ARM: keystone: Use generic runtime and clock helpers
  - [4/6] ARM: omap: Use generic runtime and clock helpers
  - [5/6] drivers: sh: Use generic runtime and clock helpers
  - [6/6] of/clk: Use generic runtime and clock helpers

Patches 5 and 6 have dependencies (listed in the individual patches),
but they can be postponed and handled later.

Thanks!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 1/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
  2014-04-24 10:26 ` Geert Uytterhoeven
  (?)
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Add helpers pm_generic_runtime_clk_suspend() and
pm_generic_clk_runtime_resume(), combining generic runtime PM and generic
clock PM.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/base/power/clock_ops.c |   40 ++++++++++++++++++++++++++++++++++++++++
 include/linux/pm_clock.h       |    6 ++++++
 2 files changed, 46 insertions(+)

diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 2d5c9c1eceb1..3cdb9fa2920d 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -11,6 +11,7 @@
 #include <linux/io.h>
 #include <linux/pm.h>
 #include <linux/pm_clock.h>
+#include <linux/pm_runtime.h>
 #include <linux/clk.h>
 #include <linux/slab.h>
 #include <linux/err.h>
@@ -523,3 +524,42 @@ void pm_clk_add_notifier(struct bus_type *bus,
 	clknb->nb.notifier_call = pm_clk_notify;
 	bus_register_notifier(bus, &clknb->nb);
 }
+
+/**
+ * pm_generic_runtime_clk_suspend - Generic runtime suspend and clock disable
+ *				    callback for subsystems.
+ * @dev: Device to resume.
+ */
+int pm_generic_runtime_clk_suspend(struct device *dev)
+{
+	int ret;
+
+	dev_dbg(dev, "%s\n", __func__);
+
+	ret = pm_generic_runtime_suspend(dev);
+	if (ret)
+		return ret;
+
+	ret = pm_clk_suspend(dev);
+	if (ret) {
+		pm_generic_runtime_resume(dev);
+		return ret;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(pm_generic_runtime_clk_suspend);
+
+/**
+ * pm_generic_clk_runtime_resume - Generic clock enable and runtime resume
+ *				   callback for subsystems.
+ * @dev: Device to resume.
+ */
+int pm_generic_clk_runtime_resume(struct device *dev)
+{
+	dev_dbg(dev, "%s\n", __func__);
+
+	pm_clk_resume(dev);
+	return pm_generic_runtime_resume(dev);
+}
+EXPORT_SYMBOL_GPL(pm_generic_clk_runtime_resume);
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
index 6981aa288c45..bf1e4d09a0ca 100644
--- a/include/linux/pm_clock.h
+++ b/include/linux/pm_clock.h
@@ -35,6 +35,8 @@ extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
 extern void pm_clk_remove(struct device *dev, const char *con_id);
 extern int pm_clk_suspend(struct device *dev);
 extern int pm_clk_resume(struct device *dev);
+extern int pm_generic_runtime_clk_suspend(struct device *dev);
+extern int pm_generic_clk_runtime_resume(struct device *dev);
 #else
 static inline bool pm_clk_no_clocks(struct device *dev)
 {
@@ -59,6 +61,10 @@ static inline void pm_clk_remove(struct device *dev, const char *con_id)
 }
 #define pm_clk_suspend	NULL
 #define pm_clk_resume	NULL
+static inline int pm_generic_runtime_clk_suspend(struct device *dev)
+	{ return 0; }
+static inline int pm_generic_clk_runtime_resume(struct device *dev)
+	{ return 0; }
 #endif
 
 #ifdef CONFIG_HAVE_CLK
-- 
1.7.9.5


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

* [PATCH 1/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-pm, linux-kernel
  Cc: Ben Dooks, linux-arm-kernel, linux-omap, linux-sh, devicetree,
	Geert Uytterhoeven

Add helpers pm_generic_runtime_clk_suspend() and
pm_generic_clk_runtime_resume(), combining generic runtime PM and generic
clock PM.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/base/power/clock_ops.c |   40 ++++++++++++++++++++++++++++++++++++++++
 include/linux/pm_clock.h       |    6 ++++++
 2 files changed, 46 insertions(+)

diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 2d5c9c1eceb1..3cdb9fa2920d 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -11,6 +11,7 @@
 #include <linux/io.h>
 #include <linux/pm.h>
 #include <linux/pm_clock.h>
+#include <linux/pm_runtime.h>
 #include <linux/clk.h>
 #include <linux/slab.h>
 #include <linux/err.h>
@@ -523,3 +524,42 @@ void pm_clk_add_notifier(struct bus_type *bus,
 	clknb->nb.notifier_call = pm_clk_notify;
 	bus_register_notifier(bus, &clknb->nb);
 }
+
+/**
+ * pm_generic_runtime_clk_suspend - Generic runtime suspend and clock disable
+ *				    callback for subsystems.
+ * @dev: Device to resume.
+ */
+int pm_generic_runtime_clk_suspend(struct device *dev)
+{
+	int ret;
+
+	dev_dbg(dev, "%s\n", __func__);
+
+	ret = pm_generic_runtime_suspend(dev);
+	if (ret)
+		return ret;
+
+	ret = pm_clk_suspend(dev);
+	if (ret) {
+		pm_generic_runtime_resume(dev);
+		return ret;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(pm_generic_runtime_clk_suspend);
+
+/**
+ * pm_generic_clk_runtime_resume - Generic clock enable and runtime resume
+ *				   callback for subsystems.
+ * @dev: Device to resume.
+ */
+int pm_generic_clk_runtime_resume(struct device *dev)
+{
+	dev_dbg(dev, "%s\n", __func__);
+
+	pm_clk_resume(dev);
+	return pm_generic_runtime_resume(dev);
+}
+EXPORT_SYMBOL_GPL(pm_generic_clk_runtime_resume);
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
index 6981aa288c45..bf1e4d09a0ca 100644
--- a/include/linux/pm_clock.h
+++ b/include/linux/pm_clock.h
@@ -35,6 +35,8 @@ extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
 extern void pm_clk_remove(struct device *dev, const char *con_id);
 extern int pm_clk_suspend(struct device *dev);
 extern int pm_clk_resume(struct device *dev);
+extern int pm_generic_runtime_clk_suspend(struct device *dev);
+extern int pm_generic_clk_runtime_resume(struct device *dev);
 #else
 static inline bool pm_clk_no_clocks(struct device *dev)
 {
@@ -59,6 +61,10 @@ static inline void pm_clk_remove(struct device *dev, const char *con_id)
 }
 #define pm_clk_suspend	NULL
 #define pm_clk_resume	NULL
+static inline int pm_generic_runtime_clk_suspend(struct device *dev)
+	{ return 0; }
+static inline int pm_generic_clk_runtime_resume(struct device *dev)
+	{ return 0; }
 #endif
 
 #ifdef CONFIG_HAVE_CLK
-- 
1.7.9.5


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

* [PATCH 1/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Add helpers pm_generic_runtime_clk_suspend() and
pm_generic_clk_runtime_resume(), combining generic runtime PM and generic
clock PM.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/base/power/clock_ops.c |   40 ++++++++++++++++++++++++++++++++++++++++
 include/linux/pm_clock.h       |    6 ++++++
 2 files changed, 46 insertions(+)

diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 2d5c9c1eceb1..3cdb9fa2920d 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -11,6 +11,7 @@
 #include <linux/io.h>
 #include <linux/pm.h>
 #include <linux/pm_clock.h>
+#include <linux/pm_runtime.h>
 #include <linux/clk.h>
 #include <linux/slab.h>
 #include <linux/err.h>
@@ -523,3 +524,42 @@ void pm_clk_add_notifier(struct bus_type *bus,
 	clknb->nb.notifier_call = pm_clk_notify;
 	bus_register_notifier(bus, &clknb->nb);
 }
+
+/**
+ * pm_generic_runtime_clk_suspend - Generic runtime suspend and clock disable
+ *				    callback for subsystems.
+ * @dev: Device to resume.
+ */
+int pm_generic_runtime_clk_suspend(struct device *dev)
+{
+	int ret;
+
+	dev_dbg(dev, "%s\n", __func__);
+
+	ret = pm_generic_runtime_suspend(dev);
+	if (ret)
+		return ret;
+
+	ret = pm_clk_suspend(dev);
+	if (ret) {
+		pm_generic_runtime_resume(dev);
+		return ret;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(pm_generic_runtime_clk_suspend);
+
+/**
+ * pm_generic_clk_runtime_resume - Generic clock enable and runtime resume
+ *				   callback for subsystems.
+ * @dev: Device to resume.
+ */
+int pm_generic_clk_runtime_resume(struct device *dev)
+{
+	dev_dbg(dev, "%s\n", __func__);
+
+	pm_clk_resume(dev);
+	return pm_generic_runtime_resume(dev);
+}
+EXPORT_SYMBOL_GPL(pm_generic_clk_runtime_resume);
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
index 6981aa288c45..bf1e4d09a0ca 100644
--- a/include/linux/pm_clock.h
+++ b/include/linux/pm_clock.h
@@ -35,6 +35,8 @@ extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
 extern void pm_clk_remove(struct device *dev, const char *con_id);
 extern int pm_clk_suspend(struct device *dev);
 extern int pm_clk_resume(struct device *dev);
+extern int pm_generic_runtime_clk_suspend(struct device *dev);
+extern int pm_generic_clk_runtime_resume(struct device *dev);
 #else
 static inline bool pm_clk_no_clocks(struct device *dev)
 {
@@ -59,6 +61,10 @@ static inline void pm_clk_remove(struct device *dev, const char *con_id)
 }
 #define pm_clk_suspend	NULL
 #define pm_clk_resume	NULL
+static inline int pm_generic_runtime_clk_suspend(struct device *dev)
+	{ return 0; }
+static inline int pm_generic_clk_runtime_resume(struct device *dev)
+	{ return 0; }
 #endif
 
 #ifdef CONFIG_HAVE_CLK
-- 
1.7.9.5

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

* [PATCH 2/6] ARM: davinci: Use generic runtime and clock helpers
  2014-04-24 10:26 ` Geert Uytterhoeven
  (?)
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-davinci/pm_domain.c |   34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/arch/arm/mach-davinci/pm_domain.c b/arch/arm/mach-davinci/pm_domain.c
index 6b98413cebd6..eb2eb126fdc0 100644
--- a/arch/arm/mach-davinci/pm_domain.c
+++ b/arch/arm/mach-davinci/pm_domain.c
@@ -10,43 +10,13 @@
  * warranty of any kind, whether express or implied.
  */
 #include <linux/init.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 
-#ifdef CONFIG_PM_RUNTIME
-static int davinci_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "%s\n", __func__);
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int davinci_pm_runtime_resume(struct device *dev)
-{
-	dev_dbg(dev, "%s\n", __func__);
-
-	pm_clk_resume(dev);
-	return pm_generic_runtime_resume(dev);
-}
-#endif
-
 static struct dev_pm_domain davinci_pm_domain = {
 	.ops = {
-		SET_RUNTIME_PM_OPS(davinci_pm_runtime_suspend,
-				   davinci_pm_runtime_resume, NULL)
+		SET_RUNTIME_PM_OPS(pm_generic_runtime_clk_suspend,
+				   pm_generic_clk_runtime_resume, NULL)
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5


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

* [PATCH 2/6] ARM: davinci: Use generic runtime and clock helpers
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-pm, linux-kernel
  Cc: Ben Dooks, linux-arm-kernel, linux-omap, linux-sh, devicetree,
	Geert Uytterhoeven

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-davinci/pm_domain.c |   34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/arch/arm/mach-davinci/pm_domain.c b/arch/arm/mach-davinci/pm_domain.c
index 6b98413cebd6..eb2eb126fdc0 100644
--- a/arch/arm/mach-davinci/pm_domain.c
+++ b/arch/arm/mach-davinci/pm_domain.c
@@ -10,43 +10,13 @@
  * warranty of any kind, whether express or implied.
  */
 #include <linux/init.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 
-#ifdef CONFIG_PM_RUNTIME
-static int davinci_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "%s\n", __func__);
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int davinci_pm_runtime_resume(struct device *dev)
-{
-	dev_dbg(dev, "%s\n", __func__);
-
-	pm_clk_resume(dev);
-	return pm_generic_runtime_resume(dev);
-}
-#endif
-
 static struct dev_pm_domain davinci_pm_domain = {
 	.ops = {
-		SET_RUNTIME_PM_OPS(davinci_pm_runtime_suspend,
-				   davinci_pm_runtime_resume, NULL)
+		SET_RUNTIME_PM_OPS(pm_generic_runtime_clk_suspend,
+				   pm_generic_clk_runtime_resume, NULL)
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5


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

* [PATCH 2/6] ARM: davinci: Use generic runtime and clock helpers
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-davinci/pm_domain.c |   34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/arch/arm/mach-davinci/pm_domain.c b/arch/arm/mach-davinci/pm_domain.c
index 6b98413cebd6..eb2eb126fdc0 100644
--- a/arch/arm/mach-davinci/pm_domain.c
+++ b/arch/arm/mach-davinci/pm_domain.c
@@ -10,43 +10,13 @@
  * warranty of any kind, whether express or implied.
  */
 #include <linux/init.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 
-#ifdef CONFIG_PM_RUNTIME
-static int davinci_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "%s\n", __func__);
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int davinci_pm_runtime_resume(struct device *dev)
-{
-	dev_dbg(dev, "%s\n", __func__);
-
-	pm_clk_resume(dev);
-	return pm_generic_runtime_resume(dev);
-}
-#endif
-
 static struct dev_pm_domain davinci_pm_domain = {
 	.ops = {
-		SET_RUNTIME_PM_OPS(davinci_pm_runtime_suspend,
-				   davinci_pm_runtime_resume, NULL)
+		SET_RUNTIME_PM_OPS(pm_generic_runtime_clk_suspend,
+				   pm_generic_clk_runtime_resume, NULL)
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5

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

* [PATCH 3/6] ARM: keystone: Use generic runtime and clock helpers
  2014-04-24 10:26 ` Geert Uytterhoeven
  (?)
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-keystone/pm_domain.c |   35 ++---------------------------------
 1 file changed, 2 insertions(+), 33 deletions(-)

diff --git a/arch/arm/mach-keystone/pm_domain.c b/arch/arm/mach-keystone/pm_domain.c
index ca79ddac38bc..f9e36c73b6fc 100644
--- a/arch/arm/mach-keystone/pm_domain.c
+++ b/arch/arm/mach-keystone/pm_domain.c
@@ -13,46 +13,15 @@
  */
 
 #include <linux/init.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 #include <linux/clk-provider.h>
 #include <linux/of.h>
 
-#ifdef CONFIG_PM_RUNTIME
-static int keystone_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "%s\n", __func__);
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int keystone_pm_runtime_resume(struct device *dev)
-{
-	dev_dbg(dev, "%s\n", __func__);
-
-	pm_clk_resume(dev);
-
-	return pm_generic_runtime_resume(dev);
-}
-#endif
-
 static struct dev_pm_domain keystone_pm_domain = {
 	.ops = {
-		SET_RUNTIME_PM_OPS(keystone_pm_runtime_suspend,
-				   keystone_pm_runtime_resume, NULL)
+		SET_RUNTIME_PM_OPS(pm_generic_runtime_clk_suspend,
+				   pm_generic_clk_runtime_resume, NULL)
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5


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

* [PATCH 3/6] ARM: keystone: Use generic runtime and clock helpers
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-pm, linux-kernel
  Cc: Ben Dooks, linux-arm-kernel, linux-omap, linux-sh, devicetree,
	Geert Uytterhoeven

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-keystone/pm_domain.c |   35 ++---------------------------------
 1 file changed, 2 insertions(+), 33 deletions(-)

diff --git a/arch/arm/mach-keystone/pm_domain.c b/arch/arm/mach-keystone/pm_domain.c
index ca79ddac38bc..f9e36c73b6fc 100644
--- a/arch/arm/mach-keystone/pm_domain.c
+++ b/arch/arm/mach-keystone/pm_domain.c
@@ -13,46 +13,15 @@
  */
 
 #include <linux/init.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 #include <linux/clk-provider.h>
 #include <linux/of.h>
 
-#ifdef CONFIG_PM_RUNTIME
-static int keystone_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "%s\n", __func__);
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int keystone_pm_runtime_resume(struct device *dev)
-{
-	dev_dbg(dev, "%s\n", __func__);
-
-	pm_clk_resume(dev);
-
-	return pm_generic_runtime_resume(dev);
-}
-#endif
-
 static struct dev_pm_domain keystone_pm_domain = {
 	.ops = {
-		SET_RUNTIME_PM_OPS(keystone_pm_runtime_suspend,
-				   keystone_pm_runtime_resume, NULL)
+		SET_RUNTIME_PM_OPS(pm_generic_runtime_clk_suspend,
+				   pm_generic_clk_runtime_resume, NULL)
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5


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

* [PATCH 3/6] ARM: keystone: Use generic runtime and clock helpers
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-keystone/pm_domain.c |   35 ++---------------------------------
 1 file changed, 2 insertions(+), 33 deletions(-)

diff --git a/arch/arm/mach-keystone/pm_domain.c b/arch/arm/mach-keystone/pm_domain.c
index ca79ddac38bc..f9e36c73b6fc 100644
--- a/arch/arm/mach-keystone/pm_domain.c
+++ b/arch/arm/mach-keystone/pm_domain.c
@@ -13,46 +13,15 @@
  */
 
 #include <linux/init.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 #include <linux/clk-provider.h>
 #include <linux/of.h>
 
-#ifdef CONFIG_PM_RUNTIME
-static int keystone_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "%s\n", __func__);
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int keystone_pm_runtime_resume(struct device *dev)
-{
-	dev_dbg(dev, "%s\n", __func__);
-
-	pm_clk_resume(dev);
-
-	return pm_generic_runtime_resume(dev);
-}
-#endif
-
 static struct dev_pm_domain keystone_pm_domain = {
 	.ops = {
-		SET_RUNTIME_PM_OPS(keystone_pm_runtime_suspend,
-				   keystone_pm_runtime_resume, NULL)
+		SET_RUNTIME_PM_OPS(pm_generic_runtime_clk_suspend,
+				   pm_generic_clk_runtime_resume, NULL)
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5

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

* [PATCH 4/6] ARM: omap: Use generic runtime and clock helpers
  2014-04-24 10:26 ` Geert Uytterhoeven
  (?)
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-omap1/pm_bus.c |   32 ++------------------------------
 1 file changed, 2 insertions(+), 30 deletions(-)

diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index 3f2d39672393..e2d4b93580d1 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -12,7 +12,6 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
@@ -22,37 +21,10 @@
 #include "soc.h"
 
 #ifdef CONFIG_PM_RUNTIME
-static int omap1_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "%s\n", __func__);
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int omap1_pm_runtime_resume(struct device *dev)
-{
-	dev_dbg(dev, "%s\n", __func__);
-
-	pm_clk_resume(dev);
-	return pm_generic_runtime_resume(dev);
-}
-
 static struct dev_pm_domain default_pm_domain = {
 	.ops = {
-		.runtime_suspend = omap1_pm_runtime_suspend,
-		.runtime_resume = omap1_pm_runtime_resume,
+		.runtime_suspend = pm_generic_runtime_clk_suspend,
+		.runtime_resume = pm_generic_clk_runtime_resume,
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5


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

* [PATCH 4/6] ARM: omap: Use generic runtime and clock helpers
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-pm, linux-kernel
  Cc: Ben Dooks, linux-arm-kernel, linux-omap, linux-sh, devicetree,
	Geert Uytterhoeven

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-omap1/pm_bus.c |   32 ++------------------------------
 1 file changed, 2 insertions(+), 30 deletions(-)

diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index 3f2d39672393..e2d4b93580d1 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -12,7 +12,6 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
@@ -22,37 +21,10 @@
 #include "soc.h"
 
 #ifdef CONFIG_PM_RUNTIME
-static int omap1_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "%s\n", __func__);
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int omap1_pm_runtime_resume(struct device *dev)
-{
-	dev_dbg(dev, "%s\n", __func__);
-
-	pm_clk_resume(dev);
-	return pm_generic_runtime_resume(dev);
-}
-
 static struct dev_pm_domain default_pm_domain = {
 	.ops = {
-		.runtime_suspend = omap1_pm_runtime_suspend,
-		.runtime_resume = omap1_pm_runtime_resume,
+		.runtime_suspend = pm_generic_runtime_clk_suspend,
+		.runtime_resume = pm_generic_clk_runtime_resume,
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5


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

* [PATCH 4/6] ARM: omap: Use generic runtime and clock helpers
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-omap1/pm_bus.c |   32 ++------------------------------
 1 file changed, 2 insertions(+), 30 deletions(-)

diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index 3f2d39672393..e2d4b93580d1 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -12,7 +12,6 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
@@ -22,37 +21,10 @@
 #include "soc.h"
 
 #ifdef CONFIG_PM_RUNTIME
-static int omap1_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "%s\n", __func__);
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int omap1_pm_runtime_resume(struct device *dev)
-{
-	dev_dbg(dev, "%s\n", __func__);
-
-	pm_clk_resume(dev);
-	return pm_generic_runtime_resume(dev);
-}
-
 static struct dev_pm_domain default_pm_domain = {
 	.ops = {
-		.runtime_suspend = omap1_pm_runtime_suspend,
-		.runtime_resume = omap1_pm_runtime_resume,
+		.runtime_suspend = pm_generic_runtime_clk_suspend,
+		.runtime_resume = pm_generic_clk_runtime_resume,
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5

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

* [PATCH 5/6] drivers: sh: Use generic runtime and clock helpers
  2014-04-24 10:26 ` Geert Uytterhoeven
  (?)
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This depends on "drivers: sh: pm_runtime does not need idle callback" and
"drivers: sh: pm_runtime implementation needs to suspend and resume devices"
---
 drivers/sh/pm_runtime.c |   38 ++------------------------------------
 1 file changed, 2 insertions(+), 36 deletions(-)

diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index f0c4a384d49f..05b719637dd4 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -11,7 +11,6 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
@@ -21,43 +20,10 @@
 #include <linux/slab.h>
 
 #ifdef CONFIG_PM_RUNTIME
-static int sh_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret) {
-		dev_err(dev, "failed to suspend device\n");
-		return ret;
-	}
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		dev_err(dev, "failed to suspend clock\n");
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int sh_pm_runtime_resume(struct device *dev)
-{
-	int ret;
-
-	ret = pm_clk_resume(dev);
-	if (ret) {
-		dev_err(dev, "failed to resume clock\n");
-		return ret;
-	}
-
-	return pm_generic_runtime_resume(dev);
-}
-
 static struct dev_pm_domain default_pm_domain = {
 	.ops = {
-		.runtime_suspend = sh_pm_runtime_suspend,
-		.runtime_resume = sh_pm_runtime_resume,
+		.runtime_suspend = pm_generic_runtime_clk_suspend,
+		.runtime_resume = pm_generic_clk_runtime_resume,
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5


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

* [PATCH 5/6] drivers: sh: Use generic runtime and clock helpers
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-pm, linux-kernel
  Cc: Ben Dooks, linux-arm-kernel, linux-omap, linux-sh, devicetree,
	Geert Uytterhoeven

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This depends on "drivers: sh: pm_runtime does not need idle callback" and
"drivers: sh: pm_runtime implementation needs to suspend and resume devices"
---
 drivers/sh/pm_runtime.c |   38 ++------------------------------------
 1 file changed, 2 insertions(+), 36 deletions(-)

diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index f0c4a384d49f..05b719637dd4 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -11,7 +11,6 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
@@ -21,43 +20,10 @@
 #include <linux/slab.h>
 
 #ifdef CONFIG_PM_RUNTIME
-static int sh_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret) {
-		dev_err(dev, "failed to suspend device\n");
-		return ret;
-	}
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		dev_err(dev, "failed to suspend clock\n");
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int sh_pm_runtime_resume(struct device *dev)
-{
-	int ret;
-
-	ret = pm_clk_resume(dev);
-	if (ret) {
-		dev_err(dev, "failed to resume clock\n");
-		return ret;
-	}
-
-	return pm_generic_runtime_resume(dev);
-}
-
 static struct dev_pm_domain default_pm_domain = {
 	.ops = {
-		.runtime_suspend = sh_pm_runtime_suspend,
-		.runtime_resume = sh_pm_runtime_resume,
+		.runtime_suspend = pm_generic_runtime_clk_suspend,
+		.runtime_resume = pm_generic_clk_runtime_resume,
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5


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

* [PATCH 5/6] drivers: sh: Use generic runtime and clock helpers
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This depends on "drivers: sh: pm_runtime does not need idle callback" and
"drivers: sh: pm_runtime implementation needs to suspend and resume devices"
---
 drivers/sh/pm_runtime.c |   38 ++------------------------------------
 1 file changed, 2 insertions(+), 36 deletions(-)

diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index f0c4a384d49f..05b719637dd4 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -11,7 +11,6 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <linux/pm_runtime.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
@@ -21,43 +20,10 @@
 #include <linux/slab.h>
 
 #ifdef CONFIG_PM_RUNTIME
-static int sh_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret) {
-		dev_err(dev, "failed to suspend device\n");
-		return ret;
-	}
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		dev_err(dev, "failed to suspend clock\n");
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int sh_pm_runtime_resume(struct device *dev)
-{
-	int ret;
-
-	ret = pm_clk_resume(dev);
-	if (ret) {
-		dev_err(dev, "failed to resume clock\n");
-		return ret;
-	}
-
-	return pm_generic_runtime_resume(dev);
-}
-
 static struct dev_pm_domain default_pm_domain = {
 	.ops = {
-		.runtime_suspend = sh_pm_runtime_suspend,
-		.runtime_resume = sh_pm_runtime_resume,
+		.runtime_suspend = pm_generic_runtime_clk_suspend,
+		.runtime_resume = pm_generic_clk_runtime_resume,
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5

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

* [PATCH 6/6] of/clk: Use generic runtime and clock helpers
  2014-04-24 10:26 ` Geert Uytterhoeven
  (?)
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This depends on "of/clk: Register clocks suitable for Runtime PM with the
PM core"
---
 drivers/of/of_clk.c |   28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

diff --git a/drivers/of/of_clk.c b/drivers/of/of_clk.c
index 35f5e9f3dd42..3e8561dce998 100644
--- a/drivers/of/of_clk.c
+++ b/drivers/of/of_clk.c
@@ -8,38 +8,14 @@
 #include <linux/of_clk.h>
 #include <linux/platform_device.h>
 #include <linux/pm_clock.h>
-#include <linux/pm_runtime.h>
 
 
 #ifdef CONFIG_PM_RUNTIME
 
-static int of_clk_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int of_clk_pm_runtime_resume(struct device *dev)
-{
-	pm_clk_resume(dev);
-	return pm_generic_runtime_resume(dev);
-}
-
 static struct dev_pm_domain of_clk_pm_domain = {
 	.ops = {
-		.runtime_suspend = of_clk_pm_runtime_suspend,
-		.runtime_resume = of_clk_pm_runtime_resume,
+		.runtime_suspend = pm_generic_runtime_clk_suspend,
+		.runtime_resume = pm_generic_clk_runtime_resume,
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5


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

* [PATCH 6/6] of/clk: Use generic runtime and clock helpers
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-pm, linux-kernel
  Cc: Ben Dooks, linux-arm-kernel, linux-omap, linux-sh, devicetree,
	Geert Uytterhoeven

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This depends on "of/clk: Register clocks suitable for Runtime PM with the
PM core"
---
 drivers/of/of_clk.c |   28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

diff --git a/drivers/of/of_clk.c b/drivers/of/of_clk.c
index 35f5e9f3dd42..3e8561dce998 100644
--- a/drivers/of/of_clk.c
+++ b/drivers/of/of_clk.c
@@ -8,38 +8,14 @@
 #include <linux/of_clk.h>
 #include <linux/platform_device.h>
 #include <linux/pm_clock.h>
-#include <linux/pm_runtime.h>
 
 
 #ifdef CONFIG_PM_RUNTIME
 
-static int of_clk_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int of_clk_pm_runtime_resume(struct device *dev)
-{
-	pm_clk_resume(dev);
-	return pm_generic_runtime_resume(dev);
-}
-
 static struct dev_pm_domain of_clk_pm_domain = {
 	.ops = {
-		.runtime_suspend = of_clk_pm_runtime_suspend,
-		.runtime_resume = of_clk_pm_runtime_resume,
+		.runtime_suspend = pm_generic_runtime_clk_suspend,
+		.runtime_resume = pm_generic_clk_runtime_resume,
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5


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

* [PATCH 6/6] of/clk: Use generic runtime and clock helpers
@ 2014-04-24 10:26   ` Geert Uytterhoeven
  0 siblings, 0 replies; 28+ messages in thread
From: Geert Uytterhoeven @ 2014-04-24 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This depends on "of/clk: Register clocks suitable for Runtime PM with the
PM core"
---
 drivers/of/of_clk.c |   28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

diff --git a/drivers/of/of_clk.c b/drivers/of/of_clk.c
index 35f5e9f3dd42..3e8561dce998 100644
--- a/drivers/of/of_clk.c
+++ b/drivers/of/of_clk.c
@@ -8,38 +8,14 @@
 #include <linux/of_clk.h>
 #include <linux/platform_device.h>
 #include <linux/pm_clock.h>
-#include <linux/pm_runtime.h>
 
 
 #ifdef CONFIG_PM_RUNTIME
 
-static int of_clk_pm_runtime_suspend(struct device *dev)
-{
-	int ret;
-
-	ret = pm_generic_runtime_suspend(dev);
-	if (ret)
-		return ret;
-
-	ret = pm_clk_suspend(dev);
-	if (ret) {
-		pm_generic_runtime_resume(dev);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int of_clk_pm_runtime_resume(struct device *dev)
-{
-	pm_clk_resume(dev);
-	return pm_generic_runtime_resume(dev);
-}
-
 static struct dev_pm_domain of_clk_pm_domain = {
 	.ops = {
-		.runtime_suspend = of_clk_pm_runtime_suspend,
-		.runtime_resume = of_clk_pm_runtime_resume,
+		.runtime_suspend = pm_generic_runtime_clk_suspend,
+		.runtime_resume = pm_generic_clk_runtime_resume,
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
1.7.9.5

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

* Re: [PATCH 1/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
  2014-04-24 10:26   ` Geert Uytterhoeven
  (?)
@ 2014-04-24 11:16     ` Sergei Shtylyov
  -1 siblings, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2014-04-24 11:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 24-04-2014 14:26, Geert Uytterhoeven wrote:

> Add helpers pm_generic_runtime_clk_suspend() and
> pm_generic_clk_runtime_resume(), combining generic runtime PM and generic
> clock PM.

> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

[...]

> diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
> index 6981aa288c45..bf1e4d09a0ca 100644
> --- a/include/linux/pm_clock.h
> +++ b/include/linux/pm_clock.h
> @@ -35,6 +35,8 @@ extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
>   extern void pm_clk_remove(struct device *dev, const char *con_id);
>   extern int pm_clk_suspend(struct device *dev);
>   extern int pm_clk_resume(struct device *dev);
> +extern int pm_generic_runtime_clk_suspend(struct device *dev);
> +extern int pm_generic_clk_runtime_resume(struct device *dev);

    Shouldn't these function names be symmetric? I think '_clk' and '_runtime' 
need swapping in one case.

WBR, Sergei


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

* Re: [PATCH 1/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
@ 2014-04-24 11:16     ` Sergei Shtylyov
  0 siblings, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2014-04-24 11:16 UTC (permalink / raw)
  To: Geert Uytterhoeven, Rafael J. Wysocki, linux-pm, linux-kernel
  Cc: Ben Dooks, linux-arm-kernel, linux-omap, linux-sh, devicetree

Hello.

On 24-04-2014 14:26, Geert Uytterhoeven wrote:

> Add helpers pm_generic_runtime_clk_suspend() and
> pm_generic_clk_runtime_resume(), combining generic runtime PM and generic
> clock PM.

> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

[...]

> diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
> index 6981aa288c45..bf1e4d09a0ca 100644
> --- a/include/linux/pm_clock.h
> +++ b/include/linux/pm_clock.h
> @@ -35,6 +35,8 @@ extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
>   extern void pm_clk_remove(struct device *dev, const char *con_id);
>   extern int pm_clk_suspend(struct device *dev);
>   extern int pm_clk_resume(struct device *dev);
> +extern int pm_generic_runtime_clk_suspend(struct device *dev);
> +extern int pm_generic_clk_runtime_resume(struct device *dev);

    Shouldn't these function names be symmetric? I think '_clk' and '_runtime' 
need swapping in one case.

WBR, Sergei


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

* [PATCH 1/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
@ 2014-04-24 11:16     ` Sergei Shtylyov
  0 siblings, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2014-04-24 11:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 24-04-2014 14:26, Geert Uytterhoeven wrote:

> Add helpers pm_generic_runtime_clk_suspend() and
> pm_generic_clk_runtime_resume(), combining generic runtime PM and generic
> clock PM.

> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

[...]

> diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
> index 6981aa288c45..bf1e4d09a0ca 100644
> --- a/include/linux/pm_clock.h
> +++ b/include/linux/pm_clock.h
> @@ -35,6 +35,8 @@ extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
>   extern void pm_clk_remove(struct device *dev, const char *con_id);
>   extern int pm_clk_suspend(struct device *dev);
>   extern int pm_clk_resume(struct device *dev);
> +extern int pm_generic_runtime_clk_suspend(struct device *dev);
> +extern int pm_generic_clk_runtime_resume(struct device *dev);

    Shouldn't these function names be symmetric? I think '_clk' and '_runtime' 
need swapping in one case.

WBR, Sergei

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

* Re: [PATCH 0/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
  2014-04-24 10:26 ` Geert Uytterhoeven
  (?)
  (?)
@ 2014-04-24 13:26   ` Ulf Hansson
  -1 siblings, 0 replies; 28+ messages in thread
From: Ulf Hansson @ 2014-04-24 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 24 April 2014 12:26, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> Several platform support codes combine pm_generic_runtime_suspend() and
> pm_clk_suspend(), resp. pm_clk_resume() and pm_generic_runtime_resume() in
> their .runtime_suspend resp. .runtime_resume callbacks.
>
> Create helpers to consolidate.
>
>   - [1/6] PM / clock_ops: Add helpers combining generic runtime and generic
>           clock PM

How about adding the code from the above patch into the generic power
domain instead?

>   - [2/6] ARM: davinci: Use generic runtime and clock helpers
>   - [3/6] ARM: keystone: Use generic runtime and clock helpers
>   - [4/6] ARM: omap: Use generic runtime and clock helpers
>   - [5/6] drivers: sh: Use generic runtime and clock helpers

Then convert the above power domains implementations to the generic
power domain? Would that work?

Kind regards
Ulf Hansson

>   - [6/6] of/clk: Use generic runtime and clock helpers
>
> Patches 5 and 6 have dependencies (listed in the individual patches),
> but they can be postponed and handled later.
>
> Thanks!
>
> Gr{oetje,eeting}s,
>
>                                                 Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                                             -- Linus Torvalds
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 0/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
@ 2014-04-24 13:26   ` Ulf Hansson
  0 siblings, 0 replies; 28+ messages in thread
From: Ulf Hansson @ 2014-04-24 13:26 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rafael J. Wysocki, linux-pm, linux-kernel, Ben Dooks,
	linux-arm-kernel, linux-omap, linux-sh, devicetree

On 24 April 2014 12:26, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> Several platform support codes combine pm_generic_runtime_suspend() and
> pm_clk_suspend(), resp. pm_clk_resume() and pm_generic_runtime_resume() in
> their .runtime_suspend resp. .runtime_resume callbacks.
>
> Create helpers to consolidate.
>
>   - [1/6] PM / clock_ops: Add helpers combining generic runtime and generic
>           clock PM

How about adding the code from the above patch into the generic power
domain instead?

>   - [2/6] ARM: davinci: Use generic runtime and clock helpers
>   - [3/6] ARM: keystone: Use generic runtime and clock helpers
>   - [4/6] ARM: omap: Use generic runtime and clock helpers
>   - [5/6] drivers: sh: Use generic runtime and clock helpers

Then convert the above power domains implementations to the generic
power domain? Would that work?

Kind regards
Ulf Hansson

>   - [6/6] of/clk: Use generic runtime and clock helpers
>
> Patches 5 and 6 have dependencies (listed in the individual patches),
> but they can be postponed and handled later.
>
> Thanks!
>
> Gr{oetje,eeting}s,
>
>                                                 Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                                             -- Linus Torvalds
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 0/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
@ 2014-04-24 13:26   ` Ulf Hansson
  0 siblings, 0 replies; 28+ messages in thread
From: Ulf Hansson @ 2014-04-24 13:26 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rafael J. Wysocki, linux-pm, linux-kernel, Ben Dooks,
	linux-arm-kernel, linux-omap, linux-sh, devicetree

On 24 April 2014 12:26, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> Several platform support codes combine pm_generic_runtime_suspend() and
> pm_clk_suspend(), resp. pm_clk_resume() and pm_generic_runtime_resume() in
> their .runtime_suspend resp. .runtime_resume callbacks.
>
> Create helpers to consolidate.
>
>   - [1/6] PM / clock_ops: Add helpers combining generic runtime and generic
>           clock PM

How about adding the code from the above patch into the generic power
domain instead?

>   - [2/6] ARM: davinci: Use generic runtime and clock helpers
>   - [3/6] ARM: keystone: Use generic runtime and clock helpers
>   - [4/6] ARM: omap: Use generic runtime and clock helpers
>   - [5/6] drivers: sh: Use generic runtime and clock helpers

Then convert the above power domains implementations to the generic
power domain? Would that work?

Kind regards
Ulf Hansson

>   - [6/6] of/clk: Use generic runtime and clock helpers
>
> Patches 5 and 6 have dependencies (listed in the individual patches),
> but they can be postponed and handled later.
>
> Thanks!
>
> Gr{oetje,eeting}s,
>
>                                                 Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                                             -- Linus Torvalds
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 0/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM
@ 2014-04-24 13:26   ` Ulf Hansson
  0 siblings, 0 replies; 28+ messages in thread
From: Ulf Hansson @ 2014-04-24 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 24 April 2014 12:26, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> Several platform support codes combine pm_generic_runtime_suspend() and
> pm_clk_suspend(), resp. pm_clk_resume() and pm_generic_runtime_resume() in
> their .runtime_suspend resp. .runtime_resume callbacks.
>
> Create helpers to consolidate.
>
>   - [1/6] PM / clock_ops: Add helpers combining generic runtime and generic
>           clock PM

How about adding the code from the above patch into the generic power
domain instead?

>   - [2/6] ARM: davinci: Use generic runtime and clock helpers
>   - [3/6] ARM: keystone: Use generic runtime and clock helpers
>   - [4/6] ARM: omap: Use generic runtime and clock helpers
>   - [5/6] drivers: sh: Use generic runtime and clock helpers

Then convert the above power domains implementations to the generic
power domain? Would that work?

Kind regards
Ulf Hansson

>   - [6/6] of/clk: Use generic runtime and clock helpers
>
> Patches 5 and 6 have dependencies (listed in the individual patches),
> but they can be postponed and handled later.
>
> Thanks!
>
> Gr{oetje,eeting}s,
>
>                                                 Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                                             -- Linus Torvalds
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-04-24 13:27 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-24 10:26 [PATCH 0/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM Geert Uytterhoeven
2014-04-24 10:26 ` Geert Uytterhoeven
2014-04-24 10:26 ` Geert Uytterhoeven
2014-04-24 10:26 ` [PATCH 1/6] " Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 11:16   ` Sergei Shtylyov
2014-04-24 11:16     ` Sergei Shtylyov
2014-04-24 11:16     ` Sergei Shtylyov
2014-04-24 10:26 ` [PATCH 2/6] ARM: davinci: Use generic runtime and clock helpers Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 10:26 ` [PATCH 3/6] ARM: keystone: " Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 10:26 ` [PATCH 4/6] ARM: omap: " Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 10:26 ` [PATCH 5/6] drivers: sh: " Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 10:26 ` [PATCH 6/6] of/clk: " Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 10:26   ` Geert Uytterhoeven
2014-04-24 13:26 ` [PATCH 0/6] PM / clock_ops: Add helpers combining generic runtime and generic clock PM Ulf Hansson
2014-04-24 13:26   ` Ulf Hansson
2014-04-24 13:26   ` Ulf Hansson
2014-04-24 13:26   ` Ulf Hansson

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.