Lines Matching refs:tm
22 static int aspeed_rtc_read_time(struct device *dev, struct rtc_time *tm) in aspeed_rtc_read_time() argument
38 tm->tm_mday = (reg1 >> 24) & 0x1f; in aspeed_rtc_read_time()
39 tm->tm_hour = (reg1 >> 16) & 0x1f; in aspeed_rtc_read_time()
40 tm->tm_min = (reg1 >> 8) & 0x3f; in aspeed_rtc_read_time()
41 tm->tm_sec = (reg1 >> 0) & 0x3f; in aspeed_rtc_read_time()
45 tm->tm_mon = ((reg2 >> 0) & 0x0f) - 1; in aspeed_rtc_read_time()
46 tm->tm_year = year + (cent * 100) - 1900; in aspeed_rtc_read_time()
48 dev_dbg(dev, "%s %ptR", __func__, tm); in aspeed_rtc_read_time()
53 static int aspeed_rtc_set_time(struct device *dev, struct rtc_time *tm) in aspeed_rtc_set_time() argument
59 cent = (tm->tm_year + 1900) / 100; in aspeed_rtc_set_time()
60 year = tm->tm_year % 100; in aspeed_rtc_set_time()
62 reg1 = (tm->tm_mday << 24) | (tm->tm_hour << 16) | (tm->tm_min << 8) | in aspeed_rtc_set_time()
63 tm->tm_sec; in aspeed_rtc_set_time()
66 ((tm->tm_mon + 1) & 0xf); in aspeed_rtc_set_time()