summaryrefslogtreecommitdiff
path: root/include/charge_state_v2.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2021-05-28 10:48:14 -0700
committerCommit Bot <commit-bot@chromium.org>2021-06-25 16:36:48 +0000
commit4f2e6792dd09c24805a0926c6239909b63acf1c5 (patch)
treea27d2f37f82c7bb08ca2eaec3fb649a5035f809b /include/charge_state_v2.h
parent594cd10300325d2ef983444218843098316acbeb (diff)
downloadchrome-ec-4f2e6792dd09c24805a0926c6239909b63acf1c5.tar.gz
Update EC_CMD_CHARGE_CONTROL to version 2
Version 2 of EC_CMD_CHARGE_CONTROL can control battery sustainer. It allows the host to set the upper and lower thresholds between which the EC tries to keep the battery state of charge. Version 2 of EC_CMD_CHARGE_CONTROL also supports 'GET' request. It allows the host to query the current charge control settings. localhost ~ # ectool chargecontrol Charge mode = NORMAL (0) Battery sustainer = off (-1% ~ -1%) localhost ~ # ectool chargecontrol normal 66 66 Charge state machine is in normal mode with sustainer enabled. localhost ~ # ectool chargecontrol Charge mode = NORMAL (0) Battery sustainer = on (66% ~ 66%) localhost ~ # ectool chargecontrol normal Charge state machine is in normal mode. BUG=b:188457962 BRANCH=none TEST=Atlas. See above. Change-Id: I81ec62172b4f159c46334fc0f940a2adae3f2b8a Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2929340 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/charge_state_v2.h')
-rw-r--r--include/charge_state_v2.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/charge_state_v2.h b/include/charge_state_v2.h
index df2d51cdb1..1bd64dec88 100644
--- a/include/charge_state_v2.h
+++ b/include/charge_state_v2.h
@@ -51,6 +51,11 @@ struct charge_state_data {
#endif
};
+struct sustain_soc {
+ int8_t lower;
+ int8_t upper;
+};
+
/**
* Set the output current limit and voltage. This is used to provide power from
* the charger chip ("OTG" mode).