diff options
| author | Danny Baumann <dannybaumann@web.de> | 2018-07-26 13:56:58 +0200 |
|---|---|---|
| committer | Luca Stefani <luca.stefani.ge1@gmail.com> | 2018-08-19 18:31:12 +0200 |
| commit | 727d59b13ce84089a1bf1f82679204dcfc1c0320 (patch) | |
| tree | 82b45f078ecd01b447024d9b9843e036ab84755c | |
| parent | 2d9542138aab7cfd8a41c8063e7061cf810dd6b0 (diff) | |
rtc: qpnp: Adjust power-on alarm time.o8.1
The proprietary app sets power on time == alarm time, which our alarm
app doesn't like. Adjust the power on time so the device wakes a little
earlier, so it's booted up before the actual alarm time.
Change-Id: I17263954c8c9f6ba081925d28d269e8eed0a4c72
| -rw-r--r-- | drivers/rtc/qpnp-rtc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/rtc/qpnp-rtc.c b/drivers/rtc/qpnp-rtc.c index 4152086d2d6f..dc30ad1e0e2b 100644 --- a/drivers/rtc/qpnp-rtc.c +++ b/drivers/rtc/qpnp-rtc.c @@ -292,6 +292,15 @@ qpnp_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) rtc_tm_to_time(&alarm->time, &secs); /* + * Offset a power off alarm wakeup so the device actually wakes + * before the alarm is due. This should normally be done in user + * space, but the caller in that case is a proprietary app in the + * vendor partition. Oh well... + */ + if (!strcmp(current->comm, "alarm@1.0-servi")) + secs -= 60; + + /* * Read the current RTC time and verify if the alarm time is in the * past. If yes, return invalid */ |
