public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Linux PM mailing list <linux-pm@lists.linux-foundation.org>
Cc: Magnus Damm <magnus.damm@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux-SH <linux-sh@vger.kernel.org>
Subject: [PATCH 2/2] ARM / shmobile: Use pm_genpd_poweroff_unused()
Date: Sun, 10 Jul 2011 20:47:44 +0000	[thread overview]
Message-ID: <201107102247.45034.rjw@sisk.pl> (raw)
In-Reply-To: <201107102246.05107.rjw@sisk.pl>

From: Rafael J. Wysocki <rjw@sisk.pl>

Make shmobile use pm_genpd_poweroff_unused() instead of the
open-coded powering off PM domains without devices in use.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 arch/arm/mach-shmobile/include/mach/common.h |    1 -
 arch/arm/mach-shmobile/pm-sh7372.c           |   13 -------------
 arch/arm/mach-shmobile/pm_runtime.c          |    6 ++----
 3 files changed, 2 insertions(+), 18 deletions(-)

Index: linux-2.6/arch/arm/mach-shmobile/include/mach/common.h
=================================--- linux-2.6.orig/arch/arm/mach-shmobile/include/mach/common.h
+++ linux-2.6/arch/arm/mach-shmobile/include/mach/common.h
@@ -12,7 +12,6 @@ extern struct platform_suspend_ops shmob
 struct cpuidle_device;
 extern void (*shmobile_cpuidle_modes[])(void);
 extern void (*shmobile_cpuidle_setup)(struct cpuidle_device *dev);
-extern void (*shmobile_runtime_pm_late_init)(void);
 
 extern void sh7367_init_irq(void);
 extern void sh7367_add_early_devices(void);
Index: linux-2.6/arch/arm/mach-shmobile/pm-sh7372.c
=================================--- linux-2.6.orig/arch/arm/mach-shmobile/pm-sh7372.c
+++ linux-2.6/arch/arm/mach-shmobile/pm-sh7372.c
@@ -126,17 +126,6 @@ static bool pd_active_wakeup(struct devi
 	return true;
 }
 
-static void sh7372_late_pm_domain_off(void)
-{
-	/* request power down of unused pm domains */
-	queue_work(pm_wq, &sh7372_a4lc.genpd.power_off_work);
-	queue_work(pm_wq, &sh7372_a4mp.genpd.power_off_work);
-	queue_work(pm_wq, &sh7372_d4.genpd.power_off_work);
-	queue_work(pm_wq, &sh7372_a3rv.genpd.power_off_work);
-	queue_work(pm_wq, &sh7372_a3ri.genpd.power_off_work);
-	queue_work(pm_wq, &sh7372_a3sg.genpd.power_off_work);
-}
-
 void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd)
 {
 	struct generic_pm_domain *genpd = &sh7372_pd->genpd;
@@ -157,8 +146,6 @@ void sh7372_init_pm_domain(struct sh7372
 		genpd->power_on = pd_power_up;
 	}
 	genpd->power_on(&sh7372_pd->genpd);
-
-	shmobile_runtime_pm_late_init = sh7372_late_pm_domain_off;
 }
 
 void sh7372_add_device_to_domain(struct sh7372_pm_domain *sh7372_pd,
Index: linux-2.6/arch/arm/mach-shmobile/pm_runtime.c
=================================--- linux-2.6.orig/arch/arm/mach-shmobile/pm_runtime.c
+++ linux-2.6/arch/arm/mach-shmobile/pm_runtime.c
@@ -14,6 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 #include <linux/pm_runtime.h>
+#include <linux/pm_domain.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/sh_clk.h>
@@ -57,12 +58,9 @@ static int __init sh_pm_runtime_init(voi
 }
 core_initcall(sh_pm_runtime_init);
 
-void (*shmobile_runtime_pm_late_init)(void);
-
 static int __init sh_pm_runtime_late_init(void)
 {
-	if (shmobile_runtime_pm_late_init)
-		shmobile_runtime_pm_late_init();
+	pm_genpd_poweroff_unused();
 	return 0;
 }
 late_initcall(sh_pm_runtime_late_init);


      parent reply	other threads:[~2011-07-10 20:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-10 20:46 [PATCH 0/2] PM / Domains: Add code for powering off all unused PM domains Rafael J. Wysocki
2011-07-10 20:46 ` [PATCH 1/2] PM / Domains: Introduce function to power " Rafael J. Wysocki
2011-07-10 20:47 ` Rafael J. Wysocki [this message]

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=201107102247.45034.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox