Lines Matching refs:tm
45 static int m41t93_set_time(struct device *dev, struct rtc_time *tm) in m41t93_set_time() argument
54 "write", tm->tm_sec, tm->tm_min, in m41t93_set_time()
55 tm->tm_hour, tm->tm_mday, in m41t93_set_time()
56 tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t93_set_time()
58 if (tm->tm_year < 100) { in m41t93_set_time()
88 data[M41T93_REG_ST_SEC] = bin2bcd(tm->tm_sec); in m41t93_set_time()
89 data[M41T93_REG_MIN] = bin2bcd(tm->tm_min); in m41t93_set_time()
90 data[M41T93_REG_CENT_HOUR] = bin2bcd(tm->tm_hour) | in m41t93_set_time()
91 ((tm->tm_year/100-1) << 6); in m41t93_set_time()
92 data[M41T93_REG_DAY] = bin2bcd(tm->tm_mday); in m41t93_set_time()
93 data[M41T93_REG_WDAY] = bin2bcd(tm->tm_wday + 1); in m41t93_set_time()
94 data[M41T93_REG_MON] = bin2bcd(tm->tm_mon + 1); in m41t93_set_time()
95 data[M41T93_REG_YEAR] = bin2bcd(tm->tm_year % 100); in m41t93_set_time()
101 static int m41t93_get_time(struct device *dev, struct rtc_time *tm) in m41t93_get_time() argument
143 tm->tm_sec = bcd2bin(buf[M41T93_REG_ST_SEC]); in m41t93_get_time()
144 tm->tm_min = bcd2bin(buf[M41T93_REG_MIN]); in m41t93_get_time()
145 tm->tm_hour = bcd2bin(buf[M41T93_REG_CENT_HOUR] & 0x3f); in m41t93_get_time()
146 tm->tm_mday = bcd2bin(buf[M41T93_REG_DAY]); in m41t93_get_time()
147 tm->tm_mon = bcd2bin(buf[M41T93_REG_MON]) - 1; in m41t93_get_time()
148 tm->tm_wday = bcd2bin(buf[M41T93_REG_WDAY] & 0x0f) - 1; in m41t93_get_time()
151 tm->tm_year = bcd2bin(buf[M41T93_REG_YEAR]) + century_after_1900 * 100; in m41t93_get_time()
155 "read", tm->tm_sec, tm->tm_min, in m41t93_get_time()
156 tm->tm_hour, tm->tm_mday, in m41t93_get_time()
157 tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t93_get_time()