summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Fagerburg <pfagerburg@chromium.org>2019-11-13 14:00:37 -0700
committerCommit Bot <commit-bot@chromium.org>2019-11-15 22:35:17 +0000
commit5e182ed5f641d42dc43fe2c897bf91d47f6470f8 (patch)
treea9b075e0bd63ca15f8e10aeea28445f6b07eecce /include
parent24eb7b805927e482d2cbdca2505734e6ae64700c (diff)
downloadchrome-ec-5e182ed5f641d42dc43fe2c897bf91d47f6470f8.tar.gz
chgstv2: stop charging when battery temp exceeds specs
Add a check for the battery temperature in the safe range to charge the battery, and if it isn't, stop charging. The battery information defines minimum and maximum temperatures for discharge and for charge. The state machine already checks if the battery temperature is outside of the range for discharge (as part of is_battery_critical) and will shut down the system completely if the battery temperature is out of range. However, the temperature range for charging is usually tigheter than for discharging, and it can be safe to discharge, but unsafe to charge. For example, Kohaku specifies a maximum charge temperature of 55 C, and a maximum discharge temperature of 60 C. If the battery is at 57 C, we don't want to charge, but it's still OK to use the system. The check is enabled by CONFIG_BATTERY_CHECK_CHARGE_TEMP_LIMITS. BUG=b:140596424 BRANCH=None TEST=`make buildall -j` builds with no errors. No boards have enabled CONFIG_BATTERY_CHECK_CHARGE_TEMP_LIMITS, so no effect. Change-Id: I3b76eab942ca3ef3871f0909395e91634db5640e Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1914510 Reviewed-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index 921eb0f4c9..cc12e94673 100644
--- a/include/config.h
+++ b/include/config.h
@@ -496,6 +496,9 @@
/* Perform a battery cut-off when we reach the battery critical level */
#undef CONFIG_BATTERY_CRITICAL_SHUTDOWN_CUT_OFF
+/* If the battery is too hot or too cold, stop charging */
+#undef CONFIG_BATTERY_CHECK_CHARGE_TEMP_LIMITS
+
/*
* Support battery cut-off as host command and console command.
*