Lines Matching defs:alrm
160 static int rtc_update_alarm(struct device *dev, struct rtc_time *alrm)
174 alarm_tm.tm_hour = alrm->tm_hour;
175 alarm_tm.tm_min = alrm->tm_min;
176 alarm_tm.tm_sec = alrm->tm_sec;
314 * This function reads the current alarm value into the passed in 'alrm'
315 * argument. It updates the alrm's pending field value based on the whether
318 static int mxc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
324 rtc_time_to_tm(get_alarm_or_time(dev, MXC_RTC_ALARM), &alrm->time);
325 alrm->pending = ((readw(ioaddr + RTC_RTCISR) & RTC_ALM_BIT)) ? 1 : 0;
331 * This function sets the RTC alarm based on passed in alrm.
333 static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
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));
358 mxc_rtc_irq_enable(dev, RTC_ALM_BIT, alrm->enabled);