diff options
| author | sravan <sravan@mindtribe.com> | 2015-07-27 19:53:23 -0700 |
|---|---|---|
| committer | Evan Wilson <evan@oliodevices.com> | 2015-08-07 12:53:29 -0700 |
| commit | 520faa59b2288d97379977b7863a7b3543ad2438 (patch) | |
| tree | a5dc551fc9b9fa2d23a978efb766d87a1a12926c /kernel | |
| parent | fb2a8e4a7820040a7968731cf679c5a8e13cd17b (diff) | |
| download | olio-linux-3.10-520faa59b2288d97379977b7863a7b3543ad2438.tar.xz olio-linux-3.10-520faa59b2288d97379977b7863a7b3543ad2438.zip | |
Checking the wakeup reason to get around the ST IMU not latching tap interrupts
Signed-off-by: Evan Wilson <evan@oliodevices.com>
Change-Id: Iebe64b4c5de646f408fff0431d17d79ea9692e1f
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/power/wakeup_reason.c | 26 |
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 |