Lines Matching refs:day
85 s32 day; in rtd119x_rtc_read_time() local
94 day = readl_relaxed(data->base + RTD_RTCDATE1) & RTD_RTCDATE1_RTCDATE1_MASK; in rtd119x_rtc_read_time()
95 day |= (readl_relaxed(data->base + RTD_RTCDATE2) & RTD_RTCDATE2_RTCDATE2_MASK) << 8; in rtd119x_rtc_read_time()
109 while (day >= rtd119x_rtc_days_in_year(year)) { in rtd119x_rtc_read_time()
110 day -= rtd119x_rtc_days_in_year(year); in rtd119x_rtc_read_time()
114 tm->tm_yday = day; in rtd119x_rtc_read_time()
117 while (day >= rtc_month_days(tm->tm_mon, year)) { in rtd119x_rtc_read_time()
118 day -= rtc_month_days(tm->tm_mon, year); in rtd119x_rtc_read_time()
121 tm->tm_mday = day + 1; in rtd119x_rtc_read_time()
129 unsigned int day; in rtd119x_rtc_set_time() local
135 day = 0; in rtd119x_rtc_set_time()
137 day += rtd119x_rtc_days_in_year(i); in rtd119x_rtc_set_time()
139 day += tm->tm_yday; in rtd119x_rtc_set_time()
140 if (day > 0x7fff) in rtd119x_rtc_set_time()
148 writel_relaxed(day & RTD_RTCDATE1_RTCDATE1_MASK, data->base + RTD_RTCDATE1); in rtd119x_rtc_set_time()
149 writel_relaxed((day >> 8) & RTD_RTCDATE2_RTCDATE2_MASK, data->base + RTD_RTCDATE2); in rtd119x_rtc_set_time()