diff options
author | Philip Chen <philipchen@google.com> | 2017-08-16 13:49:30 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-08-18 14:27:19 -0700 |
commit | d2108bbcaa19260582d2cf6f2b5a19dd6a553c39 (patch) | |
tree | 50957b25648c5b03fac28f5c4b82b2324470c23b | |
parent | 20f05a34887345dc512c3d9aed8deb485018bb7c (diff) | |
download | chrome-ec-d2108bbcaa19260582d2cf6f2b5a19dd6a553c39.tar.gz |
battery/max17055: Wait longer for initial config
max17055 sometimes fails to finish configuration due to timeout.
Let's wait longer.
BUG=b:63870414
BRANCH=none
TEST=boot scarlet rev1 10 times and ensure MODELCFG.REFRESH bit is
cleared when retries value > 10.
Change-Id: I62984c19014a244a378180bab6683e2e6f842cd1
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/617653
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | driver/battery/max17055.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/driver/battery/max17055.c b/driver/battery/max17055.c index c676ce22a5..1814fc57ea 100644 --- a/driver/battery/max17055.c +++ b/driver/battery/max17055.c @@ -279,7 +279,7 @@ static int max17055_init_config(void) { int reg; int hib_cfg; - int retries = 20; + int retries = 50; if (max17055_write(REG_DESIGN_CAPACITY, BATTERY_MAX17055_DESIGNCAP) || max17055_write(REG_DQACC, BATTERY_MAX17055_DESIGNCAP / 32) || @@ -304,7 +304,7 @@ static int max17055_init_config(void) if (max17055_write(REG_MODELCFG, (MODELCFG_REFRESH | MODELCFG_VCHG))) return EC_ERROR_UNKNOWN; - /* Delay up to 200 ms until MODELCFG.REFRESH bit == 0. */ + /* Delay up to 500 ms until MODELCFG.REFRESH bit == 0. */ while (--retries) { if (max17055_read(REG_MODELCFG, ®)) return EC_ERROR_UNKNOWN; |