diff options
| author | Evan Wilson <evan@oliodevices.com> | 2015-08-04 22:38:47 -0700 |
|---|---|---|
| committer | Evan Wilson <evan@oliodevices.com> | 2015-08-04 22:38:47 -0700 |
| commit | 818daae7bec16f8e5ed436f1bc79e79f30467e89 (patch) | |
| tree | 5a6c83bed4faead64d7990160df9854967214eb5 | |
| parent | 96c073888c2a35f6133b109b333cedec6da4910b (diff) | |
| download | olio-linux-3.10-818daae7bec16f8e5ed436f1bc79e79f30467e89.tar.xz olio-linux-3.10-818daae7bec16f8e5ed436f1bc79e79f30467e89.zip | |
olio: rtc-65910: Hold wakelock after rtc wakeup.
RTC interrupt wakes up the system, but android draws it back to
sleep. To give a chance for usersace to get chance to run applications
we take timeout wakelock for 2 seconds.
2 seconds is arbitrary value and we might want to reduce it.
Signed-off-by: Evan Wilson <evan@oliodevices.com>
Change-Id: Idb00a0913a965615ba46a512c490d1f12a87c327
| -rw-r--r-- | drivers/rtc/rtc-tps65910.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c index a9caf043b0c..cdbf1a2b251 100644 --- a/drivers/rtc/rtc-tps65910.c +++ b/drivers/rtc/rtc-tps65910.c @@ -25,6 +25,9 @@ #include <linux/pm_runtime.h> #include <linux/interrupt.h> #include <linux/mfd/tps65910.h> +#include <linux/wakelock.h> + +struct wake_lock rtc_wake_lock; struct tps65910_rtc { struct rtc_device *rtc; @@ -197,6 +200,7 @@ static irqreturn_t tps65910_rtc_interrupt(int irq, void *rtc) int ret; u32 rtc_reg; + wake_lock_timeout(&rtc_wake_lock, msecs_to_jiffies(2000)); ret = regmap_read(tps->regmap, TPS65910_RTC_STATUS, &rtc_reg); if (ret) return IRQ_NONE; @@ -285,6 +289,7 @@ static int tps65910_rtc_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, tps_rtc); + wake_lock_init(&rtc_wake_lock, WAKE_LOCK_SUSPEND, "rtc_wake_lock"); return 0; } |