All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-23  8:33 ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: rjw, ssantosh, tony, khilman, nsekhar, magnus.damm, geert
  Cc: linux-arm-msm, linux-arm-kernel, linux-pm, linux-omap, linux-sh,
	Rajendra Nayak

Most users of PM clocks do the exact same thing in runtime callbacks.
Provide default callbacks and cleanup the existing users (keystone/davinci
/omap1/sh)

Rajendra Nayak (5):
  PM / clock_ops: Provide default runtime ops to users
  arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS

 arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
 arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
 arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
 drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
 drivers/sh/pm_runtime.c            | 47 ++------------------------------------
 include/linux/pm_clock.h           | 10 ++++++++
 6 files changed, 54 insertions(+), 143 deletions(-)

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-23  8:33 ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

Most users of PM clocks do the exact same thing in runtime callbacks.
Provide default callbacks and cleanup the existing users (keystone/davinci
/omap1/sh)

Rajendra Nayak (5):
  PM / clock_ops: Provide default runtime ops to users
  arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS

 arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
 arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
 arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
 drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
 drivers/sh/pm_runtime.c            | 47 ++------------------------------------
 include/linux/pm_clock.h           | 10 ++++++++
 6 files changed, 54 insertions(+), 143 deletions(-)

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

* [PATCH 1/5] PM / clock_ops: Provide default runtime ops to users
  2015-04-23  8:33 ` Rajendra Nayak
  (?)
@ 2015-04-23  8:33   ` Rajendra Nayak
  -1 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: rjw, ssantosh, tony, khilman, nsekhar, magnus.damm, geert
  Cc: linux-arm-msm, linux-arm-kernel, linux-pm, linux-omap, linux-sh,
	Rajendra Nayak

Most users of PM clocks do the extact same things in the runtime
suspend/resume callbacks. Provide them USE_PM_CLK_RUNTIME_OPS so
as to avoid/remove boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/base/power/clock_ops.c | 38 ++++++++++++++++++++++++++++++++++++++
 include/linux/pm_clock.h       | 10 ++++++++++
 2 files changed, 48 insertions(+)

diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 7fdd017..8abea66 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -15,6 +15,7 @@
 #include <linux/clkdev.h>
 #include <linux/slab.h>
 #include <linux/err.h>
+#include <linux/pm_runtime.h>
 
 #ifdef CONFIG_PM
 
@@ -367,6 +368,43 @@ static int pm_clk_notify(struct notifier_block *nb,
 	return 0;
 }
 
+int pm_clk_runtime_suspend(struct device *dev)
+{
+	int ret;
+
+	dev_dbg(dev, "%s\n", __func__);
+
+	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;
+}
+
+int pm_clk_runtime_resume(struct device *dev)
+{
+	int ret;
+
+	dev_dbg(dev, "%s\n", __func__);
+
+	ret = pm_clk_resume(dev);
+	if (ret) {
+		dev_err(dev, "failed to resume clock\n");
+		return ret;
+	}
+
+	return pm_generic_runtime_resume(dev);
+}
+
 #else /* !CONFIG_PM */
 
 /**
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
index 0b00396..25266c6 100644
--- a/include/linux/pm_clock.h
+++ b/include/linux/pm_clock.h
@@ -20,6 +20,16 @@ struct pm_clk_notifier_block {
 
 struct clk;
 
+#ifdef CONFIG_PM
+extern int pm_clk_runtime_suspend(struct device *dev);
+extern int pm_clk_runtime_resume(struct device *dev);
+#define USE_PM_CLK_RUNTIME_OPS \
+	.runtime_suspend = pm_clk_runtime_suspend, \
+	.runtime_resume = pm_clk_runtime_resume,
+#else
+#define USE_PM_CLK_RUNTIME_OPS
+#endif
+
 #ifdef CONFIG_PM_CLK
 static inline bool pm_clk_no_clocks(struct device *dev)
 {
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 1/5] PM / clock_ops: Provide default runtime ops to users
@ 2015-04-23  8:33   ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

Most users of PM clocks do the extact same things in the runtime
suspend/resume callbacks. Provide them USE_PM_CLK_RUNTIME_OPS so
as to avoid/remove boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/base/power/clock_ops.c | 38 ++++++++++++++++++++++++++++++++++++++
 include/linux/pm_clock.h       | 10 ++++++++++
 2 files changed, 48 insertions(+)

diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 7fdd017..8abea66 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -15,6 +15,7 @@
 #include <linux/clkdev.h>
 #include <linux/slab.h>
 #include <linux/err.h>
+#include <linux/pm_runtime.h>
 
 #ifdef CONFIG_PM
 
@@ -367,6 +368,43 @@ static int pm_clk_notify(struct notifier_block *nb,
 	return 0;
 }
 
+int pm_clk_runtime_suspend(struct device *dev)
+{
+	int ret;
+
+	dev_dbg(dev, "%s\n", __func__);
+
+	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;
+}
+
+int pm_clk_runtime_resume(struct device *dev)
+{
+	int ret;
+
+	dev_dbg(dev, "%s\n", __func__);
+
+	ret = pm_clk_resume(dev);
+	if (ret) {
+		dev_err(dev, "failed to resume clock\n");
+		return ret;
+	}
+
+	return pm_generic_runtime_resume(dev);
+}
+
 #else /* !CONFIG_PM */
 
 /**
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
index 0b00396..25266c6 100644
--- a/include/linux/pm_clock.h
+++ b/include/linux/pm_clock.h
@@ -20,6 +20,16 @@ struct pm_clk_notifier_block {
 
 struct clk;
 
+#ifdef CONFIG_PM
+extern int pm_clk_runtime_suspend(struct device *dev);
+extern int pm_clk_runtime_resume(struct device *dev);
+#define USE_PM_CLK_RUNTIME_OPS \
+	.runtime_suspend = pm_clk_runtime_suspend, \
+	.runtime_resume = pm_clk_runtime_resume,
+#else
+#define USE_PM_CLK_RUNTIME_OPS
+#endif
+
 #ifdef CONFIG_PM_CLK
 static inline bool pm_clk_no_clocks(struct device *dev)
 {
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

* [PATCH 2/5] arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  2015-04-23  8:33 ` Rajendra Nayak
  (?)
@ 2015-04-23  8:33   ` Rajendra Nayak
  -1 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: rjw, ssantosh, tony, khilman, nsekhar, magnus.damm, geert
  Cc: linux-arm-msm, linux-arm-kernel, linux-pm, linux-omap, linux-sh,
	Rajendra Nayak

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-keystone/pm_domain.c | 33 +--------------------------------
 1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/arch/arm/mach-keystone/pm_domain.c b/arch/arm/mach-keystone/pm_domain.c
index 41bebfd..edea697 100644
--- a/arch/arm/mach-keystone/pm_domain.c
+++ b/arch/arm/mach-keystone/pm_domain.c
@@ -19,40 +19,9 @@
 #include <linux/clk-provider.h>
 #include <linux/of.h>
 
-#ifdef CONFIG_PM
-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)
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

* [PATCH 2/5] arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
@ 2015-04-23  8:33   ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-keystone/pm_domain.c | 33 +--------------------------------
 1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/arch/arm/mach-keystone/pm_domain.c b/arch/arm/mach-keystone/pm_domain.c
index 41bebfd..edea697 100644
--- a/arch/arm/mach-keystone/pm_domain.c
+++ b/arch/arm/mach-keystone/pm_domain.c
@@ -19,40 +19,9 @@
 #include <linux/clk-provider.h>
 #include <linux/of.h>
 
-#ifdef CONFIG_PM
-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)
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

* [PATCH 3/5] arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  2015-04-23  8:33 ` Rajendra Nayak
  (?)
@ 2015-04-23  8:33   ` Rajendra Nayak
  -1 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: rjw, ssantosh, tony, khilman, nsekhar, magnus.damm, geert
  Cc: linux-arm-msm, linux-arm-kernel, linux-pm, linux-omap, linux-sh,
	Rajendra Nayak

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-omap1/pm_bus.c | 37 ++-----------------------------------
 1 file changed, 2 insertions(+), 35 deletions(-)

diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index c40e209..667c163 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -21,48 +21,15 @@
 
 #include "soc.h"
 
-#ifdef CONFIG_PM
-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,
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-#define OMAP1_PM_DOMAIN (&default_pm_domain)
-#else
-#define OMAP1_PM_DOMAIN NULL
-#endif /* CONFIG_PM */
 
 static struct pm_clk_notifier_block platform_bus_notifier = {
-	.pm_domain = OMAP1_PM_DOMAIN,
+	.pm_domain = &default_pm_domain,
 	.con_ids = { "ick", "fck", NULL, },
 };
 
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 3/5] arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
@ 2015-04-23  8:33   ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-omap1/pm_bus.c | 37 ++-----------------------------------
 1 file changed, 2 insertions(+), 35 deletions(-)

diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index c40e209..667c163 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -21,48 +21,15 @@
 
 #include "soc.h"
 
-#ifdef CONFIG_PM
-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,
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-#define OMAP1_PM_DOMAIN (&default_pm_domain)
-#else
-#define OMAP1_PM_DOMAIN NULL
-#endif /* CONFIG_PM */
 
 static struct pm_clk_notifier_block platform_bus_notifier = {
-	.pm_domain = OMAP1_PM_DOMAIN,
+	.pm_domain = &default_pm_domain,
 	.con_ids = { "ick", "fck", NULL, },
 };
 
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

* [PATCH 4/5] arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  2015-04-23  8:33 ` Rajendra Nayak
  (?)
@ 2015-04-23  8:33   ` Rajendra Nayak
  -1 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: rjw, ssantosh, tony, khilman, nsekhar, magnus.damm, geert
  Cc: linux-arm-msm, linux-arm-kernel, linux-pm, linux-omap, linux-sh,
	Rajendra Nayak

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-davinci/pm_domain.c | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

diff --git a/arch/arm/mach-davinci/pm_domain.c b/arch/arm/mach-davinci/pm_domain.c
index 641edc3..78eac2c 100644
--- a/arch/arm/mach-davinci/pm_domain.c
+++ b/arch/arm/mach-davinci/pm_domain.c
@@ -14,39 +14,9 @@
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 
-#ifdef CONFIG_PM
-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)
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 4/5] arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
@ 2015-04-23  8:33   ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-davinci/pm_domain.c | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

diff --git a/arch/arm/mach-davinci/pm_domain.c b/arch/arm/mach-davinci/pm_domain.c
index 641edc3..78eac2c 100644
--- a/arch/arm/mach-davinci/pm_domain.c
+++ b/arch/arm/mach-davinci/pm_domain.c
@@ -14,39 +14,9 @@
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 
-#ifdef CONFIG_PM
-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)
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

* [PATCH 5/5] drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  2015-04-23  8:33 ` Rajendra Nayak
  (?)
@ 2015-04-23  8:33   ` Rajendra Nayak
  -1 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: rjw, ssantosh, tony, khilman, nsekhar, magnus.damm, geert
  Cc: linux-arm-msm, linux-arm-kernel, linux-pm, linux-omap, linux-sh,
	Rajendra Nayak

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/sh/pm_runtime.c | 47 ++---------------------------------------------
 1 file changed, 2 insertions(+), 45 deletions(-)

diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index cd4c293..e0fd1e0 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -20,58 +20,15 @@
 #include <linux/bitmap.h>
 #include <linux/slab.h>
 
-#ifdef CONFIG_PM
-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,
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
 
-#define DEFAULT_PM_DOMAIN_PTR	(&default_pm_domain)
-
-#else
-
-#define DEFAULT_PM_DOMAIN_PTR	NULL
-
-#endif /* CONFIG_PM */
-
 static struct pm_clk_notifier_block platform_bus_notifier = {
-	.pm_domain = DEFAULT_PM_DOMAIN_PTR,
+	.pm_domain = &default_pm_domain,
 	.con_ids = { NULL, },
 };
 
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 5/5] drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
@ 2015-04-23  8:33   ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/sh/pm_runtime.c | 47 ++---------------------------------------------
 1 file changed, 2 insertions(+), 45 deletions(-)

diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index cd4c293..e0fd1e0 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -20,58 +20,15 @@
 #include <linux/bitmap.h>
 #include <linux/slab.h>
 
-#ifdef CONFIG_PM
-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,
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
 
-#define DEFAULT_PM_DOMAIN_PTR	(&default_pm_domain)
-
-#else
-
-#define DEFAULT_PM_DOMAIN_PTR	NULL
-
-#endif /* CONFIG_PM */
-
 static struct pm_clk_notifier_block platform_bus_notifier = {
-	.pm_domain = DEFAULT_PM_DOMAIN_PTR,
+	.pm_domain = &default_pm_domain,
 	.con_ids = { NULL, },
 };
 
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

* [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-23  8:33 ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

Most users of PM clocks do the exact same thing in runtime callbacks.
Provide default callbacks and cleanup the existing users (keystone/davinci
/omap1/sh)

Rajendra Nayak (5):
  PM / clock_ops: Provide default runtime ops to users
  arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS

 arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
 arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
 arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
 drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
 drivers/sh/pm_runtime.c            | 47 ++------------------------------------
 include/linux/pm_clock.h           | 10 ++++++++
 6 files changed, 54 insertions(+), 143 deletions(-)

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 1/5] PM / clock_ops: Provide default runtime ops to users
@ 2015-04-23  8:33   ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

Most users of PM clocks do the extact same things in the runtime
suspend/resume callbacks. Provide them USE_PM_CLK_RUNTIME_OPS so
as to avoid/remove boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/base/power/clock_ops.c | 38 ++++++++++++++++++++++++++++++++++++++
 include/linux/pm_clock.h       | 10 ++++++++++
 2 files changed, 48 insertions(+)

diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 7fdd017..8abea66 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -15,6 +15,7 @@
 #include <linux/clkdev.h>
 #include <linux/slab.h>
 #include <linux/err.h>
+#include <linux/pm_runtime.h>
 
 #ifdef CONFIG_PM
 
@@ -367,6 +368,43 @@ static int pm_clk_notify(struct notifier_block *nb,
 	return 0;
 }
 
+int pm_clk_runtime_suspend(struct device *dev)
+{
+	int ret;
+
+	dev_dbg(dev, "%s\n", __func__);
+
+	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;
+}
+
+int pm_clk_runtime_resume(struct device *dev)
+{
+	int ret;
+
+	dev_dbg(dev, "%s\n", __func__);
+
+	ret = pm_clk_resume(dev);
+	if (ret) {
+		dev_err(dev, "failed to resume clock\n");
+		return ret;
+	}
+
+	return pm_generic_runtime_resume(dev);
+}
+
 #else /* !CONFIG_PM */
 
 /**
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
index 0b00396..25266c6 100644
--- a/include/linux/pm_clock.h
+++ b/include/linux/pm_clock.h
@@ -20,6 +20,16 @@ struct pm_clk_notifier_block {
 
 struct clk;
 
+#ifdef CONFIG_PM
+extern int pm_clk_runtime_suspend(struct device *dev);
+extern int pm_clk_runtime_resume(struct device *dev);
+#define USE_PM_CLK_RUNTIME_OPS \
+	.runtime_suspend = pm_clk_runtime_suspend, \
+	.runtime_resume = pm_clk_runtime_resume,
+#else
+#define USE_PM_CLK_RUNTIME_OPS
+#endif
+
 #ifdef CONFIG_PM_CLK
 static inline bool pm_clk_no_clocks(struct device *dev)
 {
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 2/5] arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
@ 2015-04-23  8:33   ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-keystone/pm_domain.c | 33 +--------------------------------
 1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/arch/arm/mach-keystone/pm_domain.c b/arch/arm/mach-keystone/pm_domain.c
index 41bebfd..edea697 100644
--- a/arch/arm/mach-keystone/pm_domain.c
+++ b/arch/arm/mach-keystone/pm_domain.c
@@ -19,40 +19,9 @@
 #include <linux/clk-provider.h>
 #include <linux/of.h>
 
-#ifdef CONFIG_PM
-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)
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 3/5] arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
@ 2015-04-23  8:33   ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-omap1/pm_bus.c | 37 ++-----------------------------------
 1 file changed, 2 insertions(+), 35 deletions(-)

diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index c40e209..667c163 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -21,48 +21,15 @@
 
 #include "soc.h"
 
-#ifdef CONFIG_PM
-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,
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-#define OMAP1_PM_DOMAIN (&default_pm_domain)
-#else
-#define OMAP1_PM_DOMAIN NULL
-#endif /* CONFIG_PM */
 
 static struct pm_clk_notifier_block platform_bus_notifier = {
-	.pm_domain = OMAP1_PM_DOMAIN,
+	.pm_domain = &default_pm_domain,
 	.con_ids = { "ick", "fck", NULL, },
 };
 
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 4/5] arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
@ 2015-04-23  8:33   ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-davinci/pm_domain.c | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

diff --git a/arch/arm/mach-davinci/pm_domain.c b/arch/arm/mach-davinci/pm_domain.c
index 641edc3..78eac2c 100644
--- a/arch/arm/mach-davinci/pm_domain.c
+++ b/arch/arm/mach-davinci/pm_domain.c
@@ -14,39 +14,9 @@
 #include <linux/pm_clock.h>
 #include <linux/platform_device.h>
 
-#ifdef CONFIG_PM
-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)
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 5/5] drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
@ 2015-04-23  8:33   ` Rajendra Nayak
  0 siblings, 0 replies; 39+ messages in thread
From: Rajendra Nayak @ 2015-04-23  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
to do runtime_suspend and runtime_resume across users of PM clocks.
Use it to remove the boilerplate code.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/sh/pm_runtime.c | 47 ++---------------------------------------------
 1 file changed, 2 insertions(+), 45 deletions(-)

diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index cd4c293..e0fd1e0 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -20,58 +20,15 @@
 #include <linux/bitmap.h>
 #include <linux/slab.h>
 
-#ifdef CONFIG_PM
-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,
+		USE_PM_CLK_RUNTIME_OPS
 		USE_PLATFORM_PM_SLEEP_OPS
 	},
 };
 
-#define DEFAULT_PM_DOMAIN_PTR	(&default_pm_domain)
-
-#else
-
-#define DEFAULT_PM_DOMAIN_PTR	NULL
-
-#endif /* CONFIG_PM */
-
 static struct pm_clk_notifier_block platform_bus_notifier = {
-	.pm_domain = DEFAULT_PM_DOMAIN_PTR,
+	.pm_domain = &default_pm_domain,
 	.con_ids = { NULL, },
 };
 
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
  2015-04-23  8:33 ` Rajendra Nayak
  (?)
@ 2015-04-24  7:57   ` Ulf Hansson
  -1 siblings, 0 replies; 39+ messages in thread
From: Ulf Hansson @ 2015-04-24  7:57 UTC (permalink / raw)
  To: linux-arm-kernel

On 23 April 2015 at 10:33, Rajendra Nayak <rnayak@codeaurora.org> wrote:
> Most users of PM clocks do the exact same thing in runtime callbacks.
> Provide default callbacks and cleanup the existing users (keystone/davinci
> /omap1/sh)
>
> Rajendra Nayak (5):
>   PM / clock_ops: Provide default runtime ops to users
>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>
>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>  include/linux/pm_clock.h           | 10 ++++++++
>  6 files changed, 54 insertions(+), 143 deletions(-)

I guess you don't need more acks/reviewed by for this patchset. Still,
and also for my own reference.

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-24  7:57   ` Ulf Hansson
  0 siblings, 0 replies; 39+ messages in thread
From: Ulf Hansson @ 2015-04-24  7:57 UTC (permalink / raw)
  To: Rajendra Nayak
  Cc: Rafael J. Wysocki, Santosh Shilimkar, Tony Lindgren,
	Kevin Hilman, Sekhar Nori, Magnus Damm, Geert Uytterhoeven,
	linux-arm-msm, linux-arm-kernel, linux-pm, linux-omap,
	Linux-sh list

