• Home
  • Raw
  • Download

Lines Matching refs:tm

32 static int m41t94_set_time(struct device *dev, struct rtc_time *tm)  in m41t94_set_time()  argument
39 "write", tm->tm_sec, tm->tm_min, in m41t94_set_time()
40 tm->tm_hour, tm->tm_mday, in m41t94_set_time()
41 tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t94_set_time()
44 buf[M41T94_REG_SECONDS] = bin2bcd(tm->tm_sec); in m41t94_set_time()
45 buf[M41T94_REG_MINUTES] = bin2bcd(tm->tm_min); in m41t94_set_time()
46 buf[M41T94_REG_HOURS] = bin2bcd(tm->tm_hour); in m41t94_set_time()
47 buf[M41T94_REG_WDAY] = bin2bcd(tm->tm_wday + 1); in m41t94_set_time()
48 buf[M41T94_REG_DAY] = bin2bcd(tm->tm_mday); in m41t94_set_time()
49 buf[M41T94_REG_MONTH] = bin2bcd(tm->tm_mon + 1); in m41t94_set_time()
52 if (tm->tm_year >= 100) in m41t94_set_time()
54 buf[M41T94_REG_YEAR] = bin2bcd(tm->tm_year % 100); in m41t94_set_time()
59 static int m41t94_read_time(struct device *dev, struct rtc_time *tm) in m41t94_read_time() argument
85 tm->tm_sec = bcd2bin(spi_w8r8(spi, M41T94_REG_SECONDS)); in m41t94_read_time()
86 tm->tm_min = bcd2bin(spi_w8r8(spi, M41T94_REG_MINUTES)); in m41t94_read_time()
88 tm->tm_hour = bcd2bin(hour & 0x3f); in m41t94_read_time()
89 tm->tm_wday = bcd2bin(spi_w8r8(spi, M41T94_REG_WDAY)) - 1; in m41t94_read_time()
90 tm->tm_mday = bcd2bin(spi_w8r8(spi, M41T94_REG_DAY)); in m41t94_read_time()
91 tm->tm_mon = bcd2bin(spi_w8r8(spi, M41T94_REG_MONTH)) - 1; in m41t94_read_time()
92 tm->tm_year = bcd2bin(spi_w8r8(spi, M41T94_REG_YEAR)); in m41t94_read_time()
94 tm->tm_year += 100; in m41t94_read_time()
98 "read", tm->tm_sec, tm->tm_min, in m41t94_read_time()
99 tm->tm_hour, tm->tm_mday, in m41t94_read_time()
100 tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t94_read_time()
103 return rtc_valid_tm(tm); in m41t94_read_time()