LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-sh@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Magnus Damm <magnus.damm@gmail.com>,
	"Rafael J. Wysocki" <rjw@suse.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Magnus Damm <damm@opensource.se>,
	Paul Mundt <lethal@linux-sh.org>
Subject: [PATCH/RFC 1/6] ARM: sh-mobile: runtime PM: convert to device powerdomains
Date: Wed,  6 Apr 2011 17:02:44 -0700	[thread overview]
Message-ID: <1302134569-22825-2-git-send-email-khilman@ti.com> (raw)
In-Reply-To: <1302134569-22825-1-git-send-email-khilman@ti.com>

Remove the deprecated use of weak platform_bus symbols in favor of using
the new device power domains.

Cc: Magnus Damm <damm@opensource.se>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Kevin Hilman <khilman@ti.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


  reply	other threads:[~2011-04-07  0:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07  0:02 [PATCH/RFC 0/6] ARM: runtime PM: consolidate runtime PM implementations Kevin Hilman
2011-04-07  0:02 ` Kevin Hilman [this message]
2011-04-07  0:02 ` [PATCH/RFC 2/6] OMAP2+: PM: move runtime PM implementation to use device power domains Kevin Hilman
2011-04-07  5:49   ` Grant Likely
2011-04-07  0:02 ` [PATCH/RFC 3/6] OMAP1: runtime PM: drop platform bus implementation Kevin Hilman
2011-04-07  0:02 ` [PATCH/RFC 4/6] ARM: move SH-mobile runtime PM to arm/common for sharing with other platforms Kevin Hilman
2011-04-07 16:56   ` Paul Mundt
2011-04-07 17:08     ` Kevin Hilman
2011-04-07 22:35       ` Rafael J. Wysocki
2011-04-08  0:38         ` Kevin Hilman
2011-04-08  5:01           ` Paul Mundt
2011-04-07  0:02 ` [PATCH/RFC 5/6] ARM: use common clock-based runtime PM implementation on SH-mobile & OMAP1 Kevin Hilman
2011-04-07  0:02 ` [PATCH/RFC 6/6] Revert "driver core: platform_bus: allow runtime override of dev_pm_ops" Kevin Hilman
2011-04-07  5:38 ` [PATCH/RFC 0/6] ARM: runtime PM: consolidate runtime PM implementations Rafael J. Wysocki
2011-04-07 14:58   ` Kevin Hilman
2011-04-07 17:17     ` Kevin Hilman
2011-04-07 22:31       ` Rafael J. Wysocki
2011-04-08  0:32         ` Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1302134569-22825-2-git-send-email-khilman@ti.com \
    --to=khilman@ti.com \
    --cc=damm@opensource.se \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@suse.de \
    --cc=lethal@linux-sh.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=rjw@suse.com \
    --subject='Re: [PATCH/RFC 1/6] ARM: sh-mobile: runtime PM: convert to device powerdomains' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).