Commit 699bc661 authored by Markus Brunner's avatar Markus Brunner Committed by Paul Mundt

rtc: rtc-sh: Correct sh_rtc_set_time() for some SH-3 parts.

Some SH-3 parts (SH7720 and SH7705 at least) need to have the
start bit explicitly cleared, as the reset is not enough. This
is safe across all parts, so simply clear the start bit in
the sh_rtc_set_time() path.
Signed-off-by: default avatarMarkus Brunner <super.firetwister@gmail.com>
Signed-off by: Mark Jonas <toertel@gmail.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent d89ddd1c
...@@ -365,6 +365,7 @@ static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm) ...@@ -365,6 +365,7 @@ static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm)
/* Reset pre-scaler & stop RTC */ /* Reset pre-scaler & stop RTC */
tmp = readb(rtc->regbase + RCR2); tmp = readb(rtc->regbase + RCR2);
tmp |= RCR2_RESET; tmp |= RCR2_RESET;
tmp &= ~RCR2_START;
writeb(tmp, rtc->regbase + RCR2); writeb(tmp, rtc->regbase + RCR2);
writeb(BIN2BCD(tm->tm_sec), rtc->regbase + RSECCNT); writeb(BIN2BCD(tm->tm_sec), rtc->regbase + RSECCNT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment