Lines Matching refs:date
181 u8 date[7]; in rx8025_get_time() local
188 err = rx8025_read_regs(rx8025->client, RX8025_REG_SEC, 7, date); in rx8025_get_time()
194 date[0], date[1], date[2], date[3], date[4], in rx8025_get_time()
195 date[5], date[6]); in rx8025_get_time()
197 dt->tm_sec = bcd2bin(date[RX8025_REG_SEC] & 0x7f); in rx8025_get_time()
198 dt->tm_min = bcd2bin(date[RX8025_REG_MIN] & 0x7f); in rx8025_get_time()
200 dt->tm_hour = bcd2bin(date[RX8025_REG_HOUR] & 0x3f); in rx8025_get_time()
202 dt->tm_hour = bcd2bin(date[RX8025_REG_HOUR] & 0x1f) % 12 in rx8025_get_time()
203 + (date[RX8025_REG_HOUR] & 0x20 ? 12 : 0); in rx8025_get_time()
205 dt->tm_mday = bcd2bin(date[RX8025_REG_MDAY] & 0x3f); in rx8025_get_time()
206 dt->tm_mon = bcd2bin(date[RX8025_REG_MONTH] & 0x1f) - 1; in rx8025_get_time()
207 dt->tm_year = bcd2bin(date[RX8025_REG_YEAR]) + 100; in rx8025_get_time()
219 u8 date[7]; in rx8025_set_time() local
229 date[RX8025_REG_SEC] = bin2bcd(dt->tm_sec); in rx8025_set_time()
230 date[RX8025_REG_MIN] = bin2bcd(dt->tm_min); in rx8025_set_time()
232 date[RX8025_REG_HOUR] = bin2bcd(dt->tm_hour); in rx8025_set_time()
234 date[RX8025_REG_HOUR] = (dt->tm_hour >= 12 ? 0x20 : 0) in rx8025_set_time()
237 date[RX8025_REG_WDAY] = bin2bcd(dt->tm_wday); in rx8025_set_time()
238 date[RX8025_REG_MDAY] = bin2bcd(dt->tm_mday); in rx8025_set_time()
239 date[RX8025_REG_MONTH] = bin2bcd(dt->tm_mon + 1); in rx8025_set_time()
240 date[RX8025_REG_YEAR] = bin2bcd(dt->tm_year - 100); in rx8025_set_time()
245 date[0], date[1], date[2], date[3], date[4], date[5], date[6]); in rx8025_set_time()
247 ret = rx8025_write_regs(rx8025->client, RX8025_REG_SEC, 7, date); in rx8025_set_time()