summaryrefslogtreecommitdiff
path: root/drivers/rtc/ds1307.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-07-14 09:05:20 -0400
committerTom Rini <trini@konsulko.com>2019-07-14 09:05:20 -0400
commit6070ef409c1018860e8dd1f077297546d9d80115 (patch)
treeff914035d376420d37fd2d3d1ad0877220eed9c6 /drivers/rtc/ds1307.c
parenta9758ece08bceb60634145c2126582e5d282bd09 (diff)
parentae8d23a668755d804748a1cf848426b28338b3d5 (diff)
Merge branch '2019-07-12-master-imports'
- First round of TI Davinci updates - Some OMAP3 DM updates - Other misc updates
Diffstat (limited to 'drivers/rtc/ds1307.c')
-rw-r--r--drivers/rtc/ds1307.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/rtc/ds1307.c b/drivers/rtc/ds1307.c
index 48220b45db1..a33f47525f7 100644
--- a/drivers/rtc/ds1307.c
+++ b/drivers/rtc/ds1307.c
@@ -23,6 +23,7 @@ enum ds_type {
ds_1307,
ds_1337,
ds_1340,
+ m41t11,
mcp794xx,
};
@@ -260,6 +261,18 @@ read_rtc:
}
}
+ if (type == m41t11) {
+ /* clock halted? turn it on, so clock can tick. */
+ if (buf[RTC_SEC_REG_ADDR] & RTC_SEC_BIT_CH) {
+ buf[RTC_SEC_REG_ADDR] &= ~RTC_SEC_BIT_CH;
+ dm_i2c_reg_write(dev, RTC_SEC_REG_ADDR,
+ MCP7941X_BIT_ST);
+ dm_i2c_reg_write(dev, RTC_SEC_REG_ADDR,
+ buf[RTC_SEC_REG_ADDR]);
+ goto read_rtc;
+ }
+ }
+
if (type == mcp794xx) {
/* make sure that the backup battery is enabled */
if (!(buf[RTC_DAY_REG_ADDR] & MCP7941X_BIT_VBATEN)) {
@@ -332,6 +345,7 @@ static const struct udevice_id ds1307_rtc_ids[] = {
{ .compatible = "dallas,ds1337", .data = ds_1337 },
{ .compatible = "dallas,ds1340", .data = ds_1340 },
{ .compatible = "microchip,mcp7941x", .data = mcp794xx },
+ { .compatible = "st,m41t11", .data = m41t11 },
{ }
};