12 #include <linux/module.h>
13 #include <linux/rtc.h>
18 #define EP93XX_RTC_DATA 0x000
19 #define EP93XX_RTC_MATCH 0x004
20 #define EP93XX_RTC_STATUS 0x008
21 #define EP93XX_RTC_STATUS_INTR (1<<0)
22 #define EP93XX_RTC_LOAD 0x00C
23 #define EP93XX_RTC_CONTROL 0x010
24 #define EP93XX_RTC_CONTROL_MIE (1<<0)
25 #define EP93XX_RTC_SWCOMP 0x108
26 #define EP93XX_RTC_SWCOMP_DEL_MASK 0x001f0000
27 #define EP93XX_RTC_SWCOMP_DEL_SHIFT 16
28 #define EP93XX_RTC_SWCOMP_INT_MASK 0x0000ffff
29 #define EP93XX_RTC_SWCOMP_INT_SHIFT 0
31 #define DRV_VERSION "0.3"
42 static int ep93xx_rtc_get_swcomp(
struct device *
dev,
unsigned short *preload,
43 unsigned short *
delete)
72 static int ep93xx_rtc_set_mmss(
struct device *
dev,
unsigned long secs)
82 unsigned short preload,
delete;
84 ep93xx_rtc_get_swcomp(dev, &preload, &
delete);
93 .read_time = ep93xx_rtc_read_time,
94 .set_mmss = ep93xx_rtc_set_mmss,
95 .proc = ep93xx_rtc_proc,
101 unsigned short preload;
103 ep93xx_rtc_get_swcomp(dev, &preload,
NULL);
105 return sprintf(buf,
"%d\n", preload);
112 unsigned short delete;
114 ep93xx_rtc_get_swcomp(dev,
NULL, &
delete);
116 return sprintf(buf,
"%d\n",
delete);
120 static struct attribute *ep93xx_rtc_attrs[] = {
121 &dev_attr_comp_preload.attr,
122 &dev_attr_comp_delete.attr,
127 .attrs = ep93xx_rtc_attrs,
145 resource_size(res), pdev->
name))
153 pdev->
dev.platform_data = ep93xx_rtc;
154 platform_set_drvdata(pdev, ep93xx_rtc);
158 if (IS_ERR(ep93xx_rtc->
rtc)) {
159 err = PTR_ERR(ep93xx_rtc->
rtc);
172 platform_set_drvdata(pdev,
NULL);
173 pdev->
dev.platform_data =
NULL;
179 struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev);
182 platform_set_drvdata(pdev,
NULL);
184 pdev->
dev.platform_data =
NULL;
191 .name =
"ep93xx-rtc",
194 .probe = ep93xx_rtc_probe,