From 58d3d5e79ece544b50829ac409064b58fec32000 Mon Sep 17 00:00:00 2001 From: Justin Chen Date: Mon, 26 Feb 2018 12:09:58 -0800 Subject: rtc: brcmstb-waketimer: Set wktmr prescaler The HW default is one tick per second, however instead of assuming this, lets make sure the waketimer is actually one tick per second before arming the alarm. Reviewed-by: Florian Fainelli Signed-off-by: Justin Chen Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-brcmstb-waketimer.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/rtc') diff --git a/drivers/rtc/rtc-brcmstb-waketimer.c b/drivers/rtc/rtc-brcmstb-waketimer.c index 6cee61201c30..bdd6674a1054 100644 --- a/drivers/rtc/rtc-brcmstb-waketimer.c +++ b/drivers/rtc/rtc-brcmstb-waketimer.c @@ -60,6 +60,9 @@ static void brcmstb_waketmr_set_alarm(struct brcmstb_waketmr *timer, { brcmstb_waketmr_clear_alarm(timer); + /* Make sure we are actually counting in seconds */ + writel_relaxed(timer->rate, timer->base + BRCMSTB_WKTMR_PRESCALER); + writel_relaxed(secs + 1, timer->base + BRCMSTB_WKTMR_ALARM); } -- cgit v1.2.3