Lines Matching refs:time
174 static int ds1305_get_time(struct device *dev, struct rtc_time *time) in ds1305_get_time() argument
192 time->tm_sec = bcd2bin(buf[DS1305_SEC]); in ds1305_get_time()
193 time->tm_min = bcd2bin(buf[DS1305_MIN]); in ds1305_get_time()
194 time->tm_hour = bcd2hour(buf[DS1305_HOUR]); in ds1305_get_time()
195 time->tm_wday = buf[DS1305_WDAY] - 1; in ds1305_get_time()
196 time->tm_mday = bcd2bin(buf[DS1305_MDAY]); in ds1305_get_time()
197 time->tm_mon = bcd2bin(buf[DS1305_MON]) - 1; in ds1305_get_time()
198 time->tm_year = bcd2bin(buf[DS1305_YEAR]) + 100; in ds1305_get_time()
202 "read", time->tm_sec, time->tm_min, in ds1305_get_time()
203 time->tm_hour, time->tm_mday, in ds1305_get_time()
204 time->tm_mon, time->tm_year, time->tm_wday); in ds1305_get_time()
209 static int ds1305_set_time(struct device *dev, struct rtc_time *time) in ds1305_set_time() argument
217 "write", time->tm_sec, time->tm_min, in ds1305_set_time()
218 time->tm_hour, time->tm_mday, in ds1305_set_time()
219 time->tm_mon, time->tm_year, time->tm_wday); in ds1305_set_time()
224 *bp++ = bin2bcd(time->tm_sec); in ds1305_set_time()
225 *bp++ = bin2bcd(time->tm_min); in ds1305_set_time()
226 *bp++ = hour2bcd(ds1305->hr12, time->tm_hour); in ds1305_set_time()
227 *bp++ = (time->tm_wday < 7) ? (time->tm_wday + 1) : 1; in ds1305_set_time()
228 *bp++ = bin2bcd(time->tm_mday); in ds1305_set_time()
229 *bp++ = bin2bcd(time->tm_mon + 1); in ds1305_set_time()
230 *bp++ = bin2bcd(time->tm_year - 100); in ds1305_set_time()
312 alm->time.tm_sec = bcd2bin(buf[DS1305_SEC]); in ds1305_get_alarm()
313 alm->time.tm_min = bcd2bin(buf[DS1305_MIN]); in ds1305_get_alarm()
314 alm->time.tm_hour = bcd2hour(buf[DS1305_HOUR]); in ds1305_get_alarm()
332 status = rtc_tm_to_time(&alm->time, &later); in ds1305_set_alarm()
363 buf[1 + DS1305_SEC] = bin2bcd(alm->time.tm_sec); in ds1305_set_alarm()
364 buf[1 + DS1305_MIN] = bin2bcd(alm->time.tm_min); in ds1305_set_alarm()
365 buf[1 + DS1305_HOUR] = hour2bcd(ds1305->hr12, alm->time.tm_hour); in ds1305_set_alarm()