Lines Matching refs:rtc_tm
448 static int sun6i_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
462 rtc_tm->tm_sec = SUN6I_TIME_GET_SEC_VALUE(time);
463 rtc_tm->tm_min = SUN6I_TIME_GET_MIN_VALUE(time);
464 rtc_tm->tm_hour = SUN6I_TIME_GET_HOUR_VALUE(time);
466 rtc_tm->tm_mday = SUN6I_DATE_GET_DAY_VALUE(date);
467 rtc_tm->tm_mon = SUN6I_DATE_GET_MON_VALUE(date);
468 rtc_tm->tm_year = SUN6I_DATE_GET_YEAR_VALUE(date);
470 rtc_tm->tm_mon -= 1;
476 rtc_tm->tm_year += SUN6I_YEAR_OFF;
556 static int sun6i_rtc_settime(struct device *dev, struct rtc_time *rtc_tm)
562 rtc_tm->tm_year -= SUN6I_YEAR_OFF;
563 rtc_tm->tm_mon += 1;
565 date = SUN6I_DATE_SET_DAY_VALUE(rtc_tm->tm_mday) |
566 SUN6I_DATE_SET_MON_VALUE(rtc_tm->tm_mon) |
567 SUN6I_DATE_SET_YEAR_VALUE(rtc_tm->tm_year);
569 if (is_leap_year(rtc_tm->tm_year + SUN6I_YEAR_MIN))
572 time = SUN6I_TIME_SET_SEC_VALUE(rtc_tm->tm_sec) |
573 SUN6I_TIME_SET_MIN_VALUE(rtc_tm->tm_min) |
574 SUN6I_TIME_SET_HOUR_VALUE(rtc_tm->tm_hour);