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