Lines Matching full:dt
52 static int max6902_read_time(struct device *dev, struct rtc_time *dt) in max6902_read_time() argument
66 dt->tm_sec = bcd2bin(buf[0]); in max6902_read_time()
67 dt->tm_min = bcd2bin(buf[1]); in max6902_read_time()
68 dt->tm_hour = bcd2bin(buf[2]); in max6902_read_time()
69 dt->tm_mday = bcd2bin(buf[3]); in max6902_read_time()
70 dt->tm_mon = bcd2bin(buf[4]) - 1; in max6902_read_time()
71 dt->tm_wday = bcd2bin(buf[5]); in max6902_read_time()
72 dt->tm_year = bcd2bin(buf[6]); in max6902_read_time()
81 dt->tm_year += century; in max6902_read_time()
82 dt->tm_year -= 1900; in max6902_read_time()
87 static int max6902_set_time(struct device *dev, struct rtc_time *dt) in max6902_set_time() argument
89 dt->tm_year = dt->tm_year + 1900; in max6902_set_time()
94 max6902_set_reg(dev, MAX6902_REG_SECONDS, bin2bcd(dt->tm_sec)); in max6902_set_time()
95 max6902_set_reg(dev, MAX6902_REG_MINUTES, bin2bcd(dt->tm_min)); in max6902_set_time()
96 max6902_set_reg(dev, MAX6902_REG_HOURS, bin2bcd(dt->tm_hour)); in max6902_set_time()
98 max6902_set_reg(dev, MAX6902_REG_DATE, bin2bcd(dt->tm_mday)); in max6902_set_time()
99 max6902_set_reg(dev, MAX6902_REG_MONTH, bin2bcd(dt->tm_mon + 1)); in max6902_set_time()
100 max6902_set_reg(dev, MAX6902_REG_DAY, bin2bcd(dt->tm_wday)); in max6902_set_time()
101 max6902_set_reg(dev, MAX6902_REG_YEAR, bin2bcd(dt->tm_year % 100)); in max6902_set_time()
102 max6902_set_reg(dev, MAX6902_REG_CENTURY, bin2bcd(dt->tm_year / 100)); in max6902_set_time()