Lines Matching refs:tm
29 static int m41t94_set_time(struct device *dev, struct rtc_time *tm) in m41t94_set_time() argument
36 "write", tm->tm_sec, tm->tm_min, in m41t94_set_time()
37 tm->tm_hour, tm->tm_mday, in m41t94_set_time()
38 tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t94_set_time()
41 buf[M41T94_REG_SECONDS] = bin2bcd(tm->tm_sec); in m41t94_set_time()
42 buf[M41T94_REG_MINUTES] = bin2bcd(tm->tm_min); in m41t94_set_time()
43 buf[M41T94_REG_HOURS] = bin2bcd(tm->tm_hour); in m41t94_set_time()
44 buf[M41T94_REG_WDAY] = bin2bcd(tm->tm_wday + 1); in m41t94_set_time()
45 buf[M41T94_REG_DAY] = bin2bcd(tm->tm_mday); in m41t94_set_time()
46 buf[M41T94_REG_MONTH] = bin2bcd(tm->tm_mon + 1); in m41t94_set_time()
49 if (tm->tm_year >= 100) in m41t94_set_time()
51 buf[M41T94_REG_YEAR] = bin2bcd(tm->tm_year % 100); in m41t94_set_time()
56 static int m41t94_read_time(struct device *dev, struct rtc_time *tm) in m41t94_read_time() argument
82 tm->tm_sec = bcd2bin(spi_w8r8(spi, M41T94_REG_SECONDS)); in m41t94_read_time()
83 tm->tm_min = bcd2bin(spi_w8r8(spi, M41T94_REG_MINUTES)); in m41t94_read_time()
85 tm->tm_hour = bcd2bin(hour & 0x3f); in m41t94_read_time()
86 tm->tm_wday = bcd2bin(spi_w8r8(spi, M41T94_REG_WDAY)) - 1; in m41t94_read_time()
87 tm->tm_mday = bcd2bin(spi_w8r8(spi, M41T94_REG_DAY)); in m41t94_read_time()
88 tm->tm_mon = bcd2bin(spi_w8r8(spi, M41T94_REG_MONTH)) - 1; in m41t94_read_time()
89 tm->tm_year = bcd2bin(spi_w8r8(spi, M41T94_REG_YEAR)); in m41t94_read_time()
91 tm->tm_year += 100; in m41t94_read_time()
95 "read", tm->tm_sec, tm->tm_min, in m41t94_read_time()
96 tm->tm_hour, tm->tm_mday, in m41t94_read_time()
97 tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t94_read_time()