From patchwork Tue Jul 12 22:40:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 969532 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6CMdDUK004181 for ; Tue, 12 Jul 2011 22:39:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756072Ab1GLWjN (ORCPT ); Tue, 12 Jul 2011 18:39:13 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:49787 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754087Ab1GLWjM (ORCPT ); Tue, 12 Jul 2011 18:39:12 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id 6727D1B5336; Wed, 13 Jul 2011 00:11:43 +0200 (CEST) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28584-04; Wed, 13 Jul 2011 00:11:22 +0200 (CEST) Received: from ferrari.rjw.lan (220-bem-13.acn.waw.pl [82.210.184.220]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id 3F9D11B4534; Wed, 13 Jul 2011 00:11:22 +0200 (CEST) From: "Rafael J. Wysocki" To: Magnus Damm Subject: [PATCH] ARM / shmobile: Make A3RV be a subdomain of A4LC on SH7372 Date: Wed, 13 Jul 2011 00:40:02 +0200 User-Agent: KMail/1.13.6 (Linux/3.0.0-rc7+; KDE/4.6.0; x86_64; ; ) Cc: Linux PM mailing list , linux-sh@vger.kernel.org MIME-Version: 1.0 Message-Id: <201107130040.02752.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 12 Jul 2011 22:39:13 +0000 (UTC) From: Rafael J. Wysocki Instead of coding the undocumented dependencies between power domains A3RV and A4LC on SH7372 directly into the low-level power up/down routines, make A3RV be a subdomain of A4LC, which will cause the same dependecies to hold. Signed-off-by: Rafael J. Wysocki --- This patch hasn't been tested yet, so caveat emptor! Thanks, Rafael --- arch/arm/mach-shmobile/pm-sh7372.c | 43 +--------------------------------- arch/arm/mach-shmobile/setup-sh7372.c | 3 ++ 2 files changed, 5 insertions(+), 41 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 @@ -91,36 +91,6 @@ static int pd_power_up(struct generic_pm return ret; } -static int pd_power_up_a3rv(struct generic_pm_domain *genpd) -{ - int ret = pd_power_up(genpd); - - /* force A4LC on after A3RV has been requested on */ - pm_genpd_poweron(&sh7372_a4lc.genpd); - - return ret; -} - -static int pd_power_down_a3rv(struct generic_pm_domain *genpd) -{ - int ret = pd_power_down(genpd); - - /* try to power down A4LC after A3RV is requested off */ - pm_genpd_poweron(&sh7372_a4lc.genpd); - queue_work(pm_wq, &sh7372_a4lc.genpd.power_off_work); - - return ret; -} - -static int pd_power_down_a4lc(struct generic_pm_domain *genpd) -{ - /* only power down A4LC if A3RV is off */ - if (!(__raw_readl(PSTR) & (1 << sh7372_a3rv.bit_shift))) - return pd_power_down(genpd); - - return 0; -} - static bool pd_active_wakeup(struct device *dev) { return true; @@ -134,17 +104,8 @@ void sh7372_init_pm_domain(struct sh7372 genpd->stop_device = pm_clk_suspend; genpd->start_device = pm_clk_resume; genpd->active_wakeup = pd_active_wakeup; - - if (sh7372_pd == &sh7372_a4lc) { - genpd->power_off = pd_power_down_a4lc; - genpd->power_on = pd_power_up; - } else if (sh7372_pd == &sh7372_a3rv) { - genpd->power_off = pd_power_down_a3rv; - genpd->power_on = pd_power_up_a3rv; - } else { - genpd->power_off = pd_power_down; - genpd->power_on = pd_power_up; - } + genpd->power_off = pd_power_down; + genpd->power_on = pd_power_up; genpd->power_on(&sh7372_pd->genpd); } Index: linux-2.6/arch/arm/mach-shmobile/setup-sh7372.c =================================================================== --- linux-2.6.orig/arch/arm/mach-shmobile/setup-sh7372.c +++ linux-2.6/arch/arm/mach-shmobile/setup-sh7372.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -848,6 +849,8 @@ void __init sh7372_add_standard_devices( sh7372_init_pm_domain(&sh7372_a3ri); sh7372_init_pm_domain(&sh7372_a3sg); + pm_genpd_add_subdomain(&sh7372_a4lc.genpd, &sh7372_a3sg.genpd); + platform_add_devices(sh7372_early_devices, ARRAY_SIZE(sh7372_early_devices));