Lines Matching refs:pcap_rtc
19 struct pcap_rtc { struct
26 struct pcap_rtc *pcap_rtc = _pcap_rtc; in pcap_rtc_irq() argument
29 if (irq == pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ)) in pcap_rtc_irq()
31 else if (irq == pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA)) in pcap_rtc_irq()
36 rtc_update_irq(pcap_rtc->rtc, 1, rtc_events); in pcap_rtc_irq()
42 struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev); in pcap_rtc_read_alarm() local
48 ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_TODA, &tod); in pcap_rtc_read_alarm()
51 ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_DAYA, &days); in pcap_rtc_read_alarm()
61 struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev); in pcap_rtc_set_alarm() local
66 ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_TODA, tod); in pcap_rtc_set_alarm()
69 ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_DAYA, days); in pcap_rtc_set_alarm()
76 struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev); in pcap_rtc_read_time() local
80 ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_TOD, &tod); in pcap_rtc_read_time()
83 ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_DAY, &days); in pcap_rtc_read_time()
93 struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev); in pcap_rtc_set_time() local
98 ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_TOD, tod); in pcap_rtc_set_time()
101 ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_DAY, days); in pcap_rtc_set_time()
108 struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev); in pcap_rtc_irq_enable() local
111 enable_irq(pcap_to_irq(pcap_rtc->pcap, pirq)); in pcap_rtc_irq_enable()
113 disable_irq(pcap_to_irq(pcap_rtc->pcap, pirq)); in pcap_rtc_irq_enable()
133 struct pcap_rtc *pcap_rtc; in pcap_rtc_probe() local
137 pcap_rtc = devm_kzalloc(&pdev->dev, sizeof(struct pcap_rtc), in pcap_rtc_probe()
139 if (!pcap_rtc) in pcap_rtc_probe()
142 pcap_rtc->pcap = dev_get_drvdata(pdev->dev.parent); in pcap_rtc_probe()
144 platform_set_drvdata(pdev, pcap_rtc); in pcap_rtc_probe()
146 pcap_rtc->rtc = devm_rtc_allocate_device(&pdev->dev); in pcap_rtc_probe()
147 if (IS_ERR(pcap_rtc->rtc)) in pcap_rtc_probe()
148 return PTR_ERR(pcap_rtc->rtc); in pcap_rtc_probe()
150 pcap_rtc->rtc->ops = &pcap_rtc_ops; in pcap_rtc_probe()
151 pcap_rtc->rtc->range_max = (1 << 14) * 86400ULL - 1; in pcap_rtc_probe()
153 timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ); in pcap_rtc_probe()
154 alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA); in pcap_rtc_probe()
157 "RTC Timer", pcap_rtc); in pcap_rtc_probe()
162 "RTC Alarm", pcap_rtc); in pcap_rtc_probe()
166 return devm_rtc_register_device(pcap_rtc->rtc); in pcap_rtc_probe()