summaryrefslogtreecommitdiff
path: root/driver/charger/rt946x.c
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2017-08-11 12:00:02 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-08-17 20:41:54 -0700
commit321625dc1144ca3efef715997a09794f9fd3e9fd (patch)
treed31b3a89e84b3e2d1de1496032404a025f528ef5 /driver/charger/rt946x.c
parentadd041bd7c86e6c3d1f60caeae78af2250e825a5 (diff)
downloadchrome-ec-321625dc1144ca3efef715997a09794f9fd3e9fd.tar.gz
charger/rt946x: Finish init no matter which CHIP REV it is
When booting scarlet rev1, the initialization of rt9466 is not finished because CHIP REV < 0x05. Actually, we shouldn't keep the latest CHIP REV in rt946x.h because it's hard to maintain. And we should try to finish rt946x_init() no matter what CHIP REV it is. Also, let's clean up the logging message in rt946x_init() a bit to make it clear that it's from RT946X. BUG=chromium:736821, b:63739819 BRANCH=none TEST=boot scarlet rev1 and confirm the initialization of rt946x is finished Change-Id: Ic0b1f837b801cc18744a1222794a055dfe8aa54c Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/612585 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver/charger/rt946x.c')
-rw-r--r--driver/charger/rt946x.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/driver/charger/rt946x.c b/driver/charger/rt946x.c
index e2957a1fca..590b542977 100644
--- a/driver/charger/rt946x.c
+++ b/driver/charger/rt946x.c
@@ -699,19 +699,17 @@ static void rt946x_init(void)
CPRINTF("RT946X incorrect ID: 0x%02x\n", reg);
return;
}
- CPRINTF("Device ID(0x%02X) found\n", RT946X_VENDOR_ID);
-
/* Check revision id */
- if (rt946x_chip_rev(&reg) || reg < RT946X_CHIP_REV) {
- CPRINTF("RT946X incorrect CHIP REV: 0x%02x\n", reg);
+ if (rt946x_chip_rev(&reg)) {
+ CPRINTF("Failed to read RT946X CHIP REV\n");
return;
}
+ CPRINTF("RT946X CHIP REV: 0x%02x\n", reg);
if (rt946x_init_setting())
return;
-
- CPRINTF("Device ID(0x%02X) initialized\n", RT946X_VENDOR_ID);
+ CPRINTF("RT946X initialized\n");
}
DECLARE_HOOK(HOOK_INIT, rt946x_init, HOOK_PRIO_LAST);