diff options
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r-- | include/linux/suspend.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 3388c1b6f7d8..5efe743ce1e8 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -201,6 +201,21 @@ struct platform_freeze_ops { | |||
201 | */ | 201 | */ |
202 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); | 202 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); |
203 | extern int suspend_valid_only_mem(suspend_state_t state); | 203 | extern int suspend_valid_only_mem(suspend_state_t state); |
204 | |||
205 | /* Suspend-to-idle state machnine. */ | ||
206 | enum freeze_state { | ||
207 | FREEZE_STATE_NONE, /* Not suspended/suspending. */ | ||
208 | FREEZE_STATE_ENTER, /* Enter suspend-to-idle. */ | ||
209 | FREEZE_STATE_WAKE, /* Wake up from suspend-to-idle. */ | ||
210 | }; | ||
211 | |||
212 | extern enum freeze_state __read_mostly suspend_freeze_state; | ||
213 | |||
214 | static inline bool idle_should_freeze(void) | ||
215 | { | ||
216 | return unlikely(suspend_freeze_state == FREEZE_STATE_ENTER); | ||
217 | } | ||
218 | |||
204 | extern void freeze_set_ops(const struct platform_freeze_ops *ops); | 219 | extern void freeze_set_ops(const struct platform_freeze_ops *ops); |
205 | extern void freeze_wake(void); | 220 | extern void freeze_wake(void); |
206 | 221 | ||
@@ -228,6 +243,7 @@ extern int pm_suspend(suspend_state_t state); | |||
228 | 243 | ||
229 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} | 244 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} |
230 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | 245 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } |
246 | static inline bool idle_should_freeze(void) { return false; } | ||
231 | static inline void freeze_set_ops(const struct platform_freeze_ops *ops) {} | 247 | static inline void freeze_set_ops(const struct platform_freeze_ops *ops) {} |
232 | static inline void freeze_wake(void) {} | 248 | static inline void freeze_wake(void) {} |
233 | #endif /* !CONFIG_SUSPEND */ | 249 | #endif /* !CONFIG_SUSPEND */ |