From patchwork Thu Jul 7 13:32:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 952872 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p67DRtPV011694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 7 Jul 2011 13:28:15 GMT Received: from daredevil.linux-foundation.org (localhost [127.0.0.1]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p67DQfgD021367; Thu, 7 Jul 2011 06:26:41 -0700 Received: from mail-pw0-f47.google.com (mail-pw0-f47.google.com [209.85.160.47]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p67DOPsT021018 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Thu, 7 Jul 2011 06:24:26 -0700 Received: by pwi1 with SMTP id 1so669103pwi.6 for ; Thu, 07 Jul 2011 06:24:25 -0700 (PDT) Received: by 10.142.151.5 with SMTP id y5mr446344wfd.372.1310045064910; Thu, 07 Jul 2011 06:24:24 -0700 (PDT) Received: from [127.0.0.1] (FLH1Ama088.tky.mesh.ad.jp [202.225.112.88]) by mx.google.com with ESMTPS id d3sm2261881pbh.53.2011.07.07.06.24.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Jul 2011 06:24:24 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Thu, 07 Jul 2011 22:32:37 +0900 Message-Id: <20110707133237.22347.5463.sendpatchset@t400s> In-Reply-To: <20110707133212.22347.68775.sendpatchset@t400s> References: <20110707133212.22347.68775.sendpatchset@t400s> Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-3.812 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SPF_PASS, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.21 Cc: linux-pm@lists.linux-foundation.org Subject: [linux-pm] [PATCH 03/05] ARM: mach-shmobile: sh7372 late pm domain off X-BeenThere: linux-pm@lists.linux-foundation.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux power management List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 07 Jul 2011 13:28:15 +0000 (UTC) From: Magnus Damm Add sh7372 specific code to power down unused pm domains. This should really be replaced by some generic PM core code IMO, but until that happens this patch makes sure we don't waste power by leaving unused power domains on. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/pm-sh7372.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- 0005/arch/arm/mach-shmobile/pm-sh7372.c +++ work/arch/arm/mach-shmobile/pm-sh7372.c 2011-07-07 20:15:19.000000000 +0900 @@ -96,6 +96,17 @@ 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; @@ -107,6 +118,8 @@ void sh7372_init_pm_domain(struct sh7372 genpd->power_off = pd_power_down; genpd->power_on = pd_power_up; pd_power_up(&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,