summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorckkim <changkon12@gmail.com>2022-04-14 08:21:04 +0300
committerckkim <changkon12@gmail.com>2022-04-14 08:21:50 +0300
commit29f787efbf6f260db4dcb33b8124363d978f4226 (patch)
tree7bb57d5ffb54e2d951031780ada266f57b7dbfda
parentd100a7b2bda0863615d6a1a323b719951f045842 (diff)
downloadu-boot-odroidg12-v2015.01.tar.xz
ODROID-COMMON: Vu7c chipID check improvement.odroidg12-v2015.01
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);