diff options
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r-- | include/linux/suspend.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 5efe743ce1e8..8b6ec7ef0854 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -202,6 +202,36 @@ struct platform_freeze_ops { | |||
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 | 204 | ||
205 | extern unsigned int pm_suspend_global_flags; | ||
206 | |||
207 | #define PM_SUSPEND_FLAG_FW_SUSPEND (1 << 0) | ||
208 | #define PM_SUSPEND_FLAG_FW_RESUME (1 << 1) | ||
209 | |||
210 | static inline void pm_suspend_clear_flags(void) | ||
211 | { | ||
212 | pm_suspend_global_flags = 0; | ||
213 | } | ||
214 | |||
215 | static inline void pm_set_suspend_via_firmware(void) | ||
216 | { | ||
217 | pm_suspend_global_flags |= PM_SUSPEND_FLAG_FW_SUSPEND; | ||
218 | } | ||
219 | |||
220 | static inline void pm_set_resume_via_firmware(void) | ||
221 | { | ||
222 | pm_suspend_global_flags |= PM_SUSPEND_FLAG_FW_RESUME; | ||
223 | } | ||
224 | |||
225 | static inline bool pm_suspend_via_firmware(void) | ||
226 | { | ||
227 | return !!(pm_suspend_global_flags & PM_SUSPEND_FLAG_FW_SUSPEND); | ||
228 | } | ||
229 | |||
230 | static inline bool pm_resume_via_firmware(void) | ||
231 | { | ||
232 | return !!(pm_suspend_global_flags & PM_SUSPEND_FLAG_FW_RESUME); | ||
233 | } | ||
234 | |||
205 | /* Suspend-to-idle state machnine. */ | 235 | /* Suspend-to-idle state machnine. */ |
206 | enum freeze_state { | 236 | enum freeze_state { |
207 | FREEZE_STATE_NONE, /* Not suspended/suspending. */ | 237 | FREEZE_STATE_NONE, /* Not suspended/suspending. */ |
@@ -241,6 +271,12 @@ extern int pm_suspend(suspend_state_t state); | |||
241 | #else /* !CONFIG_SUSPEND */ | 271 | #else /* !CONFIG_SUSPEND */ |
242 | #define suspend_valid_only_mem NULL | 272 | #define suspend_valid_only_mem NULL |
243 | 273 | ||
274 | static inline void pm_suspend_clear_flags(void) {} | ||
275 | static inline void pm_set_suspend_via_firmware(void) {} | ||
276 | static inline void pm_set_resume_via_firmware(void) {} | ||
277 | static inline bool pm_suspend_via_firmware(void) { return false; } | ||
278 | static inline bool pm_resume_via_firmware(void) { return false; } | ||
279 | |||
244 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} | 280 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} |
245 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | 281 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } |
246 | static inline bool idle_should_freeze(void) { return false; } | 282 | static inline bool idle_should_freeze(void) { return false; } |
@@ -387,10 +423,12 @@ extern int unregister_pm_notifier(struct notifier_block *nb); | |||
387 | 423 | ||
388 | /* drivers/base/power/wakeup.c */ | 424 | /* drivers/base/power/wakeup.c */ |
389 | extern bool events_check_enabled; | 425 | extern bool events_check_enabled; |
426 | extern unsigned int pm_wakeup_irq; | ||
390 | 427 | ||
391 | extern bool pm_wakeup_pending(void); | 428 | extern bool pm_wakeup_pending(void); |
392 | extern void pm_system_wakeup(void); | 429 | extern void pm_system_wakeup(void); |
393 | extern void pm_wakeup_clear(void); | 430 | extern void pm_wakeup_clear(void); |
431 | extern void pm_system_irq_wakeup(unsigned int irq_number); | ||
394 | extern bool pm_get_wakeup_count(unsigned int *count, bool block); | 432 | extern bool pm_get_wakeup_count(unsigned int *count, bool block); |
395 | extern bool pm_save_wakeup_count(unsigned int count); | 433 | extern bool pm_save_wakeup_count(unsigned int count); |
396 | extern void pm_wakep_autosleep_enabled(bool set); | 434 | extern void pm_wakep_autosleep_enabled(bool set); |
@@ -440,6 +478,7 @@ static inline int unregister_pm_notifier(struct notifier_block *nb) | |||
440 | static inline bool pm_wakeup_pending(void) { return false; } | 478 | static inline bool pm_wakeup_pending(void) { return false; } |
441 | static inline void pm_system_wakeup(void) {} | 479 | static inline void pm_system_wakeup(void) {} |
442 | static inline void pm_wakeup_clear(void) {} | 480 | static inline void pm_wakeup_clear(void) {} |
481 | static inline void pm_system_irq_wakeup(unsigned int irq_number) {} | ||
443 | 482 | ||
444 | static inline void lock_system_sleep(void) {} | 483 | static inline void lock_system_sleep(void) {} |
445 | static inline void unlock_system_sleep(void) {} | 484 | static inline void unlock_system_sleep(void) {} |