Lines Matching refs:alm
247 static int pcf2123_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in pcf2123_rtc_read_alarm() argument
259 alm->time.tm_min = bcd2bin(rxbuf[0] & 0x7F); in pcf2123_rtc_read_alarm()
260 alm->time.tm_hour = bcd2bin(rxbuf[1] & 0x3F); in pcf2123_rtc_read_alarm()
261 alm->time.tm_mday = bcd2bin(rxbuf[2] & 0x3F); in pcf2123_rtc_read_alarm()
262 alm->time.tm_wday = bcd2bin(rxbuf[3] & 0x07); in pcf2123_rtc_read_alarm()
264 dev_dbg(dev, "%s: alm is %ptR\n", __func__, &alm->time); in pcf2123_rtc_read_alarm()
270 alm->enabled = !!(val & CTRL2_AIE); in pcf2123_rtc_read_alarm()
275 static int pcf2123_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in pcf2123_rtc_set_alarm() argument
281 dev_dbg(dev, "%s: alm is %ptR\n", __func__, &alm->time); in pcf2123_rtc_set_alarm()
294 txbuf[0] = bin2bcd(alm->time.tm_min & 0x7F); in pcf2123_rtc_set_alarm()
295 txbuf[1] = bin2bcd(alm->time.tm_hour & 0x3F); in pcf2123_rtc_set_alarm()
296 txbuf[2] = bin2bcd(alm->time.tm_mday & 0x3F); in pcf2123_rtc_set_alarm()
304 return pcf2123_rtc_alarm_irq_enable(dev, alm->enabled); in pcf2123_rtc_set_alarm()