summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>2025-01-20 14:59:41 +1300
committerTom Rini <trini@konsulko.com>2025-01-26 11:33:13 -0600
commit0e4c345ecf653aab7684ef6ab0a9e794e8659f5f (patch)
treea88fe8f53030680e93f9e4ed63d3ccbe2fef6cd7 /drivers/rtc
parentd86da7e2bd6ae89360ff020565f9bf82712d688e (diff)
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>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/max313xx.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/rtc/max313xx.c b/drivers/rtc/max313xx.c
index ccfd6b6d0e2..2cb3f245041 100644
--- a/drivers/rtc/max313xx.c
+++ b/drivers/rtc/max313xx.c
@@ -308,6 +308,11 @@ static int max313xx_set_time(struct udevice *dev, const struct rtc_time *t)
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;
}