diff options
author | Rajendra Nayak <rnayak@ti.com> | 2011-08-19 18:59:39 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-08-19 18:59:39 -0400 |
commit | c956b753e706f24d18a026f8efa4df3b1919fcc9 (patch) | |
tree | 9af7a343aa85ccbfc1ea783d808b5f309f174239 /arch/arm/mach-omap2 | |
parent | 5ccc38740a283aba81a00e92941310d0c1aeb2ee (diff) |
OMAP: powerdomains: Make all powerdomain target states as ON at init
Program all powerdomain target state as ON; this is to prevent domains
from hitting low power states (if bootloader has target states set to
something other than ON) and potentially even losing context while PM
is not fully initialized, which can cause the system to crash. The PM
late init code can then program the desired target state for all the
power domains.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[paul@pwsan.com: dropped comment typo hunk; fixed comment indent and moved
to kerneldoc; moved code to pwrdm_init(); changed pwrdm_init() argument name
to prevent clash; cleaned up patch description]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 9af08473bf10..ef71fdd40fc4 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -195,28 +195,35 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused) | |||
195 | 195 | ||
196 | /** | 196 | /** |
197 | * pwrdm_init - set up the powerdomain layer | 197 | * pwrdm_init - set up the powerdomain layer |
198 | * @pwrdm_list: array of struct powerdomain pointers to register | 198 | * @pwrdms: array of struct powerdomain pointers to register |
199 | * @custom_funcs: func pointers for arch specific implementations | 199 | * @custom_funcs: func pointers for arch specific implementations |
200 | * | 200 | * |
201 | * Loop through the array of powerdomains @pwrdm_list, registering all | 201 | * Loop through the array of powerdomains @pwrdms, registering all |
202 | * that are available on the current CPU. If pwrdm_list is supplied | 202 | * that are available on the current CPU. Also, program all |
203 | * and not null, all of the referenced powerdomains will be | 203 | * powerdomain target state as ON; this is to prevent domains from |
204 | * registered. No return value. XXX pwrdm_list is not really a | 204 | * hitting low power states (if bootloader has target states set to |
205 | * "list"; it is an array. Rename appropriately. | 205 | * something other than ON) and potentially even losing context while |
206 | * PM is not fully initialized. The PM late init code can then program | ||
207 | * the desired target state for all the power domains. No return | ||
208 | * value. | ||
206 | */ | 209 | */ |
207 | void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs) | 210 | void pwrdm_init(struct powerdomain **pwrdms, struct pwrdm_ops *custom_funcs) |
208 | { | 211 | { |
209 | struct powerdomain **p = NULL; | 212 | struct powerdomain **p = NULL; |
213 | struct powerdomain *temp_p; | ||
210 | 214 | ||
211 | if (!custom_funcs) | 215 | if (!custom_funcs) |
212 | WARN(1, "powerdomain: No custom pwrdm functions registered\n"); | 216 | WARN(1, "powerdomain: No custom pwrdm functions registered\n"); |
213 | else | 217 | else |
214 | arch_pwrdm = custom_funcs; | 218 | arch_pwrdm = custom_funcs; |
215 | 219 | ||
216 | if (pwrdm_list) { | 220 | if (pwrdms) { |
217 | for (p = pwrdm_list; *p; p++) | 221 | for (p = pwrdms; *p; p++) |
218 | _pwrdm_register(*p); | 222 | _pwrdm_register(*p); |
219 | } | 223 | } |
224 | |||
225 | list_for_each_entry(temp_p, &pwrdm_list, node) | ||
226 | pwrdm_set_next_pwrst(temp_p, PWRDM_POWER_ON); | ||
220 | } | 227 | } |
221 | 228 | ||
222 | /** | 229 | /** |