aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-10-12 16:30:57 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-10-12 16:30:57 -0400
commita5e22db2689dc717cc3aaeb0c92c3f5445c5ea1f (patch)
treec8348f02c4e31c8130ad9b0ea3afa0f11a31dbcd /drivers/base
parent2cef548adf58e9a58a411948b98edb9a3980dbe6 (diff)
parent7236214c88454d96de7633e07a8314644d529f26 (diff)
Merge back earlier 'pm-sleep' material for v4.4.
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/wakeup.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 51f15bc15774..a1e0b9ab847a 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -25,6 +25,9 @@
25 */ 25 */
26bool events_check_enabled __read_mostly; 26bool events_check_enabled __read_mostly;
27 27
28/* First wakeup IRQ seen by the kernel in the last cycle. */
29unsigned int pm_wakeup_irq __read_mostly;
30
28/* If set and the system is suspending, terminate the suspend. */ 31/* If set and the system is suspending, terminate the suspend. */
29static bool pm_abort_suspend __read_mostly; 32static bool pm_abort_suspend __read_mostly;
30 33
@@ -91,7 +94,7 @@ struct wakeup_source *wakeup_source_create(const char *name)
91 if (!ws) 94 if (!ws)
92 return NULL; 95 return NULL;
93 96
94 wakeup_source_prepare(ws, name ? kstrdup(name, GFP_KERNEL) : NULL); 97 wakeup_source_prepare(ws, name ? kstrdup_const(name, GFP_KERNEL) : NULL);
95 return ws; 98 return ws;
96} 99}
97EXPORT_SYMBOL_GPL(wakeup_source_create); 100EXPORT_SYMBOL_GPL(wakeup_source_create);
@@ -154,7 +157,7 @@ void wakeup_source_destroy(struct wakeup_source *ws)
154 157
155 wakeup_source_drop(ws); 158 wakeup_source_drop(ws);
156 wakeup_source_record(ws); 159 wakeup_source_record(ws);
157 kfree(ws->name); 160 kfree_const(ws->name);
158 kfree(ws); 161 kfree(ws);
159} 162}
160EXPORT_SYMBOL_GPL(wakeup_source_destroy); 163EXPORT_SYMBOL_GPL(wakeup_source_destroy);
@@ -868,6 +871,15 @@ EXPORT_SYMBOL_GPL(pm_system_wakeup);
868void pm_wakeup_clear(void) 871void pm_wakeup_clear(void)
869{ 872{
870 pm_abort_suspend = false; 873 pm_abort_suspend = false;
874 pm_wakeup_irq = 0;
875}
876
877void pm_system_irq_wakeup(unsigned int irq_number)
878{
879 if (pm_wakeup_irq == 0) {
880 pm_wakeup_irq = irq_number;
881 pm_system_wakeup();
882 }
871} 883}
872 884
873/** 885/**