OMAP3: PM: CPUidle: fix init sequencing

Previously omap3_idle_init() was called in device_init, while
omap_pm_init() is called at late_initcall. This causes the cpu idle
driver to call omap_sram_idle before it is properly initialized. This
patch fixes the issue by moving omap3_idle_init into omap3_pm_init.

Signed-off-by: Kalle Jokiniemi <ext-kalle.jokiniemi@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
This commit is contained in:
Kalle Jokiniemi 2008-09-26 11:04:20 +03:00 committed by Kevin Hilman
parent 0f724ed92b
commit 0343371e22
3 changed files with 8 additions and 4 deletions

View File

@ -227,7 +227,7 @@ struct cpuidle_driver omap3_idle_driver = {
* Registers the OMAP3 specific cpuidle driver with the cpuidle
* framework with the valid set of states.
*/
int omap3_idle_init(void)
int __init omap3_idle_init(void)
{
int i, count = 0;
struct omap3_processor_cx *cx;
@ -272,5 +272,9 @@ int omap3_idle_init(void)
return 0;
}
device_initcall(omap3_idle_init);
#else
int __init omap3_idle_init(void)
{
return 0;
}
#endif /* CONFIG_CPU_IDLE */

View File

@ -21,6 +21,7 @@ extern void omap3_pm_off_mode_enable(int);
extern void omap_sram_idle(void);
extern int omap3_can_sleep(void);
extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
extern int omap3_idle_init(void);
extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);

View File

@ -1099,9 +1099,8 @@ static int __init omap3_pm_init(void)
suspend_set_ops(&omap_pm_ops);
#endif /* CONFIG_SUSPEND */
#ifndef CONFIG_CPU_IDLE
pm_idle = omap3_pm_idle;
#endif
omap3_idle_init();
pwrdm_add_wkdep(neon_pwrdm, mpu_pwrdm);
/*