summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2017-07-23 00:38:08 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-07-24 23:58:16 +0000
commit29cdaa92b508032808d0c0ec98820a81983a6286 (patch)
tree848543f25513c076ae545a7cc866f48f38ffb1b4
parent9136688fb73cd5f3bfa7e26d8ee7156739568937 (diff)
downloadchrome-ec-29cdaa92b508032808d0c0ec98820a81983a6286.tar.gz
eve: Cut off critically low battery
Instead of going to hibernate when the battery is critically low we should cut off power entirely. Even with the PMIC shut down the H1 chip consumes more power than is healthy when the battery is already critically low, depleting it to dangerously low voltage levels faster than it should. BUG=b:63957122 BRANCH=eve TEST=manual testing on Eve with critically low battery to ensure that it is cut off instead of going into hibernate. Change-Id: I2eaba3623385a4eb3daa39a2fa8aa08d3ec6366e Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/582543 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
-rw-r--r--board/eve/board.h1
-rw-r--r--common/charge_state_v2.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/board/eve/board.h b/board/eve/board.h
index 01675f44de..be9f0a9ac3 100644
--- a/board/eve/board.h
+++ b/board/eve/board.h
@@ -73,6 +73,7 @@
#undef CONFIG_PECI
/* Battery */
+#define CONFIG_BATTERY_CRITICAL_SHUTDOWN_CUT_OFF
#define CONFIG_BATTERY_CUT_OFF
#define CONFIG_BATTERY_DEVICE_CHEMISTRY "LION"
#define CONFIG_BATTERY_PRESENT_CUSTOM
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index 7464e446fc..d2163cd876 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -539,15 +539,15 @@ static void shutdown_on_critical_battery(void)
} else if (get_time().val > shutdown_warning_time.val +
CRITICAL_BATTERY_SHUTDOWN_TIMEOUT_US) {
if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) {
-#ifdef CONFIG_HIBERNATE
+#ifdef CONFIG_BATTERY_CRITICAL_SHUTDOWN_CUT_OFF
+ CPRINTS(
+ "charge force battery cut-off due to critical level");
+ board_cut_off_battery();
+#elif defined(CONFIG_HIBERNATE)
/* Timeout waiting for charger to provide more power */
CPRINTS(
"charge force EC hibernate due to critical battery");
system_hibernate(0, 0);
-#elif defined(CONFIG_BATTERY_CRITICAL_SHUTDOWN_CUT_OFF)
- CPRINTS(
- "charge force battery cut-off due to critical level");
- board_cut_off_battery();
#endif
} else {
/* Timeout waiting for AP to shut down, so kill it */