Lines Matching full:rtc

8  * Date & Time support for the built-in Samsung S3C24X0 RTC
16 #include <rtc.h>
28 struct s3c24x0_rtc *rtc = s3c24x0_get_base_rtc(); in SetRTC_Access() local
32 writeb(readb(&rtc->rtccon) | 0x01, &rtc->rtccon); in SetRTC_Access()
36 writeb(readb(&rtc->rtccon) & ~0x01, &rtc->rtccon); in SetRTC_Access()
45 struct s3c24x0_rtc *rtc = s3c24x0_get_base_rtc(); in rtc_get() local
50 /* enable access to RTC registers */ in rtc_get()
53 /* read RTC registers */ in rtc_get()
55 sec = readb(&rtc->bcdsec); in rtc_get()
56 min = readb(&rtc->bcdmin); in rtc_get()
57 hour = readb(&rtc->bcdhour); in rtc_get()
58 mday = readb(&rtc->bcddate); in rtc_get()
59 wday = readb(&rtc->bcdday); in rtc_get()
60 mon = readb(&rtc->bcdmon); in rtc_get()
61 year = readb(&rtc->bcdyear); in rtc_get()
62 } while (sec != readb(&rtc->bcdsec)); in rtc_get()
65 a_sec = readb(&rtc->almsec); in rtc_get()
66 a_min = readb(&rtc->almmin); in rtc_get()
67 a_hour = readb(&rtc->almhour); in rtc_get()
68 a_date = readb(&rtc->almdate); in rtc_get()
69 a_mon = readb(&rtc->almmon); in rtc_get()
70 a_year = readb(&rtc->almyear); in rtc_get()
71 a_armed = readb(&rtc->rtcalm); in rtc_get()
73 /* disable access to RTC registers */ in rtc_get()
77 printf("Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x " in rtc_get()
109 struct s3c24x0_rtc *rtc = s3c24x0_get_base_rtc(); in rtc_set() local
125 /* enable access to RTC registers */ in rtc_set()
128 /* write RTC registers */ in rtc_set()
129 writeb(sec, &rtc->bcdsec); in rtc_set()
130 writeb(min, &rtc->bcdmin); in rtc_set()
131 writeb(hour, &rtc->bcdhour); in rtc_set()
132 writeb(mday, &rtc->bcddate); in rtc_set()
133 writeb(wday, &rtc->bcdday); in rtc_set()
134 writeb(mon, &rtc->bcdmon); in rtc_set()
135 writeb(year, &rtc->bcdyear); in rtc_set()
137 /* disable access to RTC registers */ in rtc_set()
145 struct s3c24x0_rtc *rtc = s3c24x0_get_base_rtc(); in rtc_reset() local
147 writeb((readb(&rtc->rtccon) & ~0x06) | 0x08, &rtc->rtccon); in rtc_reset()
148 writeb(readb(&rtc->rtccon) & ~(0x08 | 0x01), &rtc->rtccon); in rtc_reset()