Lines Matching refs:alm
369 static int twl_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in twl_rtc_read_alarm() argument
383 alm->time.tm_sec = bcd2bin(rtc_data[0]); in twl_rtc_read_alarm()
384 alm->time.tm_min = bcd2bin(rtc_data[1]); in twl_rtc_read_alarm()
385 alm->time.tm_hour = bcd2bin(rtc_data[2]); in twl_rtc_read_alarm()
386 alm->time.tm_mday = bcd2bin(rtc_data[3]); in twl_rtc_read_alarm()
387 alm->time.tm_mon = bcd2bin(rtc_data[4]) - 1; in twl_rtc_read_alarm()
388 alm->time.tm_year = bcd2bin(rtc_data[5]) + 100; in twl_rtc_read_alarm()
392 alm->enabled = 1; in twl_rtc_read_alarm()
397 static int twl_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in twl_rtc_set_alarm() argument
408 alarm_data[0] = bin2bcd(alm->time.tm_sec); in twl_rtc_set_alarm()
409 alarm_data[1] = bin2bcd(alm->time.tm_min); in twl_rtc_set_alarm()
410 alarm_data[2] = bin2bcd(alm->time.tm_hour); in twl_rtc_set_alarm()
411 alarm_data[3] = bin2bcd(alm->time.tm_mday); in twl_rtc_set_alarm()
412 alarm_data[4] = bin2bcd(alm->time.tm_mon + 1); in twl_rtc_set_alarm()
413 alarm_data[5] = bin2bcd(alm->time.tm_year - 100); in twl_rtc_set_alarm()
423 if (alm->enabled) in twl_rtc_set_alarm()