diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-03-01 11:13:30 -0800 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-03-05 10:26:21 -0800 |
commit | e60f1ab2246e2eac9b667690c39873baa974ab5b (patch) | |
tree | c3f4335919dce865d37f5e76c55c33177155b3b9 /include/charge_state.h | |
parent | 6971fd7a7f8a2351f011bdd60eabda664e0c3ba2 (diff) | |
download | chrome-ec-e60f1ab2246e2eac9b667690c39873baa974ab5b.tar.gz |
Give the AP 30 sec warning before shutting down due to low battery
This allows the AP to shut down cleanly. If it doesn't shut down in
that time period, the EC will forcibly shut it down.
BUG=chrome-os-partner:17124
BRANCH=link
TEST=manual
1. With system off,
- battfake 2 -> EC hibernates immediately
2. With system on,
- battfake 2 -> battery shutdown event posted to AP
- power off system manually within 30 sec -> EC hibernates
3. With system on,
- battfake 2 -> battery shutdown event posted to AP
- do not power off AP
- after 30 sec, EC shuts down AP then hibernates
4. With system on,
- battfake 2 -> battery shutdown event posted to AP
- after 15 sec, apply AC power
- system does NOT shut down
- remove AC power -> battery shutdown event posted to AP
(because battfake 2 is still faking 2% battery left)
- after 30 sec, EC shuts down AP then hibernates
(check to make sure the full 30 sec elapses; the timer
should have been restarted when AC power was removed;
if the EC shuts down the AP immediately this is a
failure indicating the timer is still running from
the first shutdown event)
Change-Id: I1a13765f501d705d3a580b2acbbb173d47e020ff
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44413
Diffstat (limited to 'include/charge_state.h')
-rw-r--r-- | include/charge_state.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/charge_state.h b/include/charge_state.h index 5f90de36fd..fcb68be89d 100644 --- a/include/charge_state.h +++ b/include/charge_state.h @@ -111,6 +111,7 @@ struct power_state_context { timestamp_t charger_update_time; timestamp_t trickle_charging_time; timestamp_t voltage_debounce_time; + timestamp_t shutdown_warning_time; int battery_present; }; |