diff options
Diffstat (limited to 'arch/blackfin/mach-common')
-rw-r--r-- | arch/blackfin/mach-common/pm.c | 59 |
1 files changed, 8 insertions, 51 deletions
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c index b10302722202..dac51fb06f22 100644 --- a/arch/blackfin/mach-common/pm.c +++ b/arch/blackfin/mach-common/pm.c | |||
@@ -32,7 +32,7 @@ | |||
32 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 32 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include <linux/pm.h> | 35 | #include <linux/suspend.h> |
36 | #include <linux/sched.h> | 36 | #include <linux/sched.h> |
37 | #include <linux/proc_fs.h> | 37 | #include <linux/proc_fs.h> |
38 | #include <linux/io.h> | 38 | #include <linux/io.h> |
@@ -89,28 +89,15 @@ void bfin_pm_suspend_standby_enter(void) | |||
89 | #endif /* CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR */ | 89 | #endif /* CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR */ |
90 | } | 90 | } |
91 | 91 | ||
92 | |||
93 | /* | 92 | /* |
94 | * bfin_pm_prepare - Do preliminary suspend work. | 93 | * bfin_pm_valid - Tell the PM core that we only support the standby sleep |
95 | * @state: suspend state we're entering. | 94 | * state |
95 | * @state: suspend state we're checking. | ||
96 | * | 96 | * |
97 | */ | 97 | */ |
98 | static int bfin_pm_prepare(suspend_state_t state) | 98 | static int bfin_pm_valid(suspend_state_t state) |
99 | { | 99 | { |
100 | int error = 0; | 100 | return (state == PM_SUSPEND_STANDBY); |
101 | |||
102 | switch (state) { | ||
103 | case PM_SUSPEND_STANDBY: | ||
104 | break; | ||
105 | |||
106 | case PM_SUSPEND_MEM: | ||
107 | return -ENOTSUPP; | ||
108 | |||
109 | default: | ||
110 | return -EINVAL; | ||
111 | } | ||
112 | |||
113 | return error; | ||
114 | } | 101 | } |
115 | 102 | ||
116 | /* | 103 | /* |
@@ -135,44 +122,14 @@ static int bfin_pm_enter(suspend_state_t state) | |||
135 | return 0; | 122 | return 0; |
136 | } | 123 | } |
137 | 124 | ||
138 | /* | 125 | struct platform_suspend_ops bfin_pm_ops = { |
139 | * bfin_pm_finish - Finish up suspend sequence. | ||
140 | * @state: State we're coming out of. | ||
141 | * | ||
142 | * This is called after we wake back up (or if entering the sleep state | ||
143 | * failed). | ||
144 | */ | ||
145 | static int bfin_pm_finish(suspend_state_t state) | ||
146 | { | ||
147 | switch (state) { | ||
148 | case PM_SUSPEND_STANDBY: | ||
149 | break; | ||
150 | |||
151 | case PM_SUSPEND_MEM: | ||
152 | return -ENOTSUPP; | ||
153 | |||
154 | default: | ||
155 | return -EINVAL; | ||
156 | } | ||
157 | |||
158 | return 0; | ||
159 | } | ||
160 | |||
161 | static int bfin_pm_valid(suspend_state_t state) | ||
162 | { | ||
163 | return (state == PM_SUSPEND_STANDBY); | ||
164 | } | ||
165 | |||
166 | struct pm_ops bfin_pm_ops = { | ||
167 | .prepare = bfin_pm_prepare, | ||
168 | .enter = bfin_pm_enter, | 126 | .enter = bfin_pm_enter, |
169 | .finish = bfin_pm_finish, | ||
170 | .valid = bfin_pm_valid, | 127 | .valid = bfin_pm_valid, |
171 | }; | 128 | }; |
172 | 129 | ||
173 | static int __init bfin_pm_init(void) | 130 | static int __init bfin_pm_init(void) |
174 | { | 131 | { |
175 | pm_set_ops(&bfin_pm_ops); | 132 | suspend_set_ops(&bfin_pm_ops); |
176 | return 0; | 133 | return 0; |
177 | } | 134 | } |
178 | 135 | ||