Lines Matching refs:time
90 * This function is used to obtain the RTC time or the alarm value in
120 * This function sets the RTC alarm value or the time value.
122 static void set_alarm_or_time(struct device *dev, int time_alarm, u32 time)
129 day = time / 86400;
130 time -= day * 86400;
132 /* time is within a day now */
133 hr = time / 3600;
134 time -= hr * 3600;
136 /* time is within an hour now */
137 min = time / 60;
138 sec = time - min * 60;
163 unsigned long now, time;
178 rtc_tm_to_time(&alarm_tm, &time);
180 if (time < now) {
181 time += 60 * 60 * 24;
182 rtc_time_to_tm(time, &alarm_tm);
185 ret = rtc_tm_to_time(&alarm_tm, &time);
189 set_alarm_or_time(dev, MXC_RTC_ALARM, time);
284 * This function reads the current RTC time into tm in Gregorian date.
301 * This function sets the internal RTC time based on tm in Gregorian date.
303 static int mxc_rtc_set_mmss(struct device *dev, unsigned long time)
307 set_alarm_or_time(dev, MXC_RTC_TIME, time);
308 } while (time != get_alarm_or_time(dev, MXC_RTC_TIME));
324 rtc_time_to_tm(get_alarm_or_time(dev, MXC_RTC_ALARM), &alrm->time);
339 if (rtc_valid_tm(&alrm->time)) {
340 if (alrm->time.tm_sec > 59 ||
341 alrm->time.tm_hour > 23 ||
342 alrm->time.tm_min > 59)
345 ret = rtc_update_alarm(dev, &alrm->time);
347 ret = rtc_valid_tm(&alrm->time);
351 ret = rtc_update_alarm(dev, &alrm->time);
357 memcpy(&pdata->g_rtc_alarm, &alrm->time, sizeof(struct rtc_time));