16 #include <linux/module.h>
17 #include <linux/rtc.h>
22 #define M48T86_REG_SEC 0x00
23 #define M48T86_REG_SECALRM 0x01
24 #define M48T86_REG_MIN 0x02
25 #define M48T86_REG_MINALRM 0x03
26 #define M48T86_REG_HOUR 0x04
27 #define M48T86_REG_HOURALRM 0x05
28 #define M48T86_REG_DOW 0x06
29 #define M48T86_REG_DOM 0x07
30 #define M48T86_REG_MONTH 0x08
31 #define M48T86_REG_YEAR 0x09
32 #define M48T86_REG_A 0x0A
33 #define M48T86_REG_B 0x0B
34 #define M48T86_REG_C 0x0C
35 #define M48T86_REG_D 0x0D
37 #define M48T86_REG_B_H24 (1 << 1)
38 #define M48T86_REG_B_DM (1 << 2)
39 #define M48T86_REG_B_SET (1 << 7)
40 #define M48T86_REG_D_VRT (1 << 7)
42 #define DRV_VERSION "0.1"
122 static int m48t86_rtc_proc(
struct device *dev,
struct seq_file *seq)
131 (reg & M48T86_REG_B_DM) ?
"binary" :
"bcd");
142 .read_time = m48t86_rtc_read_time,
143 .set_time = m48t86_rtc_set_time,
144 .proc = m48t86_rtc_proc,
157 platform_set_drvdata(dev, rtc);
169 struct rtc_device *rtc = platform_get_drvdata(dev);
174 platform_set_drvdata(dev,
NULL);
181 .name =
"rtc-m48t86",
184 .probe = m48t86_rtc_probe,