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