diff options
author | Alec Berg <alecaberg@chromium.org> | 2014-12-09 17:28:25 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-12-15 19:53:46 +0000 |
commit | 6cc992c3d703ecee5e44966a2a3f6580e85b60c3 (patch) | |
tree | aecb12c5e2cd96e1dd30ad1d00542aea0d8921bb /include/charge_state_v2.h | |
parent | 0777ebaef6ea1017b897cde65b2a9d1a39570089 (diff) | |
download | chrome-ec-6cc992c3d703ecee5e44966a2a3f6580e85b60c3.tar.gz |
samus: fix charge state machine's handling of low power chargers
On samus it is possible to have AC plugged in but have the battery
discharging. So, add a new variable to charge state machine for
battery charging status and use that where necessary. For example,
the low battery shutdown code should now be based on whether or
not battery is charging rather than if AC is present.
This also changes the hibernate behavior when battery is low. The
change is to wait 30 seconds in G3 of low battery with no charging
before hibernating because for some chargers, like a USB PD charger,
the charger may increase it's current limit after a little bit of
time.
BUG=chrome-os-partner:34485
BRANCH=samus
TEST=test on samus. use low power charger and make sure that
ectool battery shows the "DISCHARGING" flag. use zinger and see
"CHARGING" flag. also use power_supply_info to make sure that
the battery state accurately reflects reality.
Change-Id: I8ac0267dd393071c4ca1fa24fbc9a13bf27848a9
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/235491
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/charge_state_v2.h')
-rw-r--r-- | include/charge_state_v2.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/charge_state_v2.h b/include/charge_state_v2.h index b8503fcc9c..37b88326c9 100644 --- a/include/charge_state_v2.h +++ b/include/charge_state_v2.h @@ -27,6 +27,7 @@ enum charge_state_v2 { struct charge_state_data { timestamp_t ts; int ac; + int batt_is_charging; struct charger_params chg; struct batt_params batt; enum charge_state_v2 state; |