diff options
Diffstat (limited to 'arch/arm/mach-omap2/pm.c')
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 49486f522dc..95eb863f780 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "powerdomain.h" | 23 | #include "powerdomain.h" |
24 | #include "clockdomain.h" | 24 | #include "clockdomain.h" |
25 | #include "pm.h" | 25 | #include "pm.h" |
26 | #include "twl-common.h" | ||
26 | 27 | ||
27 | static struct omap_device_pm_latency *pm_lats; | 28 | static struct omap_device_pm_latency *pm_lats; |
28 | 29 | ||
@@ -106,8 +107,9 @@ static void omap2_init_processor_devices(void) | |||
106 | int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | 107 | int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) |
107 | { | 108 | { |
108 | u32 cur_state; | 109 | u32 cur_state; |
109 | int sleep_switch = 0; | 110 | int sleep_switch = -1; |
110 | int ret = 0; | 111 | int ret = 0; |
112 | int hwsup = 0; | ||
111 | 113 | ||
112 | if (pwrdm == NULL || IS_ERR(pwrdm)) | 114 | if (pwrdm == NULL || IS_ERR(pwrdm)) |
113 | return -EINVAL; | 115 | return -EINVAL; |
@@ -127,8 +129,8 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | |||
127 | (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) { | 129 | (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) { |
128 | sleep_switch = LOWPOWERSTATE_SWITCH; | 130 | sleep_switch = LOWPOWERSTATE_SWITCH; |
129 | } else { | 131 | } else { |
132 | hwsup = clkdm_in_hwsup(pwrdm->pwrdm_clkdms[0]); | ||
130 | clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); | 133 | clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); |
131 | pwrdm_wait_transition(pwrdm); | ||
132 | sleep_switch = FORCEWAKEUP_SWITCH; | 134 | sleep_switch = FORCEWAKEUP_SWITCH; |
133 | } | 135 | } |
134 | } | 136 | } |
@@ -142,7 +144,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | |||
142 | 144 | ||
143 | switch (sleep_switch) { | 145 | switch (sleep_switch) { |
144 | case FORCEWAKEUP_SWITCH: | 146 | case FORCEWAKEUP_SWITCH: |
145 | if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO) | 147 | if (hwsup) |
146 | clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); | 148 | clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); |
147 | else | 149 | else |
148 | clkdm_sleep(pwrdm->pwrdm_clkdms[0]); | 150 | clkdm_sleep(pwrdm->pwrdm_clkdms[0]); |
@@ -154,7 +156,6 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | |||
154 | return ret; | 156 | return ret; |
155 | } | 157 | } |
156 | 158 | ||
157 | pwrdm_wait_transition(pwrdm); | ||
158 | pwrdm_state_switch(pwrdm); | 159 | pwrdm_state_switch(pwrdm); |
159 | err: | 160 | err: |
160 | return ret; | 161 | return ret; |
@@ -251,11 +252,8 @@ postcore_initcall(omap2_common_pm_init); | |||
251 | 252 | ||
252 | static int __init omap2_common_pm_late_init(void) | 253 | static int __init omap2_common_pm_late_init(void) |
253 | { | 254 | { |
254 | /* Init the OMAP TWL parameters */ | ||
255 | omap3_twl_init(); | ||
256 | omap4_twl_init(); | ||
257 | |||
258 | /* Init the voltage layer */ | 255 | /* Init the voltage layer */ |
256 | omap_pmic_late_init(); | ||
259 | omap_voltage_late_init(); | 257 | omap_voltage_late_init(); |
260 | 258 | ||
261 | /* Initialize the voltages */ | 259 | /* Initialize the voltages */ |