Lines Matching refs:tm
87 int rtc_get(struct rtc_time *tm) in rtc_get() argument
99 tm->tm_sec = bcd2bin(buf[CCR_SEC]); in rtc_get()
100 tm->tm_min = bcd2bin(buf[CCR_MIN]); in rtc_get()
101 tm->tm_hour = bcd2bin(buf[CCR_HOUR] & 0x3F); /* hr is 0-23 */ in rtc_get()
102 tm->tm_mday = bcd2bin(buf[CCR_MDAY]); in rtc_get()
103 tm->tm_mon = bcd2bin(buf[CCR_MONTH]); /* mon is 0-11 */ in rtc_get()
104 tm->tm_year = bcd2bin(buf[CCR_YEAR]) in rtc_get()
106 tm->tm_wday = buf[CCR_WDAY]; in rtc_get()
111 tm->tm_sec, tm->tm_min, tm->tm_hour, in rtc_get()
112 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); in rtc_get()
117 int rtc_set(struct rtc_time *tm) in rtc_set() argument
123 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in rtc_set()
124 tm->tm_hour, tm->tm_min, tm->tm_sec); in rtc_set()
126 buf[CCR_SEC] = bin2bcd(tm->tm_sec); in rtc_set()
127 buf[CCR_MIN] = bin2bcd(tm->tm_min); in rtc_set()
130 buf[CCR_HOUR] = bin2bcd(tm->tm_hour) | X1205_HR_MIL; in rtc_set()
132 buf[CCR_MDAY] = bin2bcd(tm->tm_mday); in rtc_set()
135 buf[CCR_MONTH] = bin2bcd(tm->tm_mon); in rtc_set()
138 buf[CCR_YEAR] = bin2bcd(tm->tm_year % 100); in rtc_set()
139 buf[CCR_WDAY] = tm->tm_wday & 0x07; in rtc_set()
140 buf[CCR_Y2K] = bin2bcd(tm->tm_year / 100); in rtc_set()