summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTang Qijun <qijun.tang@ecs.corp-partner.google.com>2021-09-09 01:22:28 -0400
committerCommit Bot <commit-bot@chromium.org>2021-10-07 15:55:01 +0000
commit14891fcf8ac0ac2e1c72f5d22321c6b077ab2e53 (patch)
tree3a9987bf6d407e70f8918e47dfe99bc50b02266f /include
parent234e646fd807dc60f9af78c80db3edf8d5f93cee (diff)
downloadchrome-ec-14891fcf8ac0ac2e1c72f5d22321c6b077ab2e53.tar.gz
chgstv2: Implement battery protection for low voltage
Deep charge inspection is a battery protection mechanism: If battery voltage is lower than 6V, deep charge for more than 30 minutes The battery voltage is still lower than 6V, the system will stop charging BRANCH=trogdor BUG=b:198226241 TEST=run-sbs_charging_v2 Signed-off-by: Tang Qijun <qijun.tang@ecs.corp-partner.google.com> Change-Id: I89adf7809992b9e71b232ad1129af1407acf05a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3151037 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/charge_state.h5
-rw-r--r--include/config.h15
2 files changed, 20 insertions, 0 deletions
diff --git a/include/charge_state.h b/include/charge_state.h
index 0ab7ecd686..9349c3ea4c 100644
--- a/include/charge_state.h
+++ b/include/charge_state.h
@@ -82,6 +82,11 @@ enum charge_state {
enum charge_state charge_get_state(void);
/**
+ * Return current charge v2 state.
+ */
+__test_only enum charge_state_v2 charge_get_state_v2(void);
+
+/**
* Return non-zero if battery is so low we want to keep AP off.
*/
int charge_keep_power_off(void);
diff --git a/include/config.h b/include/config.h
index 71f649bbc9..9ce47f8287 100644
--- a/include/config.h
+++ b/include/config.h
@@ -610,6 +610,21 @@
#undef CONFIG_BATTERY_REVIVE_DISCONNECT
/*
+ * Low voltage protection for a battery (a.k.a. deep charge inspection):
+ * If battery voltage is lower than voltage_min, deep charge for more
+ * than precharge time The battery voltage is still lower than voltage_min,
+ * the system will stop charging
+ */
+#undef CONFIG_BATTERY_LOW_VOLTAGE_PROTECTION
+
+/*
+ * If battery voltage is lower than voltage_min, precharge voltage & current
+ * are supplied and charging will be disabled after
+ * CONFIG_BATTERY_LOW_VOLTAGE_TIMEOUT seconds.
+ */
+#define CONFIG_BATTERY_LOW_VOLTAGE_TIMEOUT (30*60*SECOND)
+
+/*
* Specify the battery percentage at which the host is told it is full.
* If this value is not specified the default is 97% set in battery.h.
*/