Lines Matching full:dt
68 static int r9701_get_datetime(struct device *dev, struct rtc_time *dt) in r9701_get_datetime() argument
78 dt->tm_sec = bcd2bin(buf[0]); /* RSECCNT */ in r9701_get_datetime()
79 dt->tm_min = bcd2bin(buf[1]); /* RMINCNT */ in r9701_get_datetime()
80 dt->tm_hour = bcd2bin(buf[2]); /* RHRCNT */ in r9701_get_datetime()
82 dt->tm_mday = bcd2bin(buf[3]); /* RDAYCNT */ in r9701_get_datetime()
83 dt->tm_mon = bcd2bin(buf[4]) - 1; /* RMONCNT */ in r9701_get_datetime()
84 dt->tm_year = bcd2bin(buf[5]) + 100; /* RYRCNT */ in r9701_get_datetime()
89 static int r9701_set_datetime(struct device *dev, struct rtc_time *dt) in r9701_set_datetime() argument
93 ret = write_reg(dev, RHRCNT, bin2bcd(dt->tm_hour)); in r9701_set_datetime()
94 ret = ret ? ret : write_reg(dev, RMINCNT, bin2bcd(dt->tm_min)); in r9701_set_datetime()
95 ret = ret ? ret : write_reg(dev, RSECCNT, bin2bcd(dt->tm_sec)); in r9701_set_datetime()
96 ret = ret ? ret : write_reg(dev, RDAYCNT, bin2bcd(dt->tm_mday)); in r9701_set_datetime()
97 ret = ret ? ret : write_reg(dev, RMONCNT, bin2bcd(dt->tm_mon + 1)); in r9701_set_datetime()
98 ret = ret ? ret : write_reg(dev, RYRCNT, bin2bcd(dt->tm_year - 100)); in r9701_set_datetime()