* [PATCH v2] rtc: brcmstb-waketimer: Set wktmr prescaler
@ 2018-02-26 20:09 Justin Chen
2018-03-01 13:46 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Justin Chen @ 2018-02-26 20:09 UTC (permalink / raw)
To: linux-arm-kernel
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 <f.fainelli@gmail.com>
Signed-off-by: Justin Chen <justinpopo6@gmail.com>
---
drivers/rtc/rtc-brcmstb-waketimer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/rtc/rtc-brcmstb-waketimer.c b/drivers/rtc/rtc-brcmstb-waketimer.c
index 796ac79..231b2f7 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);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH v2] rtc: brcmstb-waketimer: Set wktmr prescaler
2018-02-26 20:09 [PATCH v2] rtc: brcmstb-waketimer: Set wktmr prescaler Justin Chen
@ 2018-03-01 13:46 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2018-03-01 13:46 UTC (permalink / raw)
To: linux-arm-kernel
On 26/02/2018 at 12:09:58 -0800, Justin Chen wrote:
> 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 <f.fainelli@gmail.com>
> Signed-off-by: Justin Chen <justinpopo6@gmail.com>
> ---
> drivers/rtc/rtc-brcmstb-waketimer.c | 3 +++
> 1 file changed, 3 insertions(+)
>
Applied, thanks.
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-01 13:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-26 20:09 [PATCH v2] rtc: brcmstb-waketimer: Set wktmr prescaler Justin Chen
2018-03-01 13:46 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).