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>
This commit is contained in:
Philip Chen
2017-08-11 12:00:02 -07:00
committed by chrome-bot
parent add041bd7c
commit 321625dc11
2 changed files with 4 additions and 8 deletions

View File

@@ -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);

View File

@@ -235,12 +235,10 @@
#if defined(CONFIG_CHARGER_RT9466)
#define RT946X_CHARGER_NAME "rt9466"
#define RT946X_VENDOR_ID 0x80
#define RT946X_CHIP_REV 0x05
#define RT946X_ADDR (0x53 << 1)
#elif defined(CONFIG_CHARGER_RT9467)
#define RT946X_CHARGER_NAME "rt9467"
#define RT946X_VENDOR_ID 0x90
#define RT946X_CHIP_REV 0x05
#define RT946X_ADDR (0x5B << 1)
#endif