Lines Matching refs:alm
227 static int omap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in omap_rtc_read_alarm() argument
232 alm->time.tm_sec = rtc_read(OMAP_RTC_ALARM_SECONDS_REG); in omap_rtc_read_alarm()
233 alm->time.tm_min = rtc_read(OMAP_RTC_ALARM_MINUTES_REG); in omap_rtc_read_alarm()
234 alm->time.tm_hour = rtc_read(OMAP_RTC_ALARM_HOURS_REG); in omap_rtc_read_alarm()
235 alm->time.tm_mday = rtc_read(OMAP_RTC_ALARM_DAYS_REG); in omap_rtc_read_alarm()
236 alm->time.tm_mon = rtc_read(OMAP_RTC_ALARM_MONTHS_REG); in omap_rtc_read_alarm()
237 alm->time.tm_year = rtc_read(OMAP_RTC_ALARM_YEARS_REG); in omap_rtc_read_alarm()
241 bcd2tm(&alm->time); in omap_rtc_read_alarm()
242 alm->enabled = !!(rtc_read(OMAP_RTC_INTERRUPTS_REG) in omap_rtc_read_alarm()
248 static int omap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in omap_rtc_set_alarm() argument
252 if (tm2bcd(&alm->time) < 0) in omap_rtc_set_alarm()
258 rtc_write(alm->time.tm_year, OMAP_RTC_ALARM_YEARS_REG); in omap_rtc_set_alarm()
259 rtc_write(alm->time.tm_mon, OMAP_RTC_ALARM_MONTHS_REG); in omap_rtc_set_alarm()
260 rtc_write(alm->time.tm_mday, OMAP_RTC_ALARM_DAYS_REG); in omap_rtc_set_alarm()
261 rtc_write(alm->time.tm_hour, OMAP_RTC_ALARM_HOURS_REG); in omap_rtc_set_alarm()
262 rtc_write(alm->time.tm_min, OMAP_RTC_ALARM_MINUTES_REG); in omap_rtc_set_alarm()
263 rtc_write(alm->time.tm_sec, OMAP_RTC_ALARM_SECONDS_REG); in omap_rtc_set_alarm()
266 if (alm->enabled) in omap_rtc_set_alarm()