Lines Matching refs:time
170 static int ds1305_get_time(struct device *dev, struct rtc_time *time) in ds1305_get_time() argument
188 time->tm_sec = bcd2bin(buf[DS1305_SEC]); in ds1305_get_time()
189 time->tm_min = bcd2bin(buf[DS1305_MIN]); in ds1305_get_time()
190 time->tm_hour = bcd2hour(buf[DS1305_HOUR]); in ds1305_get_time()
191 time->tm_wday = buf[DS1305_WDAY] - 1; in ds1305_get_time()
192 time->tm_mday = bcd2bin(buf[DS1305_MDAY]); in ds1305_get_time()
193 time->tm_mon = bcd2bin(buf[DS1305_MON]) - 1; in ds1305_get_time()
194 time->tm_year = bcd2bin(buf[DS1305_YEAR]) + 100; in ds1305_get_time()
198 "read", time->tm_sec, time->tm_min, in ds1305_get_time()
199 time->tm_hour, time->tm_mday, in ds1305_get_time()
200 time->tm_mon, time->tm_year, time->tm_wday); in ds1305_get_time()
205 static int ds1305_set_time(struct device *dev, struct rtc_time *time) in ds1305_set_time() argument
213 "write", time->tm_sec, time->tm_min, in ds1305_set_time()
214 time->tm_hour, time->tm_mday, in ds1305_set_time()
215 time->tm_mon, time->tm_year, time->tm_wday); in ds1305_set_time()
220 *bp++ = bin2bcd(time->tm_sec); in ds1305_set_time()
221 *bp++ = bin2bcd(time->tm_min); in ds1305_set_time()
222 *bp++ = hour2bcd(ds1305->hr12, time->tm_hour); in ds1305_set_time()
223 *bp++ = (time->tm_wday < 7) ? (time->tm_wday + 1) : 1; in ds1305_set_time()
224 *bp++ = bin2bcd(time->tm_mday); in ds1305_set_time()
225 *bp++ = bin2bcd(time->tm_mon + 1); in ds1305_set_time()
226 *bp++ = bin2bcd(time->tm_year - 100); in ds1305_set_time()
308 alm->time.tm_sec = bcd2bin(buf[DS1305_SEC]); in ds1305_get_alarm()
309 alm->time.tm_min = bcd2bin(buf[DS1305_MIN]); in ds1305_get_alarm()
310 alm->time.tm_hour = bcd2hour(buf[DS1305_HOUR]); in ds1305_get_alarm()
328 later = rtc_tm_to_time64(&alm->time); in ds1305_set_alarm()
355 buf[1 + DS1305_SEC] = bin2bcd(alm->time.tm_sec); in ds1305_set_alarm()
356 buf[1 + DS1305_MIN] = bin2bcd(alm->time.tm_min); in ds1305_set_alarm()
357 buf[1 + DS1305_HOUR] = hour2bcd(ds1305->hr12, alm->time.tm_hour); in ds1305_set_alarm()