summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorckkim <changkon12@gmail.com>2022-04-14 08:21:04 +0300
committerChris <codewalker@hardkernel.com>2022-07-19 10:49:53 +0300
commit1a48a9807c9fe5b914fd36bd4c31ecb7b539cf7e (patch)
tree78f5923249326c66ac56cc3cf61b68e38dd5da86
parent1749c40a5a7fafd39ff93e3412ba000bdb9ebd84 (diff)
downloadu-boot-1a48a9807c9fe5b914fd36bd4c31ecb7b539cf7e.tar.xz
ODROID-COMMON: Vu7c chipID check improvement.odroidg12-v2015.01-20210329
Signed-off-by: ckkim <changkon12@gmail.com> Change-Id: I76ce485340f44139399d476226e7e878a0c58a45
-rwxr-xr-xboard/hardkernel/odroid-common/lt8619c.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/board/hardkernel/odroid-common/lt8619c.c b/board/hardkernel/odroid-common/lt8619c.c
index efd1849749..0ddbebfae0 100755
--- a/board/hardkernel/odroid-common/lt8619c.c
+++ b/board/hardkernel/odroid-common/lt8619c.c
@@ -121,8 +121,10 @@ static int lt8619c_reg_write(uint8_t reg, uint8_t data)
outbuf[0] = reg;
outbuf[1] = data;
- if (aml_i2c_xfer(&msg, 1) != 1)
+ if (aml_i2c_xfer(&msg, 1) != 1) {
printf("i2c 0x%02x 0x%02x write failed\n", reg, data);
+ return -1;
+ }
return 0;
}
@@ -150,7 +152,8 @@ static bool lt8619c_check_chipid(void)
{
unsigned int chip_id[3];
- lt8619c_reg_write(0xff, 0x60);
+ if (lt8619c_reg_write(0xff, 0x60) < 0)
+ return false;
chip_id[0] = lt8619c_reg_read(0x00);
chip_id[1] = lt8619c_reg_read(0x01);