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