* [U-Boot] [PATCH] rtc: ds1307: add support for m41t11
@ 2019-05-27 6:13 Heiko Schocher
2019-07-14 13:07 ` Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Heiko Schocher @ 2019-05-27 6:13 UTC (permalink / raw)
To: u-boot
add m41t11 support in ds1307 driver. changes:
- add compatible string for m41t11
- check if RTC clock is running, if not
enable the clock
Signed-off-by: Heiko Schocher <hs@denx.de>
---
clean travis build, see:
https://travis-ci.org/hsdenx/u-boot-test/builds/537359553
drivers/rtc/ds1307.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/rtc/ds1307.c b/drivers/rtc/ds1307.c
index 48220b45db..a33f47525f 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 },
{ }
};
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] rtc: ds1307: add support for m41t11
2019-05-27 6:13 [U-Boot] [PATCH] rtc: ds1307: add support for m41t11 Heiko Schocher
@ 2019-07-14 13:07 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2019-07-14 13:07 UTC (permalink / raw)
To: u-boot
On Mon, May 27, 2019 at 08:13:41AM +0200, Heiko Schocher wrote:
> add m41t11 support in ds1307 driver. changes:
>
> - add compatible string for m41t11
> - check if RTC clock is running, if not
> enable the clock
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190714/f31ab8d1/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-14 13:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-27 6:13 [U-Boot] [PATCH] rtc: ds1307: add support for m41t11 Heiko Schocher
2019-07-14 13:07 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox