From 738d2a8feabb9dfce7595ad7db045d5442ac289c Mon Sep 17 00:00:00 2001 From: Mohit Aggarwal Date: Thu, 16 Feb 2017 14:29:20 +0530 Subject: alarmtimer: Program mpm wakeup time in milliseconds Currently, mpm wakeup time is programmed in seconds due to which there is a possibility that wakeup happens later than the expected time. This patch fixes the issue by programming the mpm wakeup time in milliseconds. CRs-Fixed: 2010001 Change-Id: I5c4905a0386e60ae54876f30d89f445fd06a161c Signed-off-by: Mohit Aggarwal --- kernel/time/alarmtimer.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'kernel') diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 0cdc34ebd8d1..2af5687b83c9 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -412,12 +412,10 @@ static int alarmtimer_suspend(struct device *dev) now = rtc_tm_to_ktime(tm); now = ktime_add(now, min); if (poweron_alarm) { - struct rtc_time tm_val; - unsigned long secs; + uint64_t msec = 0; - tm_val = rtc_ktime_to_tm(min); - rtc_tm_to_time(&tm_val, &secs); - lpm_suspend_wake_time(secs); + msec = ktime_to_ms(min); + lpm_suspend_wake_time(msec); } else { /* Set alarm, if in the past reject suspend briefly to handle */ ret = rtc_timer_start(rtc, &rtctimer, now, ktime_set(0, 0)); -- cgit v1.2.3