ARM: shmobile: Move r8a7740's PM domain objects to a table
authorRafael J. Wysocki <rjw@sisk.pl>
Mon, 6 Aug 2012 23:13:37 +0000 (01:13 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Mon, 3 Sep 2012 23:44:57 +0000 (01:44 +0200)
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 <rjw@sisk.pl>
Acked-by: Magnus Damm <damm@opensource.se>
arch/arm/mach-shmobile/include/mach/r8a7740.h
arch/arm/mach-shmobile/pm-r8a7740.c
arch/arm/mach-shmobile/setup-r8a7740.c

index 7143147780df55f6e17a689e9cc67ed2a9cd17e9..59d252f4cf975b3ecd64ffde955f8e6f387f7651 100644 (file)
@@ -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__ */
index 893504d012a6bb98b583b1660b156325496eabf0..21e5316d2d881aea42b507334b9fcedd139c760d 100644 (file)
@@ -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 a18892d4d98572e5d555008e3bbd31c45fccd8d4..11bb1d9841975ef9be12c1591fae32c80903b55e 100644 (file)
@@ -673,12 +673,7 @@ void __init r8a7740_add_standard_devices(void)
        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,