diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-10-12 22:30:57 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-10-12 22:30:57 +0200 |
commit | a5e22db2689dc717cc3aaeb0c92c3f5445c5ea1f (patch) | |
tree | c8348f02c4e31c8130ad9b0ea3afa0f11a31dbcd /drivers/base | |
parent | 2cef548adf58e9a58a411948b98edb9a3980dbe6 (diff) | |
parent | 7236214c88454d96de7633e07a8314644d529f26 (diff) | |
download | op-kernel-dev-a5e22db2689dc717cc3aaeb0c92c3f5445c5ea1f.zip op-kernel-dev-a5e22db2689dc717cc3aaeb0c92c3f5445c5ea1f.tar.gz |
Merge back earlier 'pm-sleep' material for v4.4.
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/wakeup.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index 51f15bc..a1e0b9a 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -25,6 +25,9 @@ */ bool events_check_enabled __read_mostly; +/* First wakeup IRQ seen by the kernel in the last cycle. */ +unsigned int pm_wakeup_irq __read_mostly; + /* If set and the system is suspending, terminate the suspend. */ static bool pm_abort_suspend __read_mostly; @@ -91,7 +94,7 @@ struct wakeup_source *wakeup_source_create(const char *name) if (!ws) return NULL; - wakeup_source_prepare(ws, name ? kstrdup(name, GFP_KERNEL) : NULL); + wakeup_source_prepare(ws, name ? kstrdup_const(name, GFP_KERNEL) : NULL); return ws; } EXPORT_SYMBOL_GPL(wakeup_source_create); @@ -154,7 +157,7 @@ void wakeup_source_destroy(struct wakeup_source *ws) wakeup_source_drop(ws); wakeup_source_record(ws); - kfree(ws->name); + kfree_const(ws->name); kfree(ws); } EXPORT_SYMBOL_GPL(wakeup_source_destroy); @@ -868,6 +871,15 @@ EXPORT_SYMBOL_GPL(pm_system_wakeup); void pm_wakeup_clear(void) { pm_abort_suspend = false; + pm_wakeup_irq = 0; +} + +void pm_system_irq_wakeup(unsigned int irq_number) +{ + if (pm_wakeup_irq == 0) { + pm_wakeup_irq = irq_number; + pm_system_wakeup(); + } } /** |