Lines Matching refs:tm

46 static int pcf85063_get_datetime(struct i2c_client *client, struct rtc_time *tm)  in pcf85063_get_datetime()  argument
70 tm->tm_sec = bcd2bin(buf[PCF85063_REG_SC] & 0x7F); in pcf85063_get_datetime()
71 tm->tm_min = bcd2bin(buf[PCF85063_REG_MN] & 0x7F); in pcf85063_get_datetime()
72 tm->tm_hour = bcd2bin(buf[PCF85063_REG_HR] & 0x3F); /* rtc hr 0-23 */ in pcf85063_get_datetime()
73 tm->tm_mday = bcd2bin(buf[PCF85063_REG_DM] & 0x3F); in pcf85063_get_datetime()
74 tm->tm_wday = buf[PCF85063_REG_DW] & 0x07; in pcf85063_get_datetime()
75 tm->tm_mon = bcd2bin(buf[PCF85063_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ in pcf85063_get_datetime()
76 tm->tm_year = bcd2bin(buf[PCF85063_REG_YR]); in pcf85063_get_datetime()
77 if (tm->tm_year < 70) in pcf85063_get_datetime()
78 tm->tm_year += 100; /* assume we are in 1970...2069 */ in pcf85063_get_datetime()
81 (tm->tm_year >= 100) : (tm->tm_year < 100); in pcf85063_get_datetime()
86 if (rtc_valid_tm(tm) < 0) in pcf85063_get_datetime()
92 static int pcf85063_set_datetime(struct i2c_client *client, struct rtc_time *tm) in pcf85063_set_datetime() argument
102 buf[PCF85063_REG_SC] = bin2bcd(tm->tm_sec) & 0x7F; in pcf85063_set_datetime()
104 buf[PCF85063_REG_MN] = bin2bcd(tm->tm_min); in pcf85063_set_datetime()
105 buf[PCF85063_REG_HR] = bin2bcd(tm->tm_hour); in pcf85063_set_datetime()
108 buf[PCF85063_REG_DM] = bin2bcd(tm->tm_mday); in pcf85063_set_datetime()
111 buf[PCF85063_REG_DW] = tm->tm_wday & 0x07; in pcf85063_set_datetime()
114 buf[PCF85063_REG_MO] = bin2bcd(tm->tm_mon + 1); in pcf85063_set_datetime()
117 buf[PCF85063_REG_YR] = bin2bcd(tm->tm_year % 100); in pcf85063_set_datetime()
134 static int pcf85063_rtc_read_time(struct device *dev, struct rtc_time *tm) in pcf85063_rtc_read_time() argument
136 return pcf85063_get_datetime(to_i2c_client(dev), tm); in pcf85063_rtc_read_time()
139 static int pcf85063_rtc_set_time(struct device *dev, struct rtc_time *tm) in pcf85063_rtc_set_time() argument
141 return pcf85063_set_datetime(to_i2c_client(dev), tm); in pcf85063_rtc_set_time()