14 #include <linux/module.h>
15 #include <linux/kernel.h>
18 #include <linux/rtc.h>
22 #define MAX6902_REG_SECONDS 0x01
23 #define MAX6902_REG_MINUTES 0x03
24 #define MAX6902_REG_HOURS 0x05
25 #define MAX6902_REG_DATE 0x07
26 #define MAX6902_REG_MONTH 0x09
27 #define MAX6902_REG_DAY 0x0B
28 #define MAX6902_REG_YEAR 0x0D
29 #define MAX6902_REG_CONTROL 0x0F
30 #define MAX6902_REG_CENTURY 0x13
39 buf[0] = address & 0x7f;
51 *data = address | 0x80;
83 century =
bcd2bin(buf[0]) * 100;
91 static int max6902_set_time(
struct device *dev,
struct rtc_time *dt)
96 max6902_set_reg(dev, 0xF, 0);
113 max6902_set_reg(dev, 0xF, 0x80);
119 .read_time = max6902_read_time,
120 .set_time = max6902_set_time,
156 .name =
"rtc-max6902",
159 .probe = max6902_probe,