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