Lines Matching refs:tm
89 int rtc_get(struct rtc_time *tm) in rtc_get() argument
101 tm->tm_sec = bcd2bin(buf[CCR_SEC]); in rtc_get()
102 tm->tm_min = bcd2bin(buf[CCR_MIN]); in rtc_get()
103 tm->tm_hour = bcd2bin(buf[CCR_HOUR] & 0x3F); /* hr is 0-23 */ in rtc_get()
104 tm->tm_mday = bcd2bin(buf[CCR_MDAY]); in rtc_get()
105 tm->tm_mon = bcd2bin(buf[CCR_MONTH]); /* mon is 0-11 */ in rtc_get()
106 tm->tm_year = bcd2bin(buf[CCR_YEAR]) in rtc_get()
108 tm->tm_wday = buf[CCR_WDAY]; in rtc_get()
113 tm->tm_sec, tm->tm_min, tm->tm_hour, in rtc_get()
114 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); in rtc_get()
119 int rtc_set(struct rtc_time *tm) in rtc_set() argument
125 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in rtc_set()
126 tm->tm_hour, tm->tm_min, tm->tm_sec); in rtc_set()
128 buf[CCR_SEC] = bin2bcd(tm->tm_sec); in rtc_set()
129 buf[CCR_MIN] = bin2bcd(tm->tm_min); in rtc_set()
132 buf[CCR_HOUR] = bin2bcd(tm->tm_hour) | X1205_HR_MIL; in rtc_set()
134 buf[CCR_MDAY] = bin2bcd(tm->tm_mday); in rtc_set()
137 buf[CCR_MONTH] = bin2bcd(tm->tm_mon); in rtc_set()
140 buf[CCR_YEAR] = bin2bcd(tm->tm_year % 100); in rtc_set()
141 buf[CCR_WDAY] = tm->tm_wday & 0x07; in rtc_set()
142 buf[CCR_Y2K] = bin2bcd(tm->tm_year / 100); in rtc_set()