Lines Matching refs:tm
54 int rtc_get(struct rtc_time *tm) in rtc_get() argument
66 tm->tm_sec = bcd2bin(buf[M41T62_REG_SEC] & 0x7f); in rtc_get()
67 tm->tm_min = bcd2bin(buf[M41T62_REG_MIN] & 0x7f); in rtc_get()
68 tm->tm_hour = bcd2bin(buf[M41T62_REG_HOUR] & 0x3f); in rtc_get()
69 tm->tm_mday = bcd2bin(buf[M41T62_REG_DAY] & 0x3f); in rtc_get()
70 tm->tm_wday = buf[M41T62_REG_WDAY] & 0x07; in rtc_get()
71 tm->tm_mon = bcd2bin(buf[M41T62_REG_MON] & 0x1f); in rtc_get()
75 tm->tm_year = bcd2bin(buf[M41T62_REG_YEAR]) + 100 + 1900; in rtc_get()
80 tm->tm_sec, tm->tm_min, tm->tm_hour, in rtc_get()
81 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); in rtc_get()
86 int rtc_set(struct rtc_time *tm) in rtc_set() argument
91 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in rtc_set()
92 tm->tm_hour, tm->tm_min, tm->tm_sec); in rtc_set()
99 bin2bcd(tm->tm_sec) | (buf[M41T62_REG_SEC] & ~0x7f); in rtc_set()
101 bin2bcd(tm->tm_min) | (buf[M41T62_REG_MIN] & ~0x7f); in rtc_set()
103 bin2bcd(tm->tm_hour) | (buf[M41T62_REG_HOUR] & ~0x3f) ; in rtc_set()
105 (tm->tm_wday & 0x07) | (buf[M41T62_REG_WDAY] & ~0x07); in rtc_set()
107 bin2bcd(tm->tm_mday) | (buf[M41T62_REG_DAY] & ~0x3f); in rtc_set()
109 bin2bcd(tm->tm_mon) | (buf[M41T62_REG_MON] & ~0x1f); in rtc_set()
111 buf[M41T62_REG_YEAR] = bin2bcd(tm->tm_year % 100); in rtc_set()