summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authormattis fjallstrom <mattis@acm.org>2015-08-03 14:35:13 -0700
committermattis fjallstrom <mattis@acm.org>2015-08-03 14:35:13 -0700
commitb13b7246a4b40ab53ec22d33e935d25c8ee8d1fc (patch)
tree16ef157c39bf68ad01bec5270111b9e4051eac01 /kernel
parente419bb863c5df364265e5acab5f35eb7dc2d90db (diff)
downloadolio-linux-3.10-b13b7246a4b40ab53ec22d33e935d25c8ee8d1fc.tar.xz
olio-linux-3.10-b13b7246a4b40ab53ec22d33e935d25c8ee8d1fc.zip
Mindtribe latest accelerometer managementmindtribe_dev
Change-Id: Ia7d76c3c5f7807a37a0e26d5892c0826de8faa84
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/wakeup_reason.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/kernel/power/wakeup_reason.c b/kernel/power/wakeup_reason.c
index 9823d9ccde4..635ed61926c 100644
--- a/kernel/power/wakeup_reason.c
+++ b/kernel/power/wakeup_reason.c
@@ -63,6 +63,32 @@ static struct attribute_group attr_group = {
.attrs = attrs,
};
+
+
+int get_last_wakeup_reason()
+{
+ if(irq_count)
+ return irq_list[irq_count-1];
+ else
+ return -EINVAL;
+}
+
+int last_wakeup_reason_test(int reason)
+{
+ int irq_no;
+ unsigned long flags;
+ int ret = 0;
+ spin_lock_irqsave(&resume_reason_lock, flags);
+ for (irq_no = 0; irq_no < irq_count; irq_no++) {
+ if(reason == irq_list[irq_no]){
+ ret = 1;
+ break;
+ }
+ }
+ spin_unlock_irqrestore(&resume_reason_lock, flags);
+ return ret;
+}
+
/*
* logs all the wake up reasons to the kernel
* stores the irqs to expose them to the userspace via sysfs