0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/pm.h>
0009 #include <linux/suspend.h>
0010 #include <linux/module.h>
0011 #include <linux/err.h>
0012 #include <linux/cpu.h>
0013
0014 #include <asm/io.h>
0015 #include <asm/system_misc.h>
0016
0017 #include "common.h"
0018
0019 static int shmobile_suspend_default_enter(suspend_state_t suspend_state)
0020 {
0021 cpu_do_idle();
0022 return 0;
0023 }
0024
0025 static int shmobile_suspend_begin(suspend_state_t state)
0026 {
0027 cpu_idle_poll_ctrl(true);
0028 return 0;
0029 }
0030
0031 static void shmobile_suspend_end(void)
0032 {
0033 cpu_idle_poll_ctrl(false);
0034 }
0035
0036 struct platform_suspend_ops shmobile_suspend_ops = {
0037 .begin = shmobile_suspend_begin,
0038 .end = shmobile_suspend_end,
0039 .enter = shmobile_suspend_default_enter,
0040 .valid = suspend_valid_only_mem,
0041 };
0042
0043 int __init shmobile_suspend_init(void)
0044 {
0045 suspend_set_ops(&shmobile_suspend_ops);
0046 return 0;
0047 }