Lines Matching refs:pcf
58 struct pcf50633 *pcf; member
62 static void pcf2rtc_time(struct rtc_time *rtc, struct pcf50633_time *pcf) in pcf2rtc_time() argument
64 rtc->tm_sec = bcd2bin(pcf->time[PCF50633_TI_SEC]); in pcf2rtc_time()
65 rtc->tm_min = bcd2bin(pcf->time[PCF50633_TI_MIN]); in pcf2rtc_time()
66 rtc->tm_hour = bcd2bin(pcf->time[PCF50633_TI_HOUR]); in pcf2rtc_time()
67 rtc->tm_wday = bcd2bin(pcf->time[PCF50633_TI_WKDAY]); in pcf2rtc_time()
68 rtc->tm_mday = bcd2bin(pcf->time[PCF50633_TI_DAY]); in pcf2rtc_time()
69 rtc->tm_mon = bcd2bin(pcf->time[PCF50633_TI_MONTH]) - 1; in pcf2rtc_time()
70 rtc->tm_year = bcd2bin(pcf->time[PCF50633_TI_YEAR]) + 100; in pcf2rtc_time()
73 static void rtc2pcf_time(struct pcf50633_time *pcf, struct rtc_time *rtc) in rtc2pcf_time() argument
75 pcf->time[PCF50633_TI_SEC] = bin2bcd(rtc->tm_sec); in rtc2pcf_time()
76 pcf->time[PCF50633_TI_MIN] = bin2bcd(rtc->tm_min); in rtc2pcf_time()
77 pcf->time[PCF50633_TI_HOUR] = bin2bcd(rtc->tm_hour); in rtc2pcf_time()
78 pcf->time[PCF50633_TI_WKDAY] = bin2bcd(rtc->tm_wday); in rtc2pcf_time()
79 pcf->time[PCF50633_TI_DAY] = bin2bcd(rtc->tm_mday); in rtc2pcf_time()
80 pcf->time[PCF50633_TI_MONTH] = bin2bcd(rtc->tm_mon + 1); in rtc2pcf_time()
81 pcf->time[PCF50633_TI_YEAR] = bin2bcd(rtc->tm_year % 100); in rtc2pcf_time()
91 err = pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM); in pcf50633_rtc_alarm_irq_enable()
93 err = pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM); in pcf50633_rtc_alarm_irq_enable()
111 ret = pcf50633_read_block(rtc->pcf, PCF50633_REG_RTCSC, in pcf50633_rtc_read_time()
155 alarm_masked = pcf50633_irq_mask_get(rtc->pcf, PCF50633_IRQ_ALARM); in pcf50633_rtc_set_time()
158 pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM); in pcf50633_rtc_set_time()
161 ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSC, in pcf50633_rtc_set_time()
166 pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM); in pcf50633_rtc_set_time()
182 ret = pcf50633_read_block(rtc->pcf, PCF50633_REG_RTCSCA, in pcf50633_rtc_read_alarm()
207 alarm_masked = pcf50633_irq_mask_get(rtc->pcf, PCF50633_IRQ_ALARM); in pcf50633_rtc_set_alarm()
211 pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM); in pcf50633_rtc_set_alarm()
214 ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSCA, in pcf50633_rtc_set_alarm()
220 pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM); in pcf50633_rtc_set_alarm()
250 rtc->pcf = dev_to_pcf50633(pdev->dev.parent); in pcf50633_rtc_probe()
258 pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM, in pcf50633_rtc_probe()
268 pcf50633_free_irq(rtc->pcf, PCF50633_IRQ_ALARM); in pcf50633_rtc_remove()