drivers: rtc: max313xx: Ensure correct date is read after setting
When setting the time on the MAX31343, the time is not updated
for one second, and reading the time in this interval will give
the old time. Wait one second after writing so that the date
command will show the correct time when setting the clock.
Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Cc: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
diff --git a/drivers/rtc/max313xx.c b/drivers/rtc/max313xx.c
index ccfd6b6..2cb3f24 100644
--- a/drivers/rtc/max313xx.c
+++ b/drivers/rtc/max313xx.c
@@ -308,6 +308,11 @@
return ret;
break;
+ case ID_MAX31343:
+ /* Time is not updated for 1 second after writing */
+ /* Sleep here so the date command shows the new time */
+ mdelay(1000);
+ break;
default:
break;
}