aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/power/wakeup.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 96ffdb24b..ea313db99 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -42,6 +42,10 @@ int wakeup_debug = 0;
* if wakeup events are registered during or immediately before the transition.
*/
bool events_check_enabled __read_mostly;
+
+/* If set and the system is suspending, terminate the suspend. */
+static bool pm_abort_suspend __read_mostly;
+
EXPORT_SYMBOL_GPL(events_check_enabled);
/*
@@ -796,7 +800,18 @@ bool pm_wakeup_pending(void)
if (ret)
print_active_wakeup_sources();
- return ret;
+ return ret || pm_abort_suspend;
+}
+
+void pm_system_wakeup(void)
+{
+ pm_abort_suspend = true;
+ freeze_wake();
+}
+
+void pm_wakeup_clear(void)
+{
+ pm_abort_suspend = false;
}
EXPORT_SYMBOL_GPL(pm_wakeup_pending);