aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r--include/linux/suspend.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 083ffea7ba18..6bbcef22e105 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -92,6 +92,13 @@ typedef int __bitwise suspend_state_t;
92 * @enter() and @wake(), even if any of them fails. It is executed after 92 * @enter() and @wake(), even if any of them fails. It is executed after
93 * a failing @prepare. 93 * a failing @prepare.
94 * 94 *
95 * @suspend_again: Returns whether the system should suspend again (true) or
96 * not (false). If the platform wants to poll sensors or execute some
97 * code during suspended without invoking userspace and most of devices,
98 * suspend_again callback is the place assuming that periodic-wakeup or
99 * alarm-wakeup is already setup. This allows to execute some codes while
100 * being kept suspended in the view of userland and devices.
101 *
95 * @end: Called by the PM core right after resuming devices, to indicate to 102 * @end: Called by the PM core right after resuming devices, to indicate to
96 * the platform that the system has returned to the working state or 103 * the platform that the system has returned to the working state or
97 * the transition to the sleep state has been aborted. 104 * the transition to the sleep state has been aborted.
@@ -113,6 +120,7 @@ struct platform_suspend_ops {
113 int (*enter)(suspend_state_t state); 120 int (*enter)(suspend_state_t state);
114 void (*wake)(void); 121 void (*wake)(void);
115 void (*finish)(void); 122 void (*finish)(void);
123 bool (*suspend_again)(void);
116 void (*end)(void); 124 void (*end)(void);
117 void (*recover)(void); 125 void (*recover)(void);
118}; 126};
@@ -260,6 +268,14 @@ static inline int hibernate(void) { return -ENOSYS; }
260static inline bool system_entering_hibernation(void) { return false; } 268static inline bool system_entering_hibernation(void) { return false; }
261#endif /* CONFIG_HIBERNATION */ 269#endif /* CONFIG_HIBERNATION */
262 270
271/* Hibernation and suspend events */
272#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
273#define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
274#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
275#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
276#define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */
277#define PM_POST_RESTORE 0x0006 /* Restore failed */
278
263#ifdef CONFIG_PM_SLEEP 279#ifdef CONFIG_PM_SLEEP
264void save_processor_state(void); 280void save_processor_state(void);
265void restore_processor_state(void); 281void restore_processor_state(void);