]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - rtc/s3c24x0_rtc.c
* Patch by David Müller, 13 Sep 2003:
[karo-tx-uboot.git] / rtc / s3c24x0_rtc.c
index bf8008d8da557defb3200ba08894a80dbf51ee20..9e2191e873cc781eac528e91dfe457b55d9c9306 100644 (file)
@@ -80,13 +80,15 @@ void rtc_get (struct rtc_time *tmp)
        SetRTC_Access(RTC_ENABLE);
 
        /* read RTC registers */
-       sec     = rtc->BCDSEC;
-       min     = rtc->BCDMIN;
-       hour    = rtc->BCDHOUR;
-       mday    = rtc->BCDDATE;
-       wday    = rtc->BCDDAY;
-       mon     = rtc->BCDMON;
-       year    = rtc->BCDYEAR;
+       do {
+               sec     = rtc->BCDSEC;
+               min     = rtc->BCDMIN;
+               hour    = rtc->BCDHOUR;
+               mday    = rtc->BCDDATE;
+               wday    = rtc->BCDDAY;
+               mon     = rtc->BCDMON;
+               year    = rtc->BCDYEAR;
+       } while (sec != rtc->BCDSEC);
 
        /* read ALARM registers */
        a_sec   = rtc->ALMSEC;
@@ -170,7 +172,7 @@ void rtc_reset (void)
        S3C24X0_RTC * const rtc = S3C24X0_GetBase_RTC();
 
        rtc->RTCCON = (rtc->RTCCON & ~0x06) | 0x08;
-       rtc->RTCCON &= ~0x08;
+       rtc->RTCCON &= ~(0x08|0x01);
 }
 
 /* ------------------------------------------------------------------------- */