On 23 April 2015 at 10:33, Rajendra Nayak <rnayak@codeaurora.org> wrote:
> Most users of PM clocks do the exact same thing in runtime callbacks.
> Provide default callbacks and cleanup the existing users (keystone/davinci
> /omap1/sh)
>
> Rajendra Nayak (5):
>   PM / clock_ops: Provide default runtime ops to users
>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>
>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>  include/linux/pm_clock.h           | 10 ++++++++
>  6 files changed, 54 insertions(+), 143 deletions(-)

I guess you don't need more acks/reviewed by for this patchset. Still,
and also for my own reference.

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

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

* [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-24  7:57   ` Ulf Hansson
  0 siblings, 0 replies; 39+ messages in thread
From: Ulf Hansson @ 2015-04-24  7:57 UTC (permalink / raw)
  To: linux-arm-kernel

On 23 April 2015 at 10:33, Rajendra Nayak <rnayak@codeaurora.org> wrote:
> Most users of PM clocks do the exact same thing in runtime callbacks.
> Provide default callbacks and cleanup the existing users (keystone/davinci
> /omap1/sh)
>
> Rajendra Nayak (5):
>   PM / clock_ops: Provide default runtime ops to users
>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>
>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>  include/linux/pm_clock.h           | 10 ++++++++
>  6 files changed, 54 insertions(+), 143 deletions(-)

I guess you don't need more acks/reviewed by for this patchset. Still,
and also for my own reference.

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
  2015-04-23  8:33 ` Rajendra Nayak
  (?)
@ 2015-04-24 14:41   ` Rafael J. Wysocki
  -1 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2015-04-24 14:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> Most users of PM clocks do the exact same thing in runtime callbacks.
> Provide default callbacks and cleanup the existing users (keystone/davinci
> /omap1/sh)
> 
> Rajendra Nayak (5):
>   PM / clock_ops: Provide default runtime ops to users
>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> 
>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>  include/linux/pm_clock.h           | 10 ++++++++
>  6 files changed, 54 insertions(+), 143 deletions(-)

It is not particularly clear to me who is supposed to apply this series, but
I can do that if people don't have problems with that.


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-24 14:41   ` Rafael J. Wysocki
  0 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2015-04-24 14:41 UTC (permalink / raw)
  To: Rajendra Nayak
  Cc: ssantosh, tony, khilman, nsekhar, magnus.damm, geert,
	linux-arm-msm, linux-arm-kernel, linux-pm, linux-omap, linux-sh

On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> Most users of PM clocks do the exact same thing in runtime callbacks.
> Provide default callbacks and cleanup the existing users (keystone/davinci
> /omap1/sh)
> 
> Rajendra Nayak (5):
>   PM / clock_ops: Provide default runtime ops to users
>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> 
>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>  include/linux/pm_clock.h           | 10 ++++++++
>  6 files changed, 54 insertions(+), 143 deletions(-)

It is not particularly clear to me who is supposed to apply this series, but
I can do that if people don't have problems with that.


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-24 14:41   ` Rafael J. Wysocki
  0 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2015-04-24 14:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> Most users of PM clocks do the exact same thing in runtime callbacks.
> Provide default callbacks and cleanup the existing users (keystone/davinci
> /omap1/sh)
> 
> Rajendra Nayak (5):
>   PM / clock_ops: Provide default runtime ops to users
>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> 
>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>  include/linux/pm_clock.h           | 10 ++++++++
>  6 files changed, 54 insertions(+), 143 deletions(-)

It is not particularly clear to me who is supposed to apply this series, but
I can do that if people don't have problems with that.


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
  2015-04-24 14:41   ` Rafael J. Wysocki
  (?)
@ 2015-04-24 14:51     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 39+ messages in thread
From: Geert Uytterhoeven @ 2015-04-24 14:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 24, 2015 at 4:41 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
>> Most users of PM clocks do the exact same thing in runtime callbacks.
>> Provide default callbacks and cleanup the existing users (keystone/davinci
>> /omap1/sh)
>>
>> Rajendra Nayak (5):
>>   PM / clock_ops: Provide default runtime ops to users
>>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>
>>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>>  include/linux/pm_clock.h           | 10 ++++++++
>>  6 files changed, 54 insertions(+), 143 deletions(-)
>
> It is not particularly clear to me who is supposed to apply this series, but
> I can do that if people don't have problems with that.

All later patches depend on the first patch.

For shmobile, Simon has queued up changes for drivers/sh/pm_runtime.c,
but I think they don't conflict with this series.

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] 39+ messages in thread

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-24 14:51     ` Geert Uytterhoeven
  0 siblings, 0 replies; 39+ messages in thread
From: Geert Uytterhoeven @ 2015-04-24 14:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Simon Horman
  Cc: Rajendra Nayak, Santosh Shilimkar, Tony Lindgren, Kevin Hilman,
	Sekhar Nori, Magnus Damm, linux-arm-msm, linux-arm-kernel,
	Linux PM list, linux-omap, Linux-sh list

On Fri, Apr 24, 2015 at 4:41 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
>> Most users of PM clocks do the exact same thing in runtime callbacks.
>> Provide default callbacks and cleanup the existing users (keystone/davinci
>> /omap1/sh)
>>
>> Rajendra Nayak (5):
>>   PM / clock_ops: Provide default runtime ops to users
>>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>
>>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>>  include/linux/pm_clock.h           | 10 ++++++++
>>  6 files changed, 54 insertions(+), 143 deletions(-)
>
> It is not particularly clear to me who is supposed to apply this series, but
> I can do that if people don't have problems with that.

All later patches depend on the first patch.

For shmobile, Simon has queued up changes for drivers/sh/pm_runtime.c,
but I think they don't conflict with this series.

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] 39+ messages in thread

* [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-24 14:51     ` Geert Uytterhoeven
  0 siblings, 0 replies; 39+ messages in thread
From: Geert Uytterhoeven @ 2015-04-24 14:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 24, 2015 at 4:41 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
>> Most users of PM clocks do the exact same thing in runtime callbacks.
>> Provide default callbacks and cleanup the existing users (keystone/davinci
>> /omap1/sh)
>>
>> Rajendra Nayak (5):
>>   PM / clock_ops: Provide default runtime ops to users
>>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>
>>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>>  include/linux/pm_clock.h           | 10 ++++++++
>>  6 files changed, 54 insertions(+), 143 deletions(-)
>
> It is not particularly clear to me who is supposed to apply this series, but
> I can do that if people don't have problems with that.

All later patches depend on the first patch.

For shmobile, Simon has queued up changes for drivers/sh/pm_runtime.c,
but I think they don't conflict with this series.

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] 39+ messages in thread

* Re: [PATCH 3/5] arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
  2015-04-23  8:33   ` Rajendra Nayak
  (?)
@ 2015-04-24 15:31     ` Tony Lindgren
  -1 siblings, 0 replies; 39+ messages in thread
From: Tony Lindgren @ 2015-04-24 15:31 UTC (permalink / raw)
  To: linux-arm-kernel

* Rajendra Nayak <rnayak@codeaurora.org> [150423 01:34]:
> USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
> to do runtime_suspend and runtime_resume across users of PM clocks.
> Use it to remove the boilerplate code.
> 
> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
> Reviewed-by: Kevin Hilman <khilman@linaro.org>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  arch/arm/mach-omap1/pm_bus.c | 37 ++-----------------------------------
>  1 file changed, 2 insertions(+), 35 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
> index c40e209..667c163 100644
> --- a/arch/arm/mach-omap1/pm_bus.c
> +++ b/arch/arm/mach-omap1/pm_bus.c
> @@ -21,48 +21,15 @@
>  
>  #include "soc.h"
>  
> -#ifdef CONFIG_PM
> -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,
> +		USE_PM_CLK_RUNTIME_OPS
>  		USE_PLATFORM_PM_SLEEP_OPS
>  	},
>  };
> -#define OMAP1_PM_DOMAIN (&default_pm_domain)
> -#else
> -#define OMAP1_PM_DOMAIN NULL
> -#endif /* CONFIG_PM */
>  
>  static struct pm_clk_notifier_block platform_bus_notifier = {
> -	.pm_domain = OMAP1_PM_DOMAIN,
> +	.pm_domain = &default_pm_domain,
>  	.con_ids = { "ick", "fck", NULL, },
>  };
>  
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
> 

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

* Re: [PATCH 3/5] arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
@ 2015-04-24 15:31     ` Tony Lindgren
  0 siblings, 0 replies; 39+ messages in thread
From: Tony Lindgren @ 2015-04-24 15:31 UTC (permalink / raw)
  To: Rajendra Nayak
  Cc: rjw, ssantosh, khilman, nsekhar, magnus.damm, geert,
	linux-arm-msm, linux-arm-kernel, linux-pm, linux-omap, linux-sh

* Rajendra Nayak <rnayak@codeaurora.org> [150423 01:34]:
> USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
> to do runtime_suspend and runtime_resume across users of PM clocks.
> Use it to remove the boilerplate code.
> 
> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
> Reviewed-by: Kevin Hilman <khilman@linaro.org>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  arch/arm/mach-omap1/pm_bus.c | 37 ++-----------------------------------
>  1 file changed, 2 insertions(+), 35 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
> index c40e209..667c163 100644
> --- a/arch/arm/mach-omap1/pm_bus.c
> +++ b/arch/arm/mach-omap1/pm_bus.c
> @@ -21,48 +21,15 @@
>  
>  #include "soc.h"
>  
> -#ifdef CONFIG_PM
> -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,
> +		USE_PM_CLK_RUNTIME_OPS
>  		USE_PLATFORM_PM_SLEEP_OPS
>  	},
>  };
> -#define OMAP1_PM_DOMAIN (&default_pm_domain)
> -#else
> -#define OMAP1_PM_DOMAIN NULL
> -#endif /* CONFIG_PM */
>  
>  static struct pm_clk_notifier_block platform_bus_notifier = {
> -	.pm_domain = OMAP1_PM_DOMAIN,
> +	.pm_domain = &default_pm_domain,
>  	.con_ids = { "ick", "fck", NULL, },
>  };
>  
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
> 

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

* [PATCH 3/5] arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
@ 2015-04-24 15:31     ` Tony Lindgren
  0 siblings, 0 replies; 39+ messages in thread
From: Tony Lindgren @ 2015-04-24 15:31 UTC (permalink / raw)
  To: linux-arm-kernel

* Rajendra Nayak <rnayak@codeaurora.org> [150423 01:34]:
> USE_PM_CLK_RUNTIME_OPS is introduced so we don't repeat the same code
> to do runtime_suspend and runtime_resume across users of PM clocks.
> Use it to remove the boilerplate code.
> 
> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
> Reviewed-by: Kevin Hilman <khilman@linaro.org>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  arch/arm/mach-omap1/pm_bus.c | 37 ++-----------------------------------
>  1 file changed, 2 insertions(+), 35 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
> index c40e209..667c163 100644
> --- a/arch/arm/mach-omap1/pm_bus.c
> +++ b/arch/arm/mach-omap1/pm_bus.c
> @@ -21,48 +21,15 @@
>  
>  #include "soc.h"
>  
> -#ifdef CONFIG_PM
> -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,
> +		USE_PM_CLK_RUNTIME_OPS
>  		USE_PLATFORM_PM_SLEEP_OPS
>  	},
>  };
> -#define OMAP1_PM_DOMAIN (&default_pm_domain)
> -#else
> -#define OMAP1_PM_DOMAIN NULL
> -#endif /* CONFIG_PM */
>  
>  static struct pm_clk_notifier_block platform_bus_notifier = {
> -	.pm_domain = OMAP1_PM_DOMAIN,
> +	.pm_domain = &default_pm_domain,
>  	.con_ids = { "ick", "fck", NULL, },
>  };
>  
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
> 

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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
  2015-04-24 14:41   ` Rafael J. Wysocki
  (?)
@ 2015-04-24 15:34     ` santosh shilimkar
  -1 siblings, 0 replies; 39+ messages in thread
From: santosh shilimkar @ 2015-04-24 15:34 UTC (permalink / raw)
  To: linux-arm-kernel

On 4/24/2015 7:41 AM, Rafael J. Wysocki wrote:
> On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
>> Most users of PM clocks do the exact same thing in runtime callbacks.
>> Provide default callbacks and cleanup the existing users (keystone/davinci
>> /omap1/sh)
>>
>> Rajendra Nayak (5):
>>    PM / clock_ops: Provide default runtime ops to users
>>    arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>    arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>    arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>    drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>
>>   arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>>   arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>>   arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>>   drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>>   drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>>   include/linux/pm_clock.h           | 10 ++++++++
>>   6 files changed, 54 insertions(+), 143 deletions(-)
>
> It is not particularly clear to me who is supposed to apply this series, but
> I can do that if people don't have problems with that.
>
>
I am fine by that given dependency with first patch.
Another way is, you pick up the first patch and give us an
immutable branch.

Either way is fine by me.


Regards,
Santosh

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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-24 15:34     ` santosh shilimkar
  0 siblings, 0 replies; 39+ messages in thread
From: santosh shilimkar @ 2015-04-24 15:34 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rajendra Nayak
  Cc: ssantosh, tony, khilman, nsekhar, magnus.damm, geert,
	linux-arm-msm, linux-arm-kernel, linux-pm, linux-omap, linux-sh

On 4/24/2015 7:41 AM, Rafael J. Wysocki wrote:
> On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
>> Most users of PM clocks do the exact same thing in runtime callbacks.
>> Provide default callbacks and cleanup the existing users (keystone/davinci
>> /omap1/sh)
>>
>> Rajendra Nayak (5):
>>    PM / clock_ops: Provide default runtime ops to users
>>    arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>    arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>    arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>    drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>
>>   arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>>   arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>>   arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>>   drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>>   drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>>   include/linux/pm_clock.h           | 10 ++++++++
>>   6 files changed, 54 insertions(+), 143 deletions(-)
>
> It is not particularly clear to me who is supposed to apply this series, but
> I can do that if people don't have problems with that.
>
>
I am fine by that given dependency with first patch.
Another way is, you pick up the first patch and give us an
immutable branch.

Either way is fine by me.


Regards,
Santosh

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

* [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-24 15:34     ` santosh shilimkar
  0 siblings, 0 replies; 39+ messages in thread
From: santosh shilimkar @ 2015-04-24 15:34 UTC (permalink / raw)
  To: linux-arm-kernel

On 4/24/2015 7:41 AM, Rafael J. Wysocki wrote:
> On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
>> Most users of PM clocks do the exact same thing in runtime callbacks.
>> Provide default callbacks and cleanup the existing users (keystone/davinci
>> /omap1/sh)
>>
>> Rajendra Nayak (5):
>>    PM / clock_ops: Provide default runtime ops to users
>>    arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>    arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>    arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>    drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
>>
>>   arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
>>   arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
>>   arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
>>   drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
>>   drivers/sh/pm_runtime.c            | 47 ++------------------------------------
>>   include/linux/pm_clock.h           | 10 ++++++++
>>   6 files changed, 54 insertions(+), 143 deletions(-)
>
> It is not particularly clear to me who is supposed to apply this series, but
> I can do that if people don't have problems with that.
>
>
I am fine by that given dependency with first patch.
Another way is, you pick up the first patch and give us an
immutable branch.

Either way is fine by me.


Regards,
Santosh

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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
  2015-04-24 14:51     ` Geert Uytterhoeven
  (?)
@ 2015-04-28  0:46       ` Simon Horman
  -1 siblings, 0 replies; 39+ messages in thread
From: Simon Horman @ 2015-04-28  0:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 24, 2015 at 04:51:03PM +0200, Geert Uytterhoeven wrote:
> On Fri, Apr 24, 2015 at 4:41 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> >> Most users of PM clocks do the exact same thing in runtime callbacks.
> >> Provide default callbacks and cleanup the existing users (keystone/davinci
> >> /omap1/sh)
> >>
> >> Rajendra Nayak (5):
> >>   PM / clock_ops: Provide default runtime ops to users
> >>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>
> >>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
> >>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
> >>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
> >>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
> >>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
> >>  include/linux/pm_clock.h           | 10 ++++++++
> >>  6 files changed, 54 insertions(+), 143 deletions(-)
> >
> > It is not particularly clear to me who is supposed to apply this series, but
> > I can do that if people don't have problems with that.
> 
> All later patches depend on the first patch.
> 
> For shmobile, Simon has queued up changes for drivers/sh/pm_runtime.c,
> but I think they don't conflict with this series.

Yes, that is the case. I have some patches (from Geert) queued up for v4.1.
I have confirmed that they do not conflict with the shmobile (last) patch
if this series.

<details>
The patches are in the sh-drivers-for-v4.1 branch of my renesas tree; I
rebased them yesterday; they should hit next today if there is a next
today; I plan to send a pull request to Linus in the not to distant future;
and I envisage they should end up in v4.1-rc2 or rc3.  </details>

On Fri, Apr 24, 2015 at 08:34:33AM -0700, santosh shilimkar wrote:
> On 4/24/2015 7:41 AM, Rafael J. Wysocki wrote:
> >On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:

[snip]

> >It is not particularly clear to me who is supposed to apply this series, but
> >I can do that if people don't have problems with that.
> >
> >
> I am fine by that given dependency with first patch.
> Another way is, you pick up the first patch and give us an
> immutable branch.
> 
> Either way is fine by me.

Likewise.

Here is an ack for the shmobile (last) patch if you decide to take it
through your tree.

Acked-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-28  0:46       ` Simon Horman
  0 siblings, 0 replies; 39+ messages in thread
From: Simon Horman @ 2015-04-28  0:46 UTC (permalink / raw)
  To: Geert Uytterhoeven, santosh shilimkar
  Cc: Rafael J. Wysocki, Rajendra Nayak, Santosh Shilimkar,
	Tony Lindgren, Kevin Hilman, Sekhar Nori, Magnus Damm,
	linux-arm-msm, linux-arm-kernel, Linux PM list, linux-omap,
	Linux-sh list

On Fri, Apr 24, 2015 at 04:51:03PM +0200, Geert Uytterhoeven wrote:
> On Fri, Apr 24, 2015 at 4:41 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> >> Most users of PM clocks do the exact same thing in runtime callbacks.
> >> Provide default callbacks and cleanup the existing users (keystone/davinci
> >> /omap1/sh)
> >>
> >> Rajendra Nayak (5):
> >>   PM / clock_ops: Provide default runtime ops to users
> >>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>
> >>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
> >>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
> >>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
> >>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
> >>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
> >>  include/linux/pm_clock.h           | 10 ++++++++
> >>  6 files changed, 54 insertions(+), 143 deletions(-)
> >
> > It is not particularly clear to me who is supposed to apply this series, but
> > I can do that if people don't have problems with that.
> 
> All later patches depend on the first patch.
> 
> For shmobile, Simon has queued up changes for drivers/sh/pm_runtime.c,
> but I think they don't conflict with this series.

Yes, that is the case. I have some patches (from Geert) queued up for v4.1.
I have confirmed that they do not conflict with the shmobile (last) patch
if this series.

<details>
The patches are in the sh-drivers-for-v4.1 branch of my renesas tree; I
rebased them yesterday; they should hit next today if there is a next
today; I plan to send a pull request to Linus in the not to distant future;
and I envisage they should end up in v4.1-rc2 or rc3.  </details>

On Fri, Apr 24, 2015 at 08:34:33AM -0700, santosh shilimkar wrote:
> On 4/24/2015 7:41 AM, Rafael J. Wysocki wrote:
> >On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:

[snip]

> >It is not particularly clear to me who is supposed to apply this series, but
> >I can do that if people don't have problems with that.
> >
> >
> I am fine by that given dependency with first patch.
> Another way is, you pick up the first patch and give us an
> immutable branch.
> 
> Either way is fine by me.

Likewise.

Here is an ack for the shmobile (last) patch if you decide to take it
through your tree.

Acked-by: Simon Horman <horms+renesas@verge.net.au>


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

* [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-04-28  0:46       ` Simon Horman
  0 siblings, 0 replies; 39+ messages in thread
From: Simon Horman @ 2015-04-28  0:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 24, 2015 at 04:51:03PM +0200, Geert Uytterhoeven wrote:
> On Fri, Apr 24, 2015 at 4:41 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> >> Most users of PM clocks do the exact same thing in runtime callbacks.
> >> Provide default callbacks and cleanup the existing users (keystone/davinci
> >> /omap1/sh)
> >>
> >> Rajendra Nayak (5):
> >>   PM / clock_ops: Provide default runtime ops to users
> >>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> >>
> >>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
> >>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
> >>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
> >>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
> >>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
> >>  include/linux/pm_clock.h           | 10 ++++++++
> >>  6 files changed, 54 insertions(+), 143 deletions(-)
> >
> > It is not particularly clear to me who is supposed to apply this series, but
> > I can do that if people don't have problems with that.
> 
> All later patches depend on the first patch.
> 
> For shmobile, Simon has queued up changes for drivers/sh/pm_runtime.c,
> but I think they don't conflict with this series.

Yes, that is the case. I have some patches (from Geert) queued up for v4.1.
I have confirmed that they do not conflict with the shmobile (last) patch
if this series.

<details>
The patches are in the sh-drivers-for-v4.1 branch of my renesas tree; I
rebased them yesterday; they should hit next today if there is a next
today; I plan to send a pull request to Linus in the not to distant future;
and I envisage they should end up in v4.1-rc2 or rc3.  </details>

On Fri, Apr 24, 2015 at 08:34:33AM -0700, santosh shilimkar wrote:
> On 4/24/2015 7:41 AM, Rafael J. Wysocki wrote:
> >On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:

[snip]

> >It is not particularly clear to me who is supposed to apply this series, but
> >I can do that if people don't have problems with that.
> >
> >
> I am fine by that given dependency with first patch.
> Another way is, you pick up the first patch and give us an
> immutable branch.
> 
> Either way is fine by me.

Likewise.

Here is an ack for the shmobile (last) patch if you decide to take it
through your tree.

Acked-by: Simon Horman <horms+renesas@verge.net.au>

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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
  2015-04-28  0:46       ` Simon Horman
  (?)
@ 2015-05-01  1:09         ` Simon Horman
  -1 siblings, 0 replies; 39+ messages in thread
From: Simon Horman @ 2015-05-01  1:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 28, 2015 at 09:46:18AM +0900, Simon Horman wrote:
> On Fri, Apr 24, 2015 at 04:51:03PM +0200, Geert Uytterhoeven wrote:
> > On Fri, Apr 24, 2015 at 4:41 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > > On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> > >> Most users of PM clocks do the exact same thing in runtime callbacks.
> > >> Provide default callbacks and cleanup the existing users (keystone/davinci
> > >> /omap1/sh)
> > >>
> > >> Rajendra Nayak (5):
> > >>   PM / clock_ops: Provide default runtime ops to users
> > >>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>
> > >>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
> > >>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
> > >>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
> > >>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
> > >>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
> > >>  include/linux/pm_clock.h           | 10 ++++++++
> > >>  6 files changed, 54 insertions(+), 143 deletions(-)
> > >
> > > It is not particularly clear to me who is supposed to apply this series, but
> > > I can do that if people don't have problems with that.
> > 
> > All later patches depend on the first patch.
> > 
> > For shmobile, Simon has queued up changes for drivers/sh/pm_runtime.c,
> > but I think they don't conflict with this series.
> 
> Yes, that is the case. I have some patches (from Geert) queued up for v4.1.
> I have confirmed that they do not conflict with the shmobile (last) patch
> if this series.
> 
> <details>
> The patches are in the sh-drivers-for-v4.1 branch of my renesas tree; I
> rebased them yesterday; they should hit next today if there is a next
> today; I plan to send a pull request to Linus in the not to distant future;
> and I envisage they should end up in v4.1-rc2 or rc3.

The above mentioned changes were tagged as renesas-sh-drivers-for-v4.1 in
my renesas tree; were merged into in Linus's tree yesterday; and should
thus be included in v4.1-rc2.

I do not have any other changes to drivers/sh/pm_runtime.c pending at this time.

> </details>
> 
> On Fri, Apr 24, 2015 at 08:34:33AM -0700, santosh shilimkar wrote:
> > On 4/24/2015 7:41 AM, Rafael J. Wysocki wrote:
> > >On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> 
> [snip]
> 
> > >It is not particularly clear to me who is supposed to apply this series, but
> > >I can do that if people don't have problems with that.
> > >
> > >
> > I am fine by that given dependency with first patch.
> > Another way is, you pick up the first patch and give us an
> > immutable branch.
> > 
> > Either way is fine by me.
> 
> Likewise.
> 
> Here is an ack for the shmobile (last) patch if you decide to take it
> through your tree.
> 
> Acked-by: Simon Horman <horms+renesas@verge.net.au>
> 

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

* Re: [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-05-01  1:09         ` Simon Horman
  0 siblings, 0 replies; 39+ messages in thread
From: Simon Horman @ 2015-05-01  1:09 UTC (permalink / raw)
  To: Geert Uytterhoeven, santosh shilimkar
  Cc: Rafael J. Wysocki, Rajendra Nayak, Santosh Shilimkar,
	Tony Lindgren, Kevin Hilman, Sekhar Nori, Magnus Damm,
	linux-arm-msm, linux-arm-kernel, Linux PM list, linux-omap,
	Linux-sh list

On Tue, Apr 28, 2015 at 09:46:18AM +0900, Simon Horman wrote:
> On Fri, Apr 24, 2015 at 04:51:03PM +0200, Geert Uytterhoeven wrote:
> > On Fri, Apr 24, 2015 at 4:41 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > > On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> > >> Most users of PM clocks do the exact same thing in runtime callbacks.
> > >> Provide default callbacks and cleanup the existing users (keystone/davinci
> > >> /omap1/sh)
> > >>
> > >> Rajendra Nayak (5):
> > >>   PM / clock_ops: Provide default runtime ops to users
> > >>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>
> > >>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
> > >>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
> > >>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
> > >>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
> > >>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
> > >>  include/linux/pm_clock.h           | 10 ++++++++
> > >>  6 files changed, 54 insertions(+), 143 deletions(-)
> > >
> > > It is not particularly clear to me who is supposed to apply this series, but
> > > I can do that if people don't have problems with that.
> > 
> > All later patches depend on the first patch.
> > 
> > For shmobile, Simon has queued up changes for drivers/sh/pm_runtime.c,
> > but I think they don't conflict with this series.
> 
> Yes, that is the case. I have some patches (from Geert) queued up for v4.1.
> I have confirmed that they do not conflict with the shmobile (last) patch
> if this series.
> 
> <details>
> The patches are in the sh-drivers-for-v4.1 branch of my renesas tree; I
> rebased them yesterday; they should hit next today if there is a next
> today; I plan to send a pull request to Linus in the not to distant future;
> and I envisage they should end up in v4.1-rc2 or rc3.

The above mentioned changes were tagged as renesas-sh-drivers-for-v4.1 in
my renesas tree; were merged into in Linus's tree yesterday; and should
thus be included in v4.1-rc2.

I do not have any other changes to drivers/sh/pm_runtime.c pending at this time.

> </details>
> 
> On Fri, Apr 24, 2015 at 08:34:33AM -0700, santosh shilimkar wrote:
> > On 4/24/2015 7:41 AM, Rafael J. Wysocki wrote:
> > >On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> 
> [snip]
> 
> > >It is not particularly clear to me who is supposed to apply this series, but
> > >I can do that if people don't have problems with that.
> > >
> > >
> > I am fine by that given dependency with first patch.
> > Another way is, you pick up the first patch and give us an
> > immutable branch.
> > 
> > Either way is fine by me.
> 
> Likewise.
> 
> Here is an ack for the shmobile (last) patch if you decide to take it
> through your tree.
> 
> Acked-by: Simon Horman <horms+renesas@verge.net.au>
> 

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

* [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users
@ 2015-05-01  1:09         ` Simon Horman
  0 siblings, 0 replies; 39+ messages in thread
From: Simon Horman @ 2015-05-01  1:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 28, 2015 at 09:46:18AM +0900, Simon Horman wrote:
> On Fri, Apr 24, 2015 at 04:51:03PM +0200, Geert Uytterhoeven wrote:
> > On Fri, Apr 24, 2015 at 4:41 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > > On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> > >> Most users of PM clocks do the exact same thing in runtime callbacks.
> > >> Provide default callbacks and cleanup the existing users (keystone/davinci
> > >> /omap1/sh)
> > >>
> > >> Rajendra Nayak (5):
> > >>   PM / clock_ops: Provide default runtime ops to users
> > >>   arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>   arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>   arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>   drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
> > >>
> > >>  arch/arm/mach-davinci/pm_domain.c  | 32 +-------------------------
> > >>  arch/arm/mach-keystone/pm_domain.c | 33 +-------------------------
> > >>  arch/arm/mach-omap1/pm_bus.c       | 37 ++----------------------------
> > >>  drivers/base/power/clock_ops.c     | 38 ++++++++++++++++++++++++++++++
> > >>  drivers/sh/pm_runtime.c            | 47 ++------------------------------------
> > >>  include/linux/pm_clock.h           | 10 ++++++++
> > >>  6 files changed, 54 insertions(+), 143 deletions(-)
> > >
> > > It is not particularly clear to me who is supposed to apply this series, but
> > > I can do that if people don't have problems with that.
> > 
> > All later patches depend on the first patch.
> > 
> > For shmobile, Simon has queued up changes for drivers/sh/pm_runtime.c,
> > but I think they don't conflict with this series.
> 
> Yes, that is the case. I have some patches (from Geert) queued up for v4.1.
> I have confirmed that they do not conflict with the shmobile (last) patch
> if this series.
> 
> <details>
> The patches are in the sh-drivers-for-v4.1 branch of my renesas tree; I
> rebased them yesterday; they should hit next today if there is a next
> today; I plan to send a pull request to Linus in the not to distant future;
> and I envisage they should end up in v4.1-rc2 or rc3.

The above mentioned changes were tagged as renesas-sh-drivers-for-v4.1 in
my renesas tree; were merged into in Linus's tree yesterday; and should
thus be included in v4.1-rc2.

I do not have any other changes to drivers/sh/pm_runtime.c pending at this time.

> </details>
> 
> On Fri, Apr 24, 2015 at 08:34:33AM -0700, santosh shilimkar wrote:
> > On 4/24/2015 7:41 AM, Rafael J. Wysocki wrote:
> > >On Thursday, April 23, 2015 02:03:08 PM Rajendra Nayak wrote:
> 
> [snip]
> 
> > >It is not particularly clear to me who is supposed to apply this series, but
> > >I can do that if people don't have problems with that.
> > >
> > >
> > I am fine by that given dependency with first patch.
> > Another way is, you pick up the first patch and give us an
> > immutable branch.
> > 
> > Either way is fine by me.
> 
> Likewise.
> 
> Here is an ack for the shmobile (last) patch if you decide to take it
> through your tree.
> 
> Acked-by: Simon Horman <horms+renesas@verge.net.au>
> 

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

end of thread, other threads:[~2015-05-01  1:09 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-23  8:33 [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users Rajendra Nayak
2015-04-23  8:45 ` Rajendra Nayak
2015-04-23  8:33 ` Rajendra Nayak
2015-04-23  8:33 ` [PATCH 1/5] PM / clock_ops: Provide default runtime ops to users Rajendra Nayak
2015-04-23  8:45   ` Rajendra Nayak
2015-04-23  8:33   ` Rajendra Nayak
2015-04-23  8:33 ` [PATCH 2/5] arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS Rajendra Nayak
2015-04-23  8:45   ` Rajendra Nayak
2015-04-23  8:33   ` Rajendra Nayak
2015-04-23  8:33 ` [PATCH 3/5] arm: omap1: " Rajendra Nayak
2015-04-23  8:45   ` Rajendra Nayak
2015-04-23  8:33   ` Rajendra Nayak
2015-04-24 15:31   ` Tony Lindgren
2015-04-24 15:31     ` Tony Lindgren
2015-04-24 15:31     ` Tony Lindgren
2015-04-23  8:33 ` [PATCH 4/5] arm: davinci: " Rajendra Nayak
2015-04-23  8:45   ` Rajendra Nayak
2015-04-23  8:33   ` Rajendra Nayak
2015-04-23  8:33 ` [PATCH 5/5] drivers: sh: " Rajendra Nayak
2015-04-23  8:45   ` Rajendra Nayak
2015-04-23  8:33   ` Rajendra Nayak
2015-04-24  7:57 ` [PATCH 0/5] PM / clock_ops: provide default runtime ops and cleanup users Ulf Hansson
2015-04-24  7:57   ` Ulf Hansson
2015-04-24  7:57   ` Ulf Hansson
2015-04-24 14:41 ` Rafael J. Wysocki
2015-04-24 14:41   ` Rafael J. Wysocki
2015-04-24 14:41   ` Rafael J. Wysocki
2015-04-24 14:51   ` Geert Uytterhoeven
2015-04-24 14:51     ` Geert Uytterhoeven
2015-04-24 14:51     ` Geert Uytterhoeven
2015-04-28  0:46     ` Simon Horman
2015-04-28  0:46       ` Simon Horman
2015-04-28  0:46       ` Simon Horman
2015-05-01  1:09       ` Simon Horman
2015-05-01  1:09         ` Simon Horman
2015-05-01  1:09         ` Simon Horman
2015-04-24 15:34   ` santosh shilimkar
2015-04-24 15:34     ` santosh shilimkar
2015-04-24 15:34     ` santosh shilimkar

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.