Lines Matching refs:rtc_tm
218 static int sunxi_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
232 rtc_tm->tm_sec = SUNXI_TIME_GET_SEC_VALUE(time);
233 rtc_tm->tm_min = SUNXI_TIME_GET_MIN_VALUE(time);
234 rtc_tm->tm_hour = SUNXI_TIME_GET_HOUR_VALUE(time);
236 rtc_tm->tm_mday = SUNXI_DATE_GET_DAY_VALUE(date);
237 rtc_tm->tm_mon = SUNXI_DATE_GET_MON_VALUE(date);
238 rtc_tm->tm_year = SUNXI_DATE_GET_YEAR_VALUE(date,
241 rtc_tm->tm_mon -= 1;
247 rtc_tm->tm_year += SUNXI_YEAR_OFF(chip->data_year);
326 static int sunxi_rtc_settime(struct device *dev, struct rtc_time *rtc_tm)
334 * the input rtc_tm->tm_year is the offset relative to 1900. We use
339 year = rtc_tm->tm_year + 1900;
346 rtc_tm->tm_year -= SUNXI_YEAR_OFF(chip->data_year);
347 rtc_tm->tm_mon += 1;
349 date = SUNXI_DATE_SET_DAY_VALUE(rtc_tm->tm_mday) |
350 SUNXI_DATE_SET_MON_VALUE(rtc_tm->tm_mon) |
351 SUNXI_DATE_SET_YEAR_VALUE(rtc_tm->tm_year,
357 time = SUNXI_TIME_SET_SEC_VALUE(rtc_tm->tm_sec) |
358 SUNXI_TIME_SET_MIN_VALUE(rtc_tm->tm_min) |
359 SUNXI_TIME_SET_HOUR_VALUE(rtc_tm->tm_hour);