2 * linux/arch/arm/mach-omap2/pm.c
4 * OMAP2 Power Management Routines
6 * Copyright (C) 2006 Nokia Corporation
7 * Tony Lindgren <tony@atomide.com>
9 * Copyright (C) 2005 Texas Instruments, Inc.
10 * Richard Woodruff <r-woodruff2@ti.com>
12 * Based on pm.c for omap1
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
19 #include <linux/suspend.h>
20 #include <linux/sched.h>
21 #include <linux/proc_fs.h>
22 #include <linux/interrupt.h>
23 #include <linux/sysfs.h>
24 #include <linux/module.h>
25 #include <linux/delay.h>
26 #include <linux/clk.h>
30 #include <asm/atomic.h>
31 #include <asm/mach/time.h>
32 #include <asm/mach/irq.h>
34 #include <mach/irqs.h>
35 #include <mach/clock.h>
36 #include <mach/sram.h>
39 static struct clk *vclk;
40 static void (*omap2_sram_idle)(void);
41 static void (*omap2_sram_suspend)(int dllctrl, int cpu_rev);
42 static void (*saved_idle)(void);
44 extern void __init pmdomain_init(void);
45 extern void pmdomain_set_autoidle(void);
47 static unsigned int omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_SIZE];
49 void omap2_pm_idle(void)
64 static int omap2_pm_prepare(void)
66 /* We cannot sleep in idle until we have resumed */
72 static int omap2_pm_suspend(void)
77 static int omap2_pm_enter(suspend_state_t state)
83 case PM_SUSPEND_STANDBY:
85 ret = omap2_pm_suspend();
94 static void omap2_pm_finish(void)
99 static struct platform_suspend_ops omap_pm_ops = {
100 .prepare = omap2_pm_prepare,
101 .enter = omap2_pm_enter,
102 .finish = omap2_pm_finish,
103 .valid = suspend_valid_only_mem,
106 static int __init omap2_pm_init(void)
111 __initcall(omap2_pm_init);