summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2021-02-01 10:06:15 -0800
committerCommit Bot <commit-bot@chromium.org>2021-02-12 03:00:46 +0000
commiteb0d724fdf3e7ce15ac2b7c13403aefc355f718f (patch)
tree86575374d6ed7e6b8c3db10bd9ffdfd3091af827 /include/ec_commands.h
parent6776d3250648aab3c685c0a4de372094aba7d742 (diff)
downloadchrome-ec-eb0d724fdf3e7ce15ac2b7c13403aefc355f718f.tar.gz
pchg: Notify host of full charge
Currently, full charge status is implied by capacity = 100 and PCHG_STATE_DETECTED (i.e. state='not charging'). If the charger stops charging before 100% (for battery health control), this condition doesn't work. This patch makes PCHG send PCHG_STATE_FULL explicitly when it sees the soc goes above the threshold in PCHG_STATE_DETECTED. BUG=b:179390065,b:173235954 BRANCH=trogdor TEST=CoachZ. Charge till 96% and verify PCHG0/state becomes 'Full'. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I634f96992cdc7ef44b5e43544603cc5cc9b3a62d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2691366 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 8f4e313ee4..d1f03e516a 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -6811,6 +6811,8 @@ enum pchg_state {
PCHG_STATE_DETECTED,
/* Device is being charged. */
PCHG_STATE_CHARGING,
+ /* Device is fully charged. It implies DETECTED (& not charging). */
+ PCHG_STATE_FULL,
};
#define EC_PCHG_STATE_TEXT { \
@@ -6819,6 +6821,7 @@ enum pchg_state {
[PCHG_STATE_ENABLED] = "ENABLED", \
[PCHG_STATE_DETECTED] = "DETECTED", \
[PCHG_STATE_CHARGING] = "CHARGING", \
+ [PCHG_STATE_FULL] = "FULL", \
}
/*****************************************************************************/