summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2019-05-29 10:40:23 -0600
committerJustin TerAvest <teravest@chromium.org>2019-05-30 16:16:38 +0000
commit3568df5702a5da062eef8a0c41e7a3962ccf2d66 (patch)
tree566a4049b6b872153d61463b41d407a5fe6163bc
parent73e760fdaeb004f0fe978cbc8b0ea4bab7f19a58 (diff)
downloadchrome-ec-3568df5702a5da062eef8a0c41e7a3962ccf2d66.tar.gz
Prevent power on with disconnected battery
Currently, if a battery is disconnected but reporting a charge percentage over CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC, a system will be allowed to boot despite the battery not providing power yet. This change verifies that the battery is connected, as well as having a high enough charge percentage before allowing boot. BUG=b:133724948 BRANCH=octopus TEST=verified casta can power on once CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC is passed and battery is connected Change-Id: Ide9fe041a328bbeaeee8b9e7f9788b5731ac80ea Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1637296
-rw-r--r--common/charge_state_v2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index bd4bb81558..be0ac08cf3 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -2006,6 +2006,10 @@ int charge_prevent_power_on(int power_button_pressed)
defined(CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC)
else if (charge_manager_get_power_limit_uw() >=
CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT * 1000
+#ifdef CONFIG_BATTERY_REVIVE_DISCONNECT
+ && battery_get_disconnect_state() ==
+ BATTERY_NOT_DISCONNECTED
+#endif
&& (current_batt_params->state_of_charge >=
CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC))
prevent_power_on = 0;