From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754259Ab2GPV3B (ORCPT ); Mon, 16 Jul 2012 17:29:01 -0400 Received: from ogre.sisk.pl ([193.178.161.156]:43105 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754189Ab2GPV2r (ORCPT ); Mon, 16 Jul 2012 17:28:47 -0400 From: "Rafael J. Wysocki" To: Linux PM list Subject: [RFC][PATCH 10/14] ARM: shmobile: Move r8a7740's PM domain objects to a table Date: Mon, 16 Jul 2012 23:27:43 +0200 User-Agent: KMail/1.13.6 (Linux/3.5.0-rc5+; KDE/4.6.0; x86_64; ; ) Cc: Mark Brown , LKML , Matthew Garrett , Magnus Damm , Arnd Bergmann , Grant Likely , "Linux-sh list" References: <201207032302.17805.rjw@sisk.pl> <201207052217.48086.rjw@sisk.pl> <201207162315.49073.rjw@sisk.pl> In-Reply-To: <201207162315.49073.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Message-Id: <201207162327.44312.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 giving a name to every r8a7740's PM domain object, put them all into a table and use rmobile_init_domains(), introduced by a previous patch, for initializing them all altogether. Also, use pm_genpd_add_subdomain_names() for adding A3SP as a subdomain of A4S. Signed-off-by: Rafael J. Wysocki --- arch/arm/mach-shmobile/include/mach/r8a7740.h | 6 +-- arch/arm/mach-shmobile/pm-r8a7740.c | 42 ++++++++++++++------------ arch/arm/mach-shmobile/setup-r8a7740.c | 7 ---- 3 files changed, 28 insertions(+), 27 deletions(-) Index: linux/arch/arm/mach-shmobile/pm-r8a7740.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/pm-r8a7740.c +++ linux/arch/arm/mach-shmobile/pm-r8a7740.c @@ -21,14 +21,6 @@ static int r8a7740_pd_a4s_suspend(void) return -EBUSY; } -struct rmobile_pm_domain r8a7740_pd_a4s = { - .genpd.name = "A4S", - .bit_shift = 10, - .gov = &pm_domain_always_on_gov, - .no_debug = true, - .suspend = r8a7740_pd_a4s_suspend, -}; - static int r8a7740_pd_a3sp_suspend(void) { /* @@ -38,17 +30,31 @@ static int r8a7740_pd_a3sp_suspend(void) return console_suspend_enabled ? 0 : -EBUSY; } -struct rmobile_pm_domain r8a7740_pd_a3sp = { - .genpd.name = "A3SP", - .bit_shift = 11, - .gov = &pm_domain_always_on_gov, - .no_debug = true, - .suspend = r8a7740_pd_a3sp_suspend, +static struct rmobile_pm_domain r8a7740_pm_domains[] = { + { + .genpd.name = "A4S", + .bit_shift = 10, + .gov = &pm_domain_always_on_gov, + .no_debug = true, + .suspend = r8a7740_pd_a4s_suspend, + }, + { + .genpd.name = "A3SP", + .bit_shift = 11, + .gov = &pm_domain_always_on_gov, + .no_debug = true, + .suspend = r8a7740_pd_a3sp_suspend, + }, + { + .genpd.name = "A4LC", + .bit_shift = 1, + }, }; -struct rmobile_pm_domain r8a7740_pd_a4lc = { - .genpd.name = "A4LC", - .bit_shift = 1, -}; +void __init r8a7740_init_pm_domains(void) +{ + rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains)); + pm_genpd_add_subdomain_names("A4S", "A3SP"); +} #endif /* CONFIG_PM */ Index: linux/arch/arm/mach-shmobile/setup-r8a7740.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/setup-r8a7740.c +++ linux/arch/arm/mach-shmobile/setup-r8a7740.c @@ -673,12 +673,7 @@ void __init r8a7740_add_standard_devices r8a7740_i2c_workaround(&i2c0_device); r8a7740_i2c_workaround(&i2c1_device); - /* PM domain */ - rmobile_init_pm_domain(&r8a7740_pd_a4s); - rmobile_init_pm_domain(&r8a7740_pd_a3sp); - rmobile_init_pm_domain(&r8a7740_pd_a4lc); - - pm_genpd_add_subdomain_names("A4S", "A3SP"); + r8a7740_init_pm_domains(); /* add devices */ platform_add_devices(r8a7740_early_devices, Index: linux/arch/arm/mach-shmobile/include/mach/r8a7740.h =================================================================== --- linux.orig/arch/arm/mach-shmobile/include/mach/r8a7740.h +++ linux/arch/arm/mach-shmobile/include/mach/r8a7740.h @@ -607,9 +607,9 @@ enum { }; #ifdef CONFIG_PM -extern struct rmobile_pm_domain r8a7740_pd_a4s; -extern struct rmobile_pm_domain r8a7740_pd_a3sp; -extern struct rmobile_pm_domain r8a7740_pd_a4lc; +extern void __init r8a7740_init_pm_domains(void); +#else +static inline void r8a7740_init_pm_domains(void) {} #endif /* CONFIG_PM */ #endif /* __ASM_R8A7740_H__ */