From 07957bd97bf8ac4b079f3bb56f80a0ef534fb743 Mon Sep 17 00:00:00 2001 From: sravanM Date: Thu, 11 Feb 2016 10:49:06 -0800 Subject: adding in suspend_again --- include/linux/suspend.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include/linux/suspend.h') 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; -- cgit v1.2.3-70-g09d2