Lines Matching refs:dt
130 static int ds1390_read_time(struct device *dev, struct rtc_time *dt) in ds1390_read_time() argument
146 dt->tm_sec = bcd2bin(chip->txrx_buf[0]); in ds1390_read_time()
147 dt->tm_min = bcd2bin(chip->txrx_buf[1]); in ds1390_read_time()
148 dt->tm_hour = bcd2bin(chip->txrx_buf[2]); in ds1390_read_time()
149 dt->tm_wday = bcd2bin(chip->txrx_buf[3]); in ds1390_read_time()
150 dt->tm_mday = bcd2bin(chip->txrx_buf[4]); in ds1390_read_time()
152 dt->tm_mon = bcd2bin(chip->txrx_buf[5] & 0x7f) - 1; in ds1390_read_time()
154 dt->tm_year = bcd2bin(chip->txrx_buf[6]) + ((chip->txrx_buf[5] & 0x80) ? 100 : 0); in ds1390_read_time()
156 return rtc_valid_tm(dt); in ds1390_read_time()
159 static int ds1390_set_time(struct device *dev, struct rtc_time *dt) in ds1390_set_time() argument
166 chip->txrx_buf[1] = bin2bcd(dt->tm_sec); in ds1390_set_time()
167 chip->txrx_buf[2] = bin2bcd(dt->tm_min); in ds1390_set_time()
168 chip->txrx_buf[3] = bin2bcd(dt->tm_hour); in ds1390_set_time()
169 chip->txrx_buf[4] = bin2bcd(dt->tm_wday); in ds1390_set_time()
170 chip->txrx_buf[5] = bin2bcd(dt->tm_mday); in ds1390_set_time()
171 chip->txrx_buf[6] = bin2bcd(dt->tm_mon + 1) | in ds1390_set_time()
172 ((dt->tm_year > 99) ? 0x80 : 0x00); in ds1390_set_time()
173 chip->txrx_buf[7] = bin2bcd(dt->tm_year % 100); in ds1390_set_time()