aboutsummaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2014-11-21 16:52:51 +0000
committerMark Brown <broonie@kernel.org>2014-11-21 16:52:51 +0000
commiteea1d304821fd18cb12267287f57d453f0c65180 (patch)
treee433517899f35cd1a7773e69d9488dc3210f939c /kernel/power
parentbf2e434a0b4e8aafa7241fd5be4d43a4edcaa271 (diff)
parentfea95ac027c45088fea952455199bc6dba77a9eb (diff)
Merge remote-tracking branch 'lsk/v3.10/topic/aosp' into linux-linaro-lsk-android
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/wakeup_reason.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/kernel/power/wakeup_reason.c b/kernel/power/wakeup_reason.c
index 2aacc34ef17c..085c99edca06 100644
--- a/kernel/power/wakeup_reason.c
+++ b/kernel/power/wakeup_reason.c
@@ -34,7 +34,7 @@ static int irqcount;
static bool suspend_abort;
static char abort_reason[MAX_SUSPEND_ABORT_LEN];
static struct kobject *wakeup_reason;
-static spinlock_t resume_reason_lock;
+static DEFINE_SPINLOCK(resume_reason_lock);
static ssize_t last_resume_reason_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf)
@@ -95,6 +95,21 @@ void log_wakeup_reason(int irq)
spin_unlock(&resume_reason_lock);
}
+int check_wakeup_reason(int irq)
+{
+ int irq_no;
+ int ret = false;
+
+ spin_lock(&resume_reason_lock);
+ for (irq_no = 0; irq_no < irqcount; irq_no++)
+ if (irq_list[irq_no] == irq) {
+ ret = true;
+ break;
+ }
+ spin_unlock(&resume_reason_lock);
+ return ret;
+}
+
void log_suspend_abort_reason(const char *fmt, ...)
{
va_list args;
@@ -141,7 +156,7 @@ static struct notifier_block wakeup_reason_pm_notifier_block = {
int __init wakeup_reason_init(void)
{
int retval;
- spin_lock_init(&resume_reason_lock);
+
retval = register_pm_notifier(&wakeup_reason_pm_notifier_block);
if (retval)
printk(KERN_WARNING "[%s] failed to register PM notifier %d\n",