Lines Matching refs:date
217 u8 date[7]; in rx8025_get_time() local
224 err = rx8025_read_regs(client, RX8025_REG_SEC, 7, date); in rx8025_get_time()
228 dev_dbg(dev, "%s: read %7ph\n", __func__, date); in rx8025_get_time()
230 dt->tm_sec = bcd2bin(date[RX8025_REG_SEC] & 0x7f); in rx8025_get_time()
231 dt->tm_min = bcd2bin(date[RX8025_REG_MIN] & 0x7f); in rx8025_get_time()
233 dt->tm_hour = bcd2bin(date[RX8025_REG_HOUR] & 0x3f); in rx8025_get_time()
235 dt->tm_hour = bcd2bin(date[RX8025_REG_HOUR] & 0x1f) % 12 in rx8025_get_time()
236 + (date[RX8025_REG_HOUR] & 0x20 ? 12 : 0); in rx8025_get_time()
238 dt->tm_mday = bcd2bin(date[RX8025_REG_MDAY] & 0x3f); in rx8025_get_time()
239 dt->tm_mon = bcd2bin(date[RX8025_REG_MONTH] & 0x1f) - 1; in rx8025_get_time()
240 dt->tm_year = bcd2bin(date[RX8025_REG_YEAR]) + 100; in rx8025_get_time()
251 u8 date[7]; in rx8025_set_time() local
258 date[RX8025_REG_SEC] = bin2bcd(dt->tm_sec); in rx8025_set_time()
259 date[RX8025_REG_MIN] = bin2bcd(dt->tm_min); in rx8025_set_time()
261 date[RX8025_REG_HOUR] = bin2bcd(dt->tm_hour); in rx8025_set_time()
263 date[RX8025_REG_HOUR] = (dt->tm_hour >= 12 ? 0x20 : 0) in rx8025_set_time()
266 date[RX8025_REG_WDAY] = bin2bcd(dt->tm_wday); in rx8025_set_time()
267 date[RX8025_REG_MDAY] = bin2bcd(dt->tm_mday); in rx8025_set_time()
268 date[RX8025_REG_MONTH] = bin2bcd(dt->tm_mon + 1); in rx8025_set_time()
269 date[RX8025_REG_YEAR] = bin2bcd(dt->tm_year - 100); in rx8025_set_time()
271 dev_dbg(dev, "%s: write %7ph\n", __func__, date); in rx8025_set_time()
273 ret = rx8025_write_regs(client, RX8025_REG_SEC, 7, date); in rx8025_set_time()