Commit 45e5ca57 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

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: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarMagnus Damm <damm@opensource.se>
parent 7b567407
...@@ -347,14 +347,9 @@ extern int r8a7779_sysc_power_down(struct r8a7779_pm_ch *r8a7779_ch); ...@@ -347,14 +347,9 @@ extern int r8a7779_sysc_power_down(struct r8a7779_pm_ch *r8a7779_ch);
extern int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch); extern int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch);
#ifdef CONFIG_PM #ifdef CONFIG_PM
extern struct r8a7779_pm_domain r8a7779_sh4a; extern void __init r8a7779_init_pm_domains(void);
extern struct r8a7779_pm_domain r8a7779_sgx;
extern struct r8a7779_pm_domain r8a7779_vdp1;
extern struct r8a7779_pm_domain r8a7779_impx3;
extern void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd);
#else #else
#define r8a7779_init_pm_domain(pd) do { } while (0) static inline void r8a7779_init_pm_domains(void) {}
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
#endif /* __ASM_R8A7779_H__ */ #endif /* __ASM_R8A7779_H__ */
...@@ -183,7 +183,7 @@ static bool pd_active_wakeup(struct device *dev) ...@@ -183,7 +183,7 @@ static bool pd_active_wakeup(struct device *dev)
return true; return true;
} }
void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd) static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
{ {
struct generic_pm_domain *genpd = &r8a7779_pd->genpd; struct generic_pm_domain *genpd = &r8a7779_pd->genpd;
...@@ -199,37 +199,44 @@ void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd) ...@@ -199,37 +199,44 @@ void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
pd_power_up(&r8a7779_pd->genpd); pd_power_up(&r8a7779_pd->genpd);
} }
struct r8a7779_pm_domain r8a7779_sh4a = { static struct r8a7779_pm_domain r8a7779_pm_domains[] = {
.genpd.name = "SH4A", {
.ch = { .genpd.name = "SH4A",
.chan_offs = 0x80, /* PWRSR1 .. PWRER1 */ .ch = {
.isr_bit = 16, /* SH4A */ .chan_offs = 0x80, /* PWRSR1 .. PWRER1 */
} .isr_bit = 16, /* SH4A */
},
},
{
.genpd.name = "SGX",
.ch = {
.chan_offs = 0xc0, /* PWRSR2 .. PWRER2 */
.isr_bit = 20, /* SGX */
},
},
{
.genpd.name = "VDP1",
.ch = {
.chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
.isr_bit = 21, /* VDP */
},
},
{
.genpd.name = "IMPX3",
.ch = {
.chan_offs = 0x140, /* PWRSR4 .. PWRER4 */
.isr_bit = 24, /* IMP */
},
},
}; };
struct r8a7779_pm_domain r8a7779_sgx = { void __init r8a7779_init_pm_domains(void)
.genpd.name = "SGX", {
.ch = { int j;
.chan_offs = 0xc0, /* PWRSR2 .. PWRER2 */
.isr_bit = 20, /* SGX */
}
};
struct r8a7779_pm_domain r8a7779_vdp1 = {
.genpd.name = "VDP1",
.ch = {
.chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
.isr_bit = 21, /* VDP */
}
};
struct r8a7779_pm_domain r8a7779_impx3 = { for (j = 0; j < ARRAY_SIZE(r8a7779_pm_domains); j++)
.genpd.name = "IMPX3", r8a7779_init_pm_domain(&r8a7779_pm_domains[j]);
.ch = { }
.chan_offs = 0x140, /* PWRSR4 .. PWRER4 */
.isr_bit = 24, /* IMP */
}
};
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
......
...@@ -251,10 +251,7 @@ void __init r8a7779_add_standard_devices(void) ...@@ -251,10 +251,7 @@ void __init r8a7779_add_standard_devices(void)
#endif #endif
r8a7779_pm_init(); r8a7779_pm_init();
r8a7779_init_pm_domain(&r8a7779_sh4a); r8a7779_init_pm_domains();
r8a7779_init_pm_domain(&r8a7779_sgx);
r8a7779_init_pm_domain(&r8a7779_vdp1);
r8a7779_init_pm_domain(&r8a7779_impx3);
platform_add_devices(r8a7779_early_devices, platform_add_devices(r8a7779_early_devices,
ARRAY_SIZE(r8a7779_early_devices)); ARRAY_SIZE(r8a7779_early_devices));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment