Lines Matching refs:alm
342 static int twl_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in twl_rtc_read_alarm() argument
355 alm->time.tm_sec = bcd2bin(rtc_data[0]); in twl_rtc_read_alarm()
356 alm->time.tm_min = bcd2bin(rtc_data[1]); in twl_rtc_read_alarm()
357 alm->time.tm_hour = bcd2bin(rtc_data[2]); in twl_rtc_read_alarm()
358 alm->time.tm_mday = bcd2bin(rtc_data[3]); in twl_rtc_read_alarm()
359 alm->time.tm_mon = bcd2bin(rtc_data[4]) - 1; in twl_rtc_read_alarm()
360 alm->time.tm_year = bcd2bin(rtc_data[5]) + 100; in twl_rtc_read_alarm()
364 alm->enabled = 1; in twl_rtc_read_alarm()
369 static int twl_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in twl_rtc_set_alarm() argument
378 alarm_data[1] = bin2bcd(alm->time.tm_sec); in twl_rtc_set_alarm()
379 alarm_data[2] = bin2bcd(alm->time.tm_min); in twl_rtc_set_alarm()
380 alarm_data[3] = bin2bcd(alm->time.tm_hour); in twl_rtc_set_alarm()
381 alarm_data[4] = bin2bcd(alm->time.tm_mday); in twl_rtc_set_alarm()
382 alarm_data[5] = bin2bcd(alm->time.tm_mon + 1); in twl_rtc_set_alarm()
383 alarm_data[6] = bin2bcd(alm->time.tm_year - 100); in twl_rtc_set_alarm()
393 if (alm->enabled) in twl_rtc_set_alarm()