common: Drop linux/delay.h from common header
[oweals/u-boot.git] / drivers / rtc / m41t62.c
index 2ee7e00b021b5a268ca39aa1484fc0e4ddd95ff4..94a6b523aab3630582575dddc7c9151a66a03e80 100644 (file)
@@ -19,6 +19,7 @@
 #include <common.h>
 #include <command.h>
 #include <dm.h>
+#include <log.h>
 #include <rtc.h>
 #include <i2c.h>
 
@@ -155,6 +156,15 @@ static int m41t62_rtc_reset(struct udevice *dev)
        return ret;
 }
 
+/*
+ * Make sure HT bit is cleared. This bit is set on entering battery backup
+ * mode, so do this before the first read access.
+ */
+static int m41t62_rtc_probe(struct udevice *dev)
+{
+       return m41t62_rtc_reset(dev);
+}
+
 static const struct rtc_ops m41t62_rtc_ops = {
        .get = m41t62_rtc_get,
        .set = m41t62_rtc_set,
@@ -163,6 +173,8 @@ static const struct rtc_ops m41t62_rtc_ops = {
 
 static const struct udevice_id m41t62_rtc_ids[] = {
        { .compatible = "st,m41t62" },
+       { .compatible = "st,m41t82" },
+       { .compatible = "st,m41st87" },
        { .compatible = "microcrystal,rv4162" },
        { }
 };
@@ -172,6 +184,7 @@ U_BOOT_DRIVER(rtc_m41t62) = {
        .id     = UCLASS_RTC,
        .of_match = m41t62_rtc_ids,
        .ops    = &m41t62_rtc_ops,
+       .probe  = &m41t62_rtc_probe,
 };
 
 #else /* NON DM RTC code - will be removed */