From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Date: Sun, 31 Jul 2011 17:52:51 +0000 Subject: [PATCH 9/9] ARM / shmobile: Make A3RV be a subdomain of A4LC on SH7372 Message-Id: <201107311952.51969.rjw@sisk.pl> List-Id: References: <201107311946.06654.rjw@sisk.pl> In-Reply-To: <201107311946.06654.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Linux PM mailing list Cc: LKML , Magnus Damm , linux-sh@vger.kernel.org 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 --- arch/arm/mach-shmobile/pm-sh7372.c | 42 +--------------------------------- arch/arm/mach-shmobile/setup-sh7372.c | 3 ++ 2 files changed, 5 insertions(+), 40 deletions(-) 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,35 +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 */ - genpd_queue_power_off_work(&sh7372_a4lc.genpd); - - 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 -EBUSY; -} - static bool pd_active_wakeup(struct device *dev) { return true; @@ -133,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)); From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752690Ab1GaRxV (ORCPT ); Sun, 31 Jul 2011 13:53:21 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:36730 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752372Ab1GaRwx (ORCPT ); Sun, 31 Jul 2011 13:52:53 -0400 From: "Rafael J. Wysocki" To: Linux PM mailing list Subject: [PATCH 9/9] ARM / shmobile: Make A3RV be a subdomain of A4LC on SH7372 Date: Sun, 31 Jul 2011 19:52:51 +0200 User-Agent: KMail/1.13.6 (Linux/3.0.0+; KDE/4.6.0; x86_64; ; ) Cc: LKML , Magnus Damm , linux-sh@vger.kernel.org References: <201107311946.06654.rjw@sisk.pl> In-Reply-To: <201107311946.06654.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201107311952.51969.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/arm/mach-shmobile/pm-sh7372.c | 42 +--------------------------------- arch/arm/mach-shmobile/setup-sh7372.c | 3 ++ 2 files changed, 5 insertions(+), 40 deletions(-) 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,35 +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 */ - genpd_queue_power_off_work(&sh7372_a4lc.genpd); - - 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 -EBUSY; -} - static bool pd_active_wakeup(struct device *dev) { return true; @@ -133,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));