aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-03-10 10:37:02 +0000
committerMark Brown <broonie@kernel.org>2015-03-10 10:37:02 +0000
commiteb5bc2a213f96bd43b5f00a625acb0c669613645 (patch)
tree6093a86c9e704ebfed54adb426ff3079a428da93 /include/linux/suspend.h
parentASoC: rt5670: Check sysclk source by private data (diff)
parentLinux 4.0-rc3 (diff)
downloadlinux-dev-eb5bc2a213f96bd43b5f00a625acb0c669613645.tar.xz
linux-dev-eb5bc2a213f96bd43b5f00a625acb0c669613645.zip
Merge tag 'v4.0-rc3' into asoc-rt5670
Linux 4.0-rc3 Conflicts: sound/soc/codecs/rt5670.c
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 3388c1b6f7d8..5efe743ce1e8 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -201,6 +201,21 @@ struct platform_freeze_ops {
*/
extern void suspend_set_ops(const struct platform_suspend_ops *ops);
extern int suspend_valid_only_mem(suspend_state_t state);
+
+/* Suspend-to-idle state machnine. */
+enum freeze_state {
+ FREEZE_STATE_NONE, /* Not suspended/suspending. */
+ FREEZE_STATE_ENTER, /* Enter suspend-to-idle. */
+ FREEZE_STATE_WAKE, /* Wake up from suspend-to-idle. */
+};
+
+extern enum freeze_state __read_mostly suspend_freeze_state;
+
+static inline bool idle_should_freeze(void)
+{
+ return unlikely(suspend_freeze_state == FREEZE_STATE_ENTER);
+}
+
extern void freeze_set_ops(const struct platform_freeze_ops *ops);
extern void freeze_wake(void);
@@ -228,6 +243,7 @@ extern int pm_suspend(suspend_state_t state);
static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {}
static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
+static inline bool idle_should_freeze(void) { return false; }
static inline void freeze_set_ops(const struct platform_freeze_ops *ops) {}
static inline void freeze_wake(void) {}
#endif /* !CONFIG_SUSPEND */