diff options
author | Duncan Laurie <dlaurie@google.com> | 2017-07-23 00:46:11 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-07-24 23:58:28 +0000 |
commit | 6fd1980ef8b363443cf53bfa81690ea0b2dcc0dd (patch) | |
tree | 3bbd5ba0a27e0f4b9b60717c905761ae0ecec552 | |
parent | d373dc9c1c5812461a17cc9926322cf78f83b638 (diff) | |
download | chrome-ec-6fd1980ef8b363443cf53bfa81690ea0b2dcc0dd.tar.gz |
prevent_power_on: Wait for charge current to be initialized
When allowing an unlocked system to automatically power up we
may attempt to boot before the charger is ready to supply enough
power and get stuck in a reset loop.
By adding a final check to the charge_prevent_power_on() function
to ensure that charge_manager_get_charger_current() is returning
a valid value instead of CHARGE_CURRENT_UNINITIALIZED then the
board is able to reliably boot.
BUG=b:63957122
BRANCH=eve
TEST=manual testing on Eve to reliably boot without a battery
Change-Id: Ie7b5db49eb3a36dc3197731a383fba26db839610
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://chromium-review.googlesource.com/582545
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
-rw-r--r-- | common/charge_state_v2.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index d4a8cce9c4..f7ad95bb29 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -1021,6 +1021,14 @@ int charge_prevent_power_on(int power_button_pressed) )); #endif +#ifdef CONFIG_CHARGE_MANAGER + /* Always prevent power on until charge current is initialized */ + if (extpower_is_present() && + (charge_manager_get_charger_current() == + CHARGE_CURRENT_UNINITIALIZED)) + prevent_power_on = 1; +#endif + return prevent_power_on; } |