From 9d89fa5ec5cc6d2aa5495e56367d48cc044c4934 Mon Sep 17 00:00:00 2001 From: Baohong Liu Date: Thu, 3 Nov 2016 15:14:06 -0700 Subject: [PATCH] drivers: rtc: Add delay to wait for new config to take effect Add delay to wait for new configuration to take effect before returning to API caller. It takes time for any change to rtc configuration to take effect since rtc runs under a much slower clock. Of course, we do not have an equation for best wait time. The value is based on the test results on arduino 101, minfield and quark se c1000 devboard(some margin added). Jira: ZEP-991 Change-Id: I0dcee3c5809963dcd418186b85e3473427a4d526 Signed-off-by: Baohong Liu --- drivers/rtc/rtc_qmsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rtc/rtc_qmsi.c b/drivers/rtc/rtc_qmsi.c index 9065af5e9e2..8e7a3ae2386 100644 --- a/drivers/rtc/rtc_qmsi.c +++ b/drivers/rtc/rtc_qmsi.c @@ -142,6 +142,8 @@ static int rtc_qmsi_set_config(struct device *dev, struct rtc_config *cfg) rtc_critical_region_end(dev); + k_busy_wait(60); + return result; }