11 #include <linux/module.h>
12 #include <linux/kernel.h>
14 #include <linux/rtc.h>
18 #define M41T94_REG_SECONDS 0x01
19 #define M41T94_REG_MINUTES 0x02
20 #define M41T94_REG_HOURS 0x03
21 #define M41T94_REG_WDAY 0x04
22 #define M41T94_REG_DAY 0x05
23 #define M41T94_REG_MONTH 0x06
24 #define M41T94_REG_YEAR 0x07
25 #define M41T94_REG_HT 0x0c
27 #define M41T94_BIT_HALT 0x40
28 #define M41T94_BIT_STOP 0x80
29 #define M41T94_BIT_CB 0x40
30 #define M41T94_BIT_CEB 0x80
37 dev_dbg(dev,
"%s secs=%d, mins=%d, "
38 "hours=%d, mday=%d, mon=%d, year=%d, wday=%d\n",
56 return spi_write(spi, buf, 8);
71 buf[1] = ret & ~M41T94_BIT_HALT;
72 spi_write(spi, buf, 2);
81 buf[1] = ret & ~M41T94_BIT_STOP;
82 spi_write(spi, buf, 2);
96 dev_dbg(dev,
"%s secs=%d, mins=%d, "
97 "hours=%d, mday=%d, mon=%d, year=%d, wday=%d\n",
107 .read_time = m41t94_read_time,
108 .set_time = m41t94_set_time,
139 struct rtc_device *rtc = spi_get_drvdata(spi);
149 .name =
"rtc-m41t94",
152 .probe = m41t94_probe,