aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r--include/linux/pm.h47
1 files changed, 3 insertions, 44 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 015b735811b4..39a7ee859b67 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -21,8 +21,6 @@
21#ifndef _LINUX_PM_H 21#ifndef _LINUX_PM_H
22#define _LINUX_PM_H 22#define _LINUX_PM_H
23 23
24#ifdef __KERNEL__
25
26#include <linux/list.h> 24#include <linux/list.h>
27#include <asm/atomic.h> 25#include <asm/atomic.h>
28#include <asm/errno.h> 26#include <asm/errno.h>
@@ -183,8 +181,9 @@ typedef struct pm_message {
183struct dev_pm_info { 181struct dev_pm_info {
184 pm_message_t power_state; 182 pm_message_t power_state;
185 unsigned can_wakeup:1; 183 unsigned can_wakeup:1;
186#ifdef CONFIG_PM_SLEEP
187 unsigned should_wakeup:1; 184 unsigned should_wakeup:1;
185 bool sleeping:1; /* Owned by the PM core */
186#ifdef CONFIG_PM_SLEEP
188 struct list_head entry; 187 struct list_head entry;
189#endif 188#endif
190}; 189};
@@ -197,11 +196,6 @@ extern void device_resume(void);
197extern int device_suspend(pm_message_t state); 196extern int device_suspend(pm_message_t state);
198extern int device_prepare_suspend(pm_message_t state); 197extern int device_prepare_suspend(pm_message_t state);
199 198
200#define device_set_wakeup_enable(dev,val) \
201 ((dev)->power.should_wakeup = !!(val))
202#define device_may_wakeup(dev) \
203 (device_can_wakeup(dev) && (dev)->power.should_wakeup)
204
205extern void __suspend_report_result(const char *function, void *fn, int ret); 199extern void __suspend_report_result(const char *function, void *fn, int ret);
206 200
207#define suspend_report_result(fn, ret) \ 201#define suspend_report_result(fn, ret) \
@@ -209,20 +203,6 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
209 __suspend_report_result(__FUNCTION__, fn, ret); \ 203 __suspend_report_result(__FUNCTION__, fn, ret); \
210 } while (0) 204 } while (0)
211 205
212/*
213 * Platform hook to activate device wakeup capability, if that's not already
214 * handled by enable_irq_wake() etc.
215 * Returns zero on success, else negative errno
216 */
217extern int (*platform_enable_wakeup)(struct device *dev, int is_on);
218
219static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
220{
221 if (platform_enable_wakeup)
222 return (*platform_enable_wakeup)(dev, is_on);
223 return 0;
224}
225
226#else /* !CONFIG_PM_SLEEP */ 206#else /* !CONFIG_PM_SLEEP */
227 207
228static inline int device_suspend(pm_message_t state) 208static inline int device_suspend(pm_message_t state)
@@ -230,29 +210,10 @@ static inline int device_suspend(pm_message_t state)
230 return 0; 210 return 0;
231} 211}
232 212
233#define device_set_wakeup_enable(dev,val) do{}while(0) 213#define suspend_report_result(fn, ret) do {} while (0)
234#define device_may_wakeup(dev) (0)
235
236#define suspend_report_result(fn, ret) do { } while (0)
237
238static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
239{
240 return 0;
241}
242 214
243#endif /* !CONFIG_PM_SLEEP */ 215#endif /* !CONFIG_PM_SLEEP */
244 216
245/* changes to device_may_wakeup take effect on the next pm state change.
246 * by default, devices should wakeup if they can.
247 */
248#define device_can_wakeup(dev) \
249 ((dev)->power.can_wakeup)
250#define device_init_wakeup(dev,val) \
251 do { \
252 device_can_wakeup(dev) = !!(val); \
253 device_set_wakeup_enable(dev,val); \
254 } while(0)
255
256/* 217/*
257 * Global Power Management flags 218 * Global Power Management flags
258 * Used to keep APM and ACPI from both being active 219 * Used to keep APM and ACPI from both being active
@@ -262,6 +223,4 @@ extern unsigned int pm_flags;
262#define PM_APM 1 223#define PM_APM 1
263#define PM_ACPI 2 224#define PM_ACPI 2
264 225
265#endif /* __KERNEL__ */
266
267#endif /* _LINUX_PM_H */ 226#endif /* _LINUX_PM_H */