Lines Matching refs:rtc_tm
220 static int sunxi_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
234 rtc_tm->tm_sec = SUNXI_TIME_GET_SEC_VALUE(time);
235 rtc_tm->tm_min = SUNXI_TIME_GET_MIN_VALUE(time);
236 rtc_tm->tm_hour = SUNXI_TIME_GET_HOUR_VALUE(time);
238 rtc_tm->tm_mday = SUNXI_DATE_GET_DAY_VALUE(date);
239 rtc_tm->tm_mon = SUNXI_DATE_GET_MON_VALUE(date);
240 rtc_tm->tm_year = SUNXI_DATE_GET_YEAR_VALUE(date,
243 rtc_tm->tm_mon -= 1;
249 rtc_tm->tm_year += SUNXI_YEAR_OFF(chip->data_year);
328 static int sunxi_rtc_settime(struct device *dev, struct rtc_time *rtc_tm)
336 * the input rtc_tm->tm_year is the offset relative to 1900. We use
341 year = rtc_tm->tm_year + 1900;
348 rtc_tm->tm_year -= SUNXI_YEAR_OFF(chip->data_year);
349 rtc_tm->tm_mon += 1;
351 date = SUNXI_DATE_SET_DAY_VALUE(rtc_tm->tm_mday) |
352 SUNXI_DATE_SET_MON_VALUE(rtc_tm->tm_mon) |
353 SUNXI_DATE_SET_YEAR_VALUE(rtc_tm->tm_year,
359 time = SUNXI_TIME_SET_SEC_VALUE(rtc_tm->tm_sec) |
360 SUNXI_TIME_SET_MIN_VALUE(rtc_tm->tm_min) |
361 SUNXI_TIME_SET_HOUR_VALUE(rtc_tm->tm_hour);