aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-08-06 19:14:14 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-09-03 19:44:58 -0400
commit45e5ca575647ebbca932f34a1ed915ae7a581cbb (patch)
treefee98760fe66f59a05072f2f2050a8bdb5e3333b
parent7b5674075b7c7ddb0c4da18b1f104e1db774ce82 (diff)
ARM: shmobile: Move r8a7779's PM domain objects to a table
Instead of giving a name to every r8a7779's PM domain object, put them all into a table and initialize them all together in a loop. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Magnus Damm <damm@opensource.se>
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h9
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7779.c65
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c5
3 files changed, 39 insertions, 40 deletions
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index e0dcef0aa4c4..7ad47977d2e7 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -347,14 +347,9 @@ extern int r8a7779_sysc_power_down(struct r8a7779_pm_ch *r8a7779_ch);
347extern int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch); 347extern int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch);
348 348
349#ifdef CONFIG_PM 349#ifdef CONFIG_PM
350extern struct r8a7779_pm_domain r8a7779_sh4a; 350extern void __init r8a7779_init_pm_domains(void);
351extern struct r8a7779_pm_domain r8a7779_sgx;
352extern struct r8a7779_pm_domain r8a7779_vdp1;
353extern struct r8a7779_pm_domain r8a7779_impx3;
354
355extern void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd);
356#else 351#else
357#define r8a7779_init_pm_domain(pd) do { } while (0) 352static inline void r8a7779_init_pm_domains(void) {}
358#endif /* CONFIG_PM */ 353#endif /* CONFIG_PM */
359 354
360#endif /* __ASM_R8A7779_H__ */ 355#endif /* __ASM_R8A7779_H__ */
diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c
index b2a98cca66d3..d50a8e9b94a4 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -183,7 +183,7 @@ static bool pd_active_wakeup(struct device *dev)
183 return true; 183 return true;
184} 184}
185 185
186void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd) 186static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
187{ 187{
188 struct generic_pm_domain *genpd = &r8a7779_pd->genpd; 188 struct generic_pm_domain *genpd = &r8a7779_pd->genpd;
189 189
@@ -199,37 +199,44 @@ void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
199 pd_power_up(&r8a7779_pd->genpd); 199 pd_power_up(&r8a7779_pd->genpd);
200} 200}
201 201
202struct r8a7779_pm_domain r8a7779_sh4a = { 202static struct r8a7779_pm_domain r8a7779_pm_domains[] = {
203 .genpd.name = "SH4A", 203 {
204 .ch = { 204 .genpd.name = "SH4A",
205 .chan_offs = 0x80, /* PWRSR1 .. PWRER1 */ 205 .ch = {
206 .isr_bit = 16, /* SH4A */ 206 .chan_offs = 0x80, /* PWRSR1 .. PWRER1 */
207 } 207 .isr_bit = 16, /* SH4A */
208 },
209 },
210 {
211 .genpd.name = "SGX",
212 .ch = {
213 .chan_offs = 0xc0, /* PWRSR2 .. PWRER2 */
214 .isr_bit = 20, /* SGX */
215 },
216 },
217 {
218 .genpd.name = "VDP1",
219 .ch = {
220 .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
221 .isr_bit = 21, /* VDP */
222 },
223 },
224 {
225 .genpd.name = "IMPX3",
226 .ch = {
227 .chan_offs = 0x140, /* PWRSR4 .. PWRER4 */
228 .isr_bit = 24, /* IMP */
229 },
230 },
208}; 231};
209 232
210struct r8a7779_pm_domain r8a7779_sgx = { 233void __init r8a7779_init_pm_domains(void)
211 .genpd.name = "SGX", 234{
212 .ch = { 235 int j;
213 .chan_offs = 0xc0, /* PWRSR2 .. PWRER2 */
214 .isr_bit = 20, /* SGX */
215 }
216};
217
218struct r8a7779_pm_domain r8a7779_vdp1 = {
219 .genpd.name = "VDP1",
220 .ch = {
221 .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
222 .isr_bit = 21, /* VDP */
223 }
224};
225 236
226struct r8a7779_pm_domain r8a7779_impx3 = { 237 for (j = 0; j < ARRAY_SIZE(r8a7779_pm_domains); j++)
227 .genpd.name = "IMPX3", 238 r8a7779_init_pm_domain(&r8a7779_pm_domains[j]);
228 .ch = { 239}
229 .chan_offs = 0x140, /* PWRSR4 .. PWRER4 */
230 .isr_bit = 24, /* IMP */
231 }
232};
233 240
234#endif /* CONFIG_PM */ 241#endif /* CONFIG_PM */
235 242
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index e98e46f6cf55..2917668f0091 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -251,10 +251,7 @@ void __init r8a7779_add_standard_devices(void)
251#endif 251#endif
252 r8a7779_pm_init(); 252 r8a7779_pm_init();
253 253
254 r8a7779_init_pm_domain(&r8a7779_sh4a); 254 r8a7779_init_pm_domains();
255 r8a7779_init_pm_domain(&r8a7779_sgx);
256 r8a7779_init_pm_domain(&r8a7779_vdp1);
257 r8a7779_init_pm_domain(&r8a7779_impx3);
258 255
259 platform_add_devices(r8a7779_early_devices, 256 platform_add_devices(r8a7779_early_devices,
260 ARRAY_SIZE(r8a7779_early_devices)); 257 ARRAY_SIZE(r8a7779_early_devices));