aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r--arch/arm/mach-exynos/pm_domains.c94
1 files changed, 1 insertions, 93 deletions
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index beb946d86fa3..1703593e366c 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -74,16 +74,6 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain)
74 return exynos_pd_power(domain, false); 74 return exynos_pd_power(domain, false);
75} 75}
76 76
77#define EXYNOS_GPD(PD, BASE, NAME) \
78static struct exynos_pm_domain PD = { \
79 .base = (void __iomem *)BASE, \
80 .name = NAME, \
81 .pd = { \
82 .power_off = exynos_pd_power_off, \
83 .power_on = exynos_pd_power_on, \
84 }, \
85}
86
87static void exynos_add_device_to_domain(struct exynos_pm_domain *pd, 77static void exynos_add_device_to_domain(struct exynos_pm_domain *pd,
88 struct device *dev) 78 struct device *dev)
89{ 79{
@@ -156,7 +146,7 @@ static struct notifier_block platform_nb = {
156 .notifier_call = exynos_pm_notifier_call, 146 .notifier_call = exynos_pm_notifier_call,
157}; 147};
158 148
159static __init int exynos_pm_dt_parse_domains(void) 149static __init int exynos4_pm_init_power_domain(void)
160{ 150{
161 struct platform_device *pdev; 151 struct platform_device *pdev;
162 struct device_node *np; 152 struct device_node *np;
@@ -192,88 +182,6 @@ static __init int exynos_pm_dt_parse_domains(void)
192 182
193 return 0; 183 return 0;
194} 184}
195
196static __init __maybe_unused void exynos_pm_add_dev_to_genpd(struct platform_device *pdev,
197 struct exynos_pm_domain *pd)
198{
199 if (pdev->dev.bus) {
200 if (!pm_genpd_add_device(&pd->pd, &pdev->dev))
201 pm_genpd_dev_need_restore(&pdev->dev, true);
202 else
203 pr_info("%s: error in adding %s device to %s power"
204 "domain\n", __func__, dev_name(&pdev->dev),
205 pd->name);
206 }
207}
208
209EXYNOS_GPD(exynos4_pd_mfc, S5P_PMU_MFC_CONF, "pd-mfc");
210EXYNOS_GPD(exynos4_pd_g3d, S5P_PMU_G3D_CONF, "pd-g3d");
211EXYNOS_GPD(exynos4_pd_lcd0, S5P_PMU_LCD0_CONF, "pd-lcd0");
212EXYNOS_GPD(exynos4_pd_lcd1, S5P_PMU_LCD1_CONF, "pd-lcd1");
213EXYNOS_GPD(exynos4_pd_tv, S5P_PMU_TV_CONF, "pd-tv");
214EXYNOS_GPD(exynos4_pd_cam, S5P_PMU_CAM_CONF, "pd-cam");
215EXYNOS_GPD(exynos4_pd_gps, S5P_PMU_GPS_CONF, "pd-gps");
216
217static struct exynos_pm_domain *exynos4_pm_domains[] = {
218 &exynos4_pd_mfc,
219 &exynos4_pd_g3d,
220 &exynos4_pd_lcd0,
221 &exynos4_pd_lcd1,
222 &exynos4_pd_tv,
223 &exynos4_pd_cam,
224 &exynos4_pd_gps,
225};
226
227static __init int exynos4_pm_init_power_domain(void)
228{
229 int idx;
230
231 if (of_have_populated_dt())
232 return exynos_pm_dt_parse_domains();
233
234 for (idx = 0; idx < ARRAY_SIZE(exynos4_pm_domains); idx++) {
235 struct exynos_pm_domain *pd = exynos4_pm_domains[idx];
236 int on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
237
238 pm_genpd_init(&pd->pd, NULL, !on);
239 }
240
241#ifdef CONFIG_S5P_DEV_FIMD0
242 exynos_pm_add_dev_to_genpd(&s5p_device_fimd0, &exynos4_pd_lcd0);
243#endif
244#ifdef CONFIG_S5P_DEV_TV
245 exynos_pm_add_dev_to_genpd(&s5p_device_hdmi, &exynos4_pd_tv);
246 exynos_pm_add_dev_to_genpd(&s5p_device_mixer, &exynos4_pd_tv);
247#endif
248#ifdef CONFIG_S5P_DEV_MFC
249 exynos_pm_add_dev_to_genpd(&s5p_device_mfc, &exynos4_pd_mfc);
250#endif
251#ifdef CONFIG_S5P_DEV_FIMC0
252 exynos_pm_add_dev_to_genpd(&s5p_device_fimc0, &exynos4_pd_cam);
253#endif
254#ifdef CONFIG_S5P_DEV_FIMC1
255 exynos_pm_add_dev_to_genpd(&s5p_device_fimc1, &exynos4_pd_cam);
256#endif
257#ifdef CONFIG_S5P_DEV_FIMC2
258 exynos_pm_add_dev_to_genpd(&s5p_device_fimc2, &exynos4_pd_cam);
259#endif
260#ifdef CONFIG_S5P_DEV_FIMC3
261 exynos_pm_add_dev_to_genpd(&s5p_device_fimc3, &exynos4_pd_cam);
262#endif
263#ifdef CONFIG_S5P_DEV_CSIS0
264 exynos_pm_add_dev_to_genpd(&s5p_device_mipi_csis0, &exynos4_pd_cam);
265#endif
266#ifdef CONFIG_S5P_DEV_CSIS1
267 exynos_pm_add_dev_to_genpd(&s5p_device_mipi_csis1, &exynos4_pd_cam);
268#endif
269#ifdef CONFIG_S5P_DEV_G2D
270 exynos_pm_add_dev_to_genpd(&s5p_device_g2d, &exynos4_pd_lcd0);
271#endif
272#ifdef CONFIG_S5P_DEV_JPEG
273 exynos_pm_add_dev_to_genpd(&s5p_device_jpeg, &exynos4_pd_cam);
274#endif
275 return 0;
276}
277arch_initcall(exynos4_pm_init_power_domain); 185arch_initcall(exynos4_pm_init_power_domain);
278 186
279int __init exynos_pm_late_initcall(void) 187int __init exynos_pm_late_initcall(void)