22 #include <linux/sched.h>
26 #include <linux/module.h>
30 #include <linux/time.h>
37 #include <asm/system_misc.h>
39 #include <plat/clock.h>
54 static void (*omap2_sram_idle)(
void);
55 static void (*omap2_sram_suspend)(
u32 dllctrl,
void __iomem *sdrc_dlla_ctrl,
59 static struct clockdomain *dsp_clkdm, *mpu_clkdm, *wkup_clkdm, *gfx_clkdm;
61 static struct clk *osc_ck, *emul_ck;
63 static int omap2_fclks_active(
void)
70 return (f1 | f2) ? 1 : 0;
73 static int omap2_enter_full_retention(
void)
140 static int omap2_i2c_active(
void)
148 static int sti_console_enabled;
150 static int omap2_allow_mpu_retention(
void)
164 if (sti_console_enabled)
170 static void omap2_enter_mpu_retention(
void)
174 if (omap2_i2c_active())
179 if (omap2_allow_mpu_retention()) {
199 static int omap2_can_sleep(
void)
201 if (omap2_fclks_active())
211 static void omap2_pm_idle(
void)
215 if (!omap2_can_sleep()) {
218 omap2_enter_mpu_retention();
225 omap2_enter_full_retention();
231 static void __init prcm_setup_regs(
void)
233 int i, num_mem_banks;
248 for (i = 0; i < num_mem_banks; i++)
275 #ifdef CONFIG_SUSPEND
311 pr_err(
"PM: mpu_pwrdm not found\n");
315 pr_err(
"PM: core_pwrdm not found\n");
321 pr_err(
"PM: mpu_clkdm not found\n");
325 pr_err(
"PM: wkup_clkdm not found\n");
329 pr_err(
"PM: dsp_clkdm not found\n");
333 pr_err(
"PM: gfx_clkdm not found\n");
337 if (IS_ERR(osc_ck)) {
344 if (IS_ERR(emul_ck)) {