18 #include <linux/slab.h>
54 op = (power_on) ?
"enable" :
"disable";
55 pr_err(
"Power domain %s %s failed\n", domain->
name, op);
67 return exynos_pd_power(domain,
true);
72 return exynos_pd_power(domain,
false);
75 #define EXYNOS_GPD(PD, BASE, NAME) \
76 static struct exynos_pm_domain PD = { \
77 .base = (void __iomem *)BASE, \
80 .power_off = exynos_pd_power_off, \
81 .power_on = exynos_pd_power_on, \
86 static __init int exynos_pm_dt_parse_domains(
void)
90 for_each_compatible_node(np,
NULL,
"samsung,exynos4210-pd") {
95 pr_err(
"%s: failed to allocate memory for domain\n",
104 pd->
pd.power_off = exynos_pd_power_off;
105 pd->
pd.power_on = exynos_pd_power_on;
112 static __init int exynos_pm_dt_parse_domains(
void)
122 if (!pm_genpd_add_device(&pd->
pd, &pdev->
dev))
125 pr_info(
"%s: error in adding %s device to %s power"
126 "domain\n", __func__, dev_name(&pdev->
dev),
149 static __init int exynos4_pm_init_power_domain(
void)
153 if (of_have_populated_dt())
154 return exynos_pm_dt_parse_domains();
156 for (idx = 0; idx <
ARRAY_SIZE(exynos4_pm_domains); idx++) {
163 #ifdef CONFIG_S5P_DEV_FIMD0
164 exynos_pm_add_dev_to_genpd(&s5p_device_fimd0, &exynos4_pd_lcd0);
166 #ifdef CONFIG_S5P_DEV_TV
167 exynos_pm_add_dev_to_genpd(&s5p_device_hdmi, &exynos4_pd_tv);
168 exynos_pm_add_dev_to_genpd(&s5p_device_mixer, &exynos4_pd_tv);
170 #ifdef CONFIG_S5P_DEV_MFC
171 exynos_pm_add_dev_to_genpd(&s5p_device_mfc, &exynos4_pd_mfc);
173 #ifdef CONFIG_S5P_DEV_FIMC0
174 exynos_pm_add_dev_to_genpd(&s5p_device_fimc0, &exynos4_pd_cam);
176 #ifdef CONFIG_S5P_DEV_FIMC1
177 exynos_pm_add_dev_to_genpd(&s5p_device_fimc1, &exynos4_pd_cam);
179 #ifdef CONFIG_S5P_DEV_FIMC2
180 exynos_pm_add_dev_to_genpd(&s5p_device_fimc2, &exynos4_pd_cam);
182 #ifdef CONFIG_S5P_DEV_FIMC3
183 exynos_pm_add_dev_to_genpd(&s5p_device_fimc3, &exynos4_pd_cam);
185 #ifdef CONFIG_S5P_DEV_CSIS0
186 exynos_pm_add_dev_to_genpd(&s5p_device_mipi_csis0, &exynos4_pd_cam);
188 #ifdef CONFIG_S5P_DEV_CSIS1
189 exynos_pm_add_dev_to_genpd(&s5p_device_mipi_csis1, &exynos4_pd_cam);
191 #ifdef CONFIG_S5P_DEV_G2D
192 exynos_pm_add_dev_to_genpd(&s5p_device_g2d, &exynos4_pd_lcd0);
194 #ifdef CONFIG_S5P_DEV_JPEG
195 exynos_pm_add_dev_to_genpd(&s5p_device_jpeg, &exynos4_pd_cam);
203 pm_genpd_poweroff_unused();