Lines Matching refs:rtc_tm

467 static int sun6i_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)  in sun6i_rtc_gettime()  argument
488 rtc_time64_to_tm((date & 0xffff) * SECS_PER_DAY, rtc_tm); in sun6i_rtc_gettime()
490 rtc_tm->tm_mday = SUN6I_DATE_GET_DAY_VALUE(date); in sun6i_rtc_gettime()
491 rtc_tm->tm_mon = SUN6I_DATE_GET_MON_VALUE(date) - 1; in sun6i_rtc_gettime()
492 rtc_tm->tm_year = SUN6I_DATE_GET_YEAR_VALUE(date); in sun6i_rtc_gettime()
498 rtc_tm->tm_year += SUN6I_YEAR_OFF; in sun6i_rtc_gettime()
501 rtc_tm->tm_sec = SUN6I_TIME_GET_SEC_VALUE(time); in sun6i_rtc_gettime()
502 rtc_tm->tm_min = SUN6I_TIME_GET_MIN_VALUE(time); in sun6i_rtc_gettime()
503 rtc_tm->tm_hour = SUN6I_TIME_GET_HOUR_VALUE(time); in sun6i_rtc_gettime()
605 static int sun6i_rtc_settime(struct device *dev, struct rtc_time *rtc_tm) in sun6i_rtc_settime() argument
611 time = SUN6I_TIME_SET_SEC_VALUE(rtc_tm->tm_sec) | in sun6i_rtc_settime()
612 SUN6I_TIME_SET_MIN_VALUE(rtc_tm->tm_min) | in sun6i_rtc_settime()
613 SUN6I_TIME_SET_HOUR_VALUE(rtc_tm->tm_hour); in sun6i_rtc_settime()
617 date = div_u64(rtc_tm_to_time64(rtc_tm), SECS_PER_DAY); in sun6i_rtc_settime()
619 rtc_tm->tm_year -= SUN6I_YEAR_OFF; in sun6i_rtc_settime()
620 rtc_tm->tm_mon += 1; in sun6i_rtc_settime()
622 date = SUN6I_DATE_SET_DAY_VALUE(rtc_tm->tm_mday) | in sun6i_rtc_settime()
623 SUN6I_DATE_SET_MON_VALUE(rtc_tm->tm_mon) | in sun6i_rtc_settime()
624 SUN6I_DATE_SET_YEAR_VALUE(rtc_tm->tm_year); in sun6i_rtc_settime()
626 if (is_leap_year(rtc_tm->tm_year + SUN6I_YEAR_MIN)) in sun6i_rtc_settime()