summaryrefslogtreecommitdiff
path: root/include/peripheral_charger.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/peripheral_charger.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/peripheral_charger.h')
-rw-r--r--include/peripheral_charger.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/peripheral_charger.h b/include/peripheral_charger.h
index 1f7b3236f7..2ede2c6f2c 100644
--- a/include/peripheral_charger.h
+++ b/include/peripheral_charger.h
@@ -109,6 +109,8 @@ struct pchg_config {
const int i2c_port;
/* GPIO pin used for IRQ */
const enum gpio_signal irq_pin;
+ /* Full battery percentage */
+ const uint8_t full_percent;
};
/**