summaryrefslogtreecommitdiff
path: root/board/ge/common/ge_common.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-02-10 09:04:11 -0500
committerTom Rini <trini@konsulko.com>2020-02-10 09:04:11 -0500
commitc998cbea872f7ff9cc0a4887658112abe007bf94 (patch)
tree5ae0bc3544afea06c3cf41a96ff696fe6874b852 /board/ge/common/ge_common.c
parent2a1d54b37275a6358306456fb2b228ae872ed95d (diff)
parenta19d73708fc017475e5635b4809b6b07c6a61afd (diff)
Merge tag 'u-boot-imx-20200210' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
- Convert to DM: - bx50v3, mx53ppd, novena, mx6sabresd - Fixes for Xea Board - Toradex im8m Verdin - Cleanup (warp7, mx6sxsabresd) Travis : https://travis-ci.org/sbabic/u-boot-imx/builds/648131788
Diffstat (limited to 'board/ge/common/ge_common.c')
-rw-r--r--board/ge/common/ge_common.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/board/ge/common/ge_common.c b/board/ge/common/ge_common.c
index d7e21deca7..48c3778046 100644
--- a/board/ge/common/ge_common.c
+++ b/board/ge/common/ge_common.c
@@ -5,27 +5,24 @@
#include <common.h>
#include <env.h>
-#include <i2c.h>
+#include <dm/uclass.h>
#include <rtc.h>
void check_time(void)
{
+ struct udevice *dev;
int ret, i;
struct rtc_time tm;
u8 retry = 3;
- unsigned int current_i2c_bus = i2c_get_bus_num();
-
- ret = i2c_set_bus_num(CONFIG_SYS_RTC_BUS_NUM);
- if (ret < 0) {
+ ret = uclass_get_device(UCLASS_RTC, 0, &dev);
+ if (ret) {
env_set("rtc_status", "FAIL");
return;
}
- rtc_init();
-
for (i = 0; i < retry; i++) {
- ret = rtc_get(&tm);
+ ret = dm_rtc_get(dev, &tm);
if (!ret || ret == -EINVAL)
break;
}
@@ -40,7 +37,7 @@ void check_time(void)
tm.tm_year = 2036;
for (i = 0; i < retry; i++) {
- ret = rtc_set(&tm);
+ ret = dm_rtc_set(dev, &tm);
if (!ret)
break;
}
@@ -55,7 +52,5 @@ void check_time(void)
env_set("rtc_status", "2038");
else
env_set("rtc_status", "OK");
-
- i2c_set_bus_num(current_i2c_bus);
}