diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/suspend.h | 25 | 
1 files changed, 25 insertions, 0 deletions
| diff --git a/include/linux/suspend.h b/include/linux/suspend.h index d4e3f16d5e8..9c26477f9d0 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -364,6 +364,31 @@ extern bool pm_get_wakeup_count(unsigned int *count, bool block);  extern bool pm_save_wakeup_count(unsigned int count);  extern void pm_wakep_autosleep_enabled(bool set); + +/** + * struct suspend_again_ops - suspend again support + * + * Any driver can register suspend_again_ops, + * so that they can respond to a suspend_again() check + * + * suspend_again() is registered at the platform level, so every platform must implement the register function + * + * @data_ptr: a pointer to data needed by the suspend again check + * + * @suspend_again_check: Function called by the platform suspend_again() function to check for suspend_again + */ +struct suspend_again_ops { +	void *data_ptr; +	bool (*suspend_again_check)(void *data); +}; + + +#ifdef CONFIG_PM_SUSPEND_AGAIN_OPS +extern void pm_register_suspend_again_ops(struct suspend_again_ops const *ops); +#else +static inline void pm_register_suspend_again_ops(struct suspend_again_ops const *ops) {} +#endif +  static inline void lock_system_sleep(void)  {  	current->flags |= PF_FREEZER_SKIP; |