[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1302134569-22825-2-git-send-email-khilman@ti.com>
Date: Wed, 6 Apr 2011 17:02:44 -0700
From: Kevin Hilman <khilman@...com>
To: linux-arm-kernel@...ts.infradead.org, linux-omap@...r.kernel.org,
linux-sh@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Magnus Damm <magnus.damm@...il.com>,
"Rafael J. Wysocki" <rjw@...e.com>,
Grant Likely <grant.likely@...retlab.ca>,
Greg Kroah-Hartman <gregkh@...e.de>,
Magnus Damm <damm@...nsource.se>,
Paul Mundt <lethal@...ux-sh.org>
Subject: [PATCH/RFC 1/6] ARM: sh-mobile: runtime PM: convert to device powerdomains
Remove the deprecated use of weak platform_bus symbols in favor of using
the new device power domains.
Cc: Magnus Damm <damm@...nsource.se>
Cc: Paul Mundt <lethal@...ux-sh.org>
Signed-off-by: Kevin Hilman <khilman@...com>
---
arch/arm/mach-shmobile/pm_runtime.c | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-shmobile/pm_runtime.c b/arch/arm/mach-shmobile/pm_runtime.c
index 94912d3..6c75c3f 100644
--- a/arch/arm/mach-shmobile/pm_runtime.c
+++ b/arch/arm/mach-shmobile/pm_runtime.c
@@ -66,7 +66,7 @@ static void platform_pm_runtime_bug(struct device *dev,
dev_err(dev, "runtime pm suspend before resume\n");
}
-int platform_pm_runtime_suspend(struct device *dev)
+static int platform_pm_runtime_suspend(struct device *dev)
{
struct pm_runtime_data *prd = __to_prd(dev);
@@ -82,7 +82,7 @@ int platform_pm_runtime_suspend(struct device *dev)
return 0;
}
-int platform_pm_runtime_resume(struct device *dev)
+static int platform_pm_runtime_resume(struct device *dev)
{
struct pm_runtime_data *prd = __to_prd(dev);
@@ -98,12 +98,20 @@ int platform_pm_runtime_resume(struct device *dev)
return 0;
}
-int platform_pm_runtime_idle(struct device *dev)
+static int platform_pm_runtime_idle(struct device *dev)
{
/* suspend synchronously to disable clocks immediately */
return pm_runtime_suspend(dev);
}
+static struct dev_power_domain platform_pm_power_domain = {
+ .ops = {
+ .runtime_suspend = platform_pm_runtime_suspend,
+ .runtime_resume = platform_pm_runtime_resume,
+ .runtime_idle = platform_pm_runtime_idle,
+ },
+};
+
static int platform_bus_notify(struct notifier_block *nb,
unsigned long action, void *data)
{
@@ -114,10 +122,12 @@ static int platform_bus_notify(struct notifier_block *nb,
if (action == BUS_NOTIFY_BIND_DRIVER) {
prd = devres_alloc(__devres_release, sizeof(*prd), GFP_KERNEL);
- if (prd)
+ if (prd) {
devres_add(dev, prd);
- else
+ dev->pwr_domain = &platform_pm_power_domain;
+ } else {
dev_err(dev, "unable to alloc memory for runtime pm\n");
+ }
}
return 0;
--
1.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists