Lines Matching refs:RX8010_SEC
17 #define RX8010_SEC 0x10 macro
110 u8 date[RX8010_YEAR - RX8010_SEC + 1]; in rx8010_get_time()
122 err = regmap_bulk_read(rx8010->regs, RX8010_SEC, date, sizeof(date)); in rx8010_get_time()
126 dt->tm_sec = bcd2bin(date[RX8010_SEC - RX8010_SEC] & 0x7f); in rx8010_get_time()
127 dt->tm_min = bcd2bin(date[RX8010_MIN - RX8010_SEC] & 0x7f); in rx8010_get_time()
128 dt->tm_hour = bcd2bin(date[RX8010_HOUR - RX8010_SEC] & 0x3f); in rx8010_get_time()
129 dt->tm_mday = bcd2bin(date[RX8010_MDAY - RX8010_SEC] & 0x3f); in rx8010_get_time()
130 dt->tm_mon = bcd2bin(date[RX8010_MONTH - RX8010_SEC] & 0x1f) - 1; in rx8010_get_time()
131 dt->tm_year = bcd2bin(date[RX8010_YEAR - RX8010_SEC]) + 100; in rx8010_get_time()
132 dt->tm_wday = ffs(date[RX8010_WDAY - RX8010_SEC] & 0x7f); in rx8010_get_time()
140 u8 date[RX8010_YEAR - RX8010_SEC + 1]; in rx8010_set_time()
148 date[RX8010_SEC - RX8010_SEC] = bin2bcd(dt->tm_sec); in rx8010_set_time()
149 date[RX8010_MIN - RX8010_SEC] = bin2bcd(dt->tm_min); in rx8010_set_time()
150 date[RX8010_HOUR - RX8010_SEC] = bin2bcd(dt->tm_hour); in rx8010_set_time()
151 date[RX8010_MDAY - RX8010_SEC] = bin2bcd(dt->tm_mday); in rx8010_set_time()
152 date[RX8010_MONTH - RX8010_SEC] = bin2bcd(dt->tm_mon + 1); in rx8010_set_time()
153 date[RX8010_YEAR - RX8010_SEC] = bin2bcd(dt->tm_year - 100); in rx8010_set_time()
154 date[RX8010_WDAY - RX8010_SEC] = bin2bcd(1 << dt->tm_wday); in rx8010_set_time()
156 err = regmap_bulk_write(rx8010->regs, RX8010_SEC, date, sizeof(date)); in rx8010_set_time()