15 #include <linux/kernel.h>
16 #include <linux/module.h>
19 #include <linux/rtc.h>
20 #include <linux/slab.h>
28 static irqreturn_t pcap_rtc_irq(
int irq,
void *_pcap_rtc)
31 unsigned long rtc_events;
101 static int pcap_rtc_set_mmss(
struct device *
dev,
unsigned long secs)
116 static int pcap_rtc_irq_enable(
struct device *
dev,
int pirq,
unsigned int en)
129 static int pcap_rtc_alarm_irq_enable(
struct device *dev,
unsigned int en)
135 .read_time = pcap_rtc_read_time,
136 .read_alarm = pcap_rtc_read_alarm,
137 .set_alarm = pcap_rtc_set_alarm,
138 .set_mmss = pcap_rtc_set_mmss,
139 .alarm_irq_enable = pcap_rtc_alarm_irq_enable,
144 struct pcap_rtc *pcap_rtc;
154 platform_set_drvdata(pdev, pcap_rtc);
158 if (IS_ERR(pcap_rtc->
rtc)) {
159 err = PTR_ERR(pcap_rtc->
rtc);
167 err =
request_irq(timer_irq, pcap_rtc_irq, 0,
"RTC Timer", pcap_rtc);
171 err =
request_irq(alarm_irq, pcap_rtc_irq, 0,
"RTC Alarm", pcap_rtc);
181 platform_set_drvdata(pdev,
NULL);
188 struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev);
206 static int __init rtc_pcap_init(
void)
211 static void __exit rtc_pcap_exit(
void)