Lines Matching full:dt

179 static int rx8025_get_time(struct device *dev, struct rtc_time *dt)  in rx8025_get_time()  argument
195 dt->tm_sec = bcd2bin(date[RX8025_REG_SEC] & 0x7f); in rx8025_get_time()
196 dt->tm_min = bcd2bin(date[RX8025_REG_MIN] & 0x7f); in rx8025_get_time()
198 dt->tm_hour = bcd2bin(date[RX8025_REG_HOUR] & 0x3f); in rx8025_get_time()
200 dt->tm_hour = bcd2bin(date[RX8025_REG_HOUR] & 0x1f) % 12 in rx8025_get_time()
203 dt->tm_mday = bcd2bin(date[RX8025_REG_MDAY] & 0x3f); in rx8025_get_time()
204 dt->tm_mon = bcd2bin(date[RX8025_REG_MONTH] & 0x1f) - 1; in rx8025_get_time()
205 dt->tm_year = bcd2bin(date[RX8025_REG_YEAR]) + 100; in rx8025_get_time()
207 dev_dbg(dev, "%s: date %ptRr\n", __func__, dt); in rx8025_get_time()
212 static int rx8025_set_time(struct device *dev, struct rtc_time *dt) in rx8025_set_time() argument
218 if ((dt->tm_year < 100) || (dt->tm_year > 199)) in rx8025_set_time()
225 date[RX8025_REG_SEC] = bin2bcd(dt->tm_sec); in rx8025_set_time()
226 date[RX8025_REG_MIN] = bin2bcd(dt->tm_min); in rx8025_set_time()
228 date[RX8025_REG_HOUR] = bin2bcd(dt->tm_hour); in rx8025_set_time()
230 date[RX8025_REG_HOUR] = (dt->tm_hour >= 12 ? 0x20 : 0) in rx8025_set_time()
231 | bin2bcd((dt->tm_hour + 11) % 12 + 1); in rx8025_set_time()
233 date[RX8025_REG_WDAY] = bin2bcd(dt->tm_wday); in rx8025_set_time()
234 date[RX8025_REG_MDAY] = bin2bcd(dt->tm_mday); in rx8025_set_time()
235 date[RX8025_REG_MONTH] = bin2bcd(dt->tm_mon + 1); in rx8025_set_time()
236 date[RX8025_REG_YEAR] = bin2bcd(dt->tm_year - 100); in rx8025_set_time()