aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/pm.c')
-rw-r--r--arch/arm/mach-omap2/pm.c35
1 files changed, 7 insertions, 28 deletions
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 6f4a5436d0ce..baf7d82b458b 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -16,10 +16,9 @@
16 * published by the Free Software Foundation. 16 * published by the Free Software Foundation.
17 */ 17 */
18 18
19#include <linux/pm.h> 19#include <linux/suspend.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/proc_fs.h> 21#include <linux/proc_fs.h>
22#include <linux/pm.h>
23#include <linux/interrupt.h> 22#include <linux/interrupt.h>
24#include <linux/sysfs.h> 23#include <linux/sysfs.h>
25#include <linux/module.h> 24#include <linux/module.h>
@@ -71,28 +70,12 @@ void omap2_pm_idle(void)
71 local_irq_enable(); 70 local_irq_enable();
72} 71}
73 72
74static int omap2_pm_prepare(suspend_state_t state) 73static int omap2_pm_prepare(void)
75{ 74{
76 int error = 0;
77
78 /* We cannot sleep in idle until we have resumed */ 75 /* We cannot sleep in idle until we have resumed */
79 saved_idle = pm_idle; 76 saved_idle = pm_idle;
80 pm_idle = NULL; 77 pm_idle = NULL;
81 78 return 0;
82 switch (state)
83 {
84 case PM_SUSPEND_STANDBY:
85 case PM_SUSPEND_MEM:
86 break;
87
88 case PM_SUSPEND_DISK:
89 return -ENOTSUPP;
90
91 default:
92 return -EINVAL;
93 }
94
95 return error;
96} 79}
97 80
98#define INT0_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK1) | \ 81#define INT0_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK1) | \
@@ -353,9 +336,6 @@ static int omap2_pm_enter(suspend_state_t state)
353 case PM_SUSPEND_MEM: 336 case PM_SUSPEND_MEM:
354 ret = omap2_pm_suspend(); 337 ret = omap2_pm_suspend();
355 break; 338 break;
356 case PM_SUSPEND_DISK:
357 ret = -ENOTSUPP;
358 break;
359 default: 339 default:
360 ret = -EINVAL; 340 ret = -EINVAL;
361 } 341 }
@@ -363,17 +343,16 @@ static int omap2_pm_enter(suspend_state_t state)
363 return ret; 343 return ret;
364} 344}
365 345
366static int omap2_pm_finish(suspend_state_t state) 346static void omap2_pm_finish(void)
367{ 347{
368 pm_idle = saved_idle; 348 pm_idle = saved_idle;
369 return 0;
370} 349}
371 350
372static struct pm_ops omap_pm_ops = { 351static struct platform_suspend_ops omap_pm_ops = {
373 .prepare = omap2_pm_prepare, 352 .prepare = omap2_pm_prepare,
374 .enter = omap2_pm_enter, 353 .enter = omap2_pm_enter,
375 .finish = omap2_pm_finish, 354 .finish = omap2_pm_finish,
376 .valid = pm_valid_only_mem, 355 .valid = suspend_valid_only_mem,
377}; 356};
378 357
379int __init omap2_pm_init(void) 358int __init omap2_pm_init(void)
@@ -397,7 +376,7 @@ int __init omap2_pm_init(void)
397 omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend, 376 omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend,
398 omap24xx_cpu_suspend_sz); 377 omap24xx_cpu_suspend_sz);
399 378
400 pm_set_ops(&omap_pm_ops); 379 suspend_set_ops(&omap_pm_ops);
401 pm_idle = omap2_pm_idle; 380 pm_idle = omap2_pm_idle;
402 381
403 pmdomain_init(); 382 pmdomain_init();