diff options
author | Tony Lindgren <tony@atomide.com> | 2016-10-17 03:08:40 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2016-11-10 11:01:33 -0500 |
commit | cb6675d6a868215a778752318668ab98dfd7738c (patch) | |
tree | a93525a546bac07953de2704d5101c7e7ff9d1ee /arch/arm/mach-omap2/pm.c | |
parent | 65fa3e719f36faf511f2da9063a415060e565b5d (diff) |
ARM: OMAP2+: Remove legacy PM init
This is no longer needed when booted with device tree.
And let's replace cpu_is with soc_is for the PM code to
avoid confusion, they do the same thing.
Note that omap_pmic_late_init() now just calls
omap3_twl_init() and omap4_twl_init() to initialize the
voltage layer so we can remove the remaining references
to twl-common code and remove it in the following patch.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm.c')
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 66 |
1 files changed, 6 insertions, 60 deletions
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 678d2a31dcb8..76b0454ddc49 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include "powerdomain.h" | 30 | #include "powerdomain.h" |
31 | #include "clockdomain.h" | 31 | #include "clockdomain.h" |
32 | #include "pm.h" | 32 | #include "pm.h" |
33 | #include "twl-common.h" | ||
34 | 33 | ||
35 | #ifdef CONFIG_SUSPEND | 34 | #ifdef CONFIG_SUSPEND |
36 | /* | 35 | /* |
@@ -72,42 +71,6 @@ void omap_pm_get_oscillator(u32 *tstart, u32 *tshut) | |||
72 | } | 71 | } |
73 | #endif | 72 | #endif |
74 | 73 | ||
75 | static int __init _init_omap_device(char *name) | ||
76 | { | ||
77 | struct omap_hwmod *oh; | ||
78 | struct platform_device *pdev; | ||
79 | |||
80 | oh = omap_hwmod_lookup(name); | ||
81 | if (WARN(!oh, "%s: could not find omap_hwmod for %s\n", | ||
82 | __func__, name)) | ||
83 | return -ENODEV; | ||
84 | |||
85 | pdev = omap_device_build(oh->name, 0, oh, NULL, 0); | ||
86 | if (WARN(IS_ERR(pdev), "%s: could not build omap_device for %s\n", | ||
87 | __func__, name)) | ||
88 | return -ENODEV; | ||
89 | |||
90 | return 0; | ||
91 | } | ||
92 | |||
93 | /* | ||
94 | * Build omap_devices for processors and bus. | ||
95 | */ | ||
96 | static void __init omap2_init_processor_devices(void) | ||
97 | { | ||
98 | _init_omap_device("mpu"); | ||
99 | if (omap3_has_iva()) | ||
100 | _init_omap_device("iva"); | ||
101 | |||
102 | if (cpu_is_omap44xx()) { | ||
103 | _init_omap_device("l3_main_1"); | ||
104 | _init_omap_device("dsp"); | ||
105 | _init_omap_device("iva"); | ||
106 | } else { | ||
107 | _init_omap_device("l3_main"); | ||
108 | } | ||
109 | } | ||
110 | |||
111 | int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused) | 74 | int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused) |
112 | { | 75 | { |
113 | clkdm_allow_idle(clkdm); | 76 | clkdm_allow_idle(clkdm); |
@@ -215,7 +178,7 @@ static int omap_pm_enter(suspend_state_t suspend_state) | |||
215 | static int omap_pm_begin(suspend_state_t state) | 178 | static int omap_pm_begin(suspend_state_t state) |
216 | { | 179 | { |
217 | cpu_idle_poll_ctrl(true); | 180 | cpu_idle_poll_ctrl(true); |
218 | if (cpu_is_omap34xx()) | 181 | if (soc_is_omap34xx()) |
219 | omap_prcm_irq_prepare(); | 182 | omap_prcm_irq_prepare(); |
220 | return 0; | 183 | return 0; |
221 | } | 184 | } |
@@ -227,7 +190,7 @@ static void omap_pm_end(void) | |||
227 | 190 | ||
228 | static void omap_pm_finish(void) | 191 | static void omap_pm_finish(void) |
229 | { | 192 | { |
230 | if (cpu_is_omap34xx()) | 193 | if (soc_is_omap34xx()) |
231 | omap_prcm_irq_complete(); | 194 | omap_prcm_irq_complete(); |
232 | } | 195 | } |
233 | 196 | ||
@@ -252,7 +215,7 @@ void omap_common_suspend_init(void *pm_suspend) | |||
252 | 215 | ||
253 | static void __init omap3_init_voltages(void) | 216 | static void __init omap3_init_voltages(void) |
254 | { | 217 | { |
255 | if (!cpu_is_omap34xx()) | 218 | if (!soc_is_omap34xx()) |
256 | return; | 219 | return; |
257 | 220 | ||
258 | omap2_set_init_voltage("mpu_iva", "dpll1_ck", "mpu"); | 221 | omap2_set_init_voltage("mpu_iva", "dpll1_ck", "mpu"); |
@@ -261,7 +224,7 @@ static void __init omap3_init_voltages(void) | |||
261 | 224 | ||
262 | static void __init omap4_init_voltages(void) | 225 | static void __init omap4_init_voltages(void) |
263 | { | 226 | { |
264 | if (!cpu_is_omap44xx()) | 227 | if (!soc_is_omap44xx()) |
265 | return; | 228 | return; |
266 | 229 | ||
267 | omap2_set_init_voltage("mpu", "dpll_mpu_ck", "mpu"); | 230 | omap2_set_init_voltage("mpu", "dpll_mpu_ck", "mpu"); |
@@ -269,18 +232,8 @@ static void __init omap4_init_voltages(void) | |||
269 | omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva"); | 232 | omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva"); |
270 | } | 233 | } |
271 | 234 | ||
272 | static inline void omap_init_cpufreq(void) | ||
273 | { | ||
274 | struct platform_device_info devinfo = { .name = "omap-cpufreq" }; | ||
275 | |||
276 | if (!of_have_populated_dt()) | ||
277 | platform_device_register_full(&devinfo); | ||
278 | } | ||
279 | |||
280 | static int __init omap2_common_pm_init(void) | 235 | static int __init omap2_common_pm_init(void) |
281 | { | 236 | { |
282 | if (!of_have_populated_dt()) | ||
283 | omap2_init_processor_devices(); | ||
284 | omap_pm_if_init(); | 237 | omap_pm_if_init(); |
285 | 238 | ||
286 | return 0; | 239 | return 0; |
@@ -289,13 +242,9 @@ omap_postcore_initcall(omap2_common_pm_init); | |||
289 | 242 | ||
290 | int __init omap2_common_pm_late_init(void) | 243 | int __init omap2_common_pm_late_init(void) |
291 | { | 244 | { |
292 | if (of_have_populated_dt()) { | ||
293 | omap3_twl_init(); | ||
294 | omap4_twl_init(); | ||
295 | } | ||
296 | |||
297 | /* Init the voltage layer */ | 245 | /* Init the voltage layer */ |
298 | omap_pmic_late_init(); | 246 | omap3_twl_init(); |
247 | omap4_twl_init(); | ||
299 | omap_voltage_late_init(); | 248 | omap_voltage_late_init(); |
300 | 249 | ||
301 | /* Initialize the voltages */ | 250 | /* Initialize the voltages */ |
@@ -305,8 +254,5 @@ int __init omap2_common_pm_late_init(void) | |||
305 | /* Smartreflex device init */ | 254 | /* Smartreflex device init */ |
306 | omap_devinit_smartreflex(); | 255 | omap_devinit_smartreflex(); |
307 | 256 | ||
308 | /* cpufreq dummy device instantiation */ | ||
309 | omap_init_cpufreq(); | ||
310 | |||
311 | return 0; | 257 | return 0; |
312 | } | 258 | } |