summaryrefslogtreecommitdiff
path: root/include/charge_state.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-03-01 11:13:30 -0800
committerRandall Spangler <rspangler@chromium.org>2013-03-05 15:43:06 -0800
commit30c7f6f0a52d7b0f1878c0dfbfbe633f55efd7db (patch)
treeb7887889831efd9f0cdcd3a93a673dfc8f93930d /include/charge_state.h
parentac05ba645e813d5a77af63cf031fd547ecf49ba5 (diff)
downloadchrome-ec-30c7f6f0a52d7b0f1878c0dfbfbe633f55efd7db.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) Original-Change-Id: I1a13765f501d705d3a580b2acbbb173d47e020ff Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/44413 (cherry picked from commit e60f1ab2246e2eac9b667690c39873baa974ab5b) Conflicts: common/charge_state.c Change-Id: I2033a50d302e63dbaa368e8f980f9a1b41bedee4 Reviewed-on: https://gerrit.chromium.org/gerrit/44693 Commit-Queue: Randall Spangler <rspangler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/charge_state.h')
-rw-r--r--include/charge_state.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/charge_state.h b/include/charge_state.h
index 285164c75a..4dcc7cdfa0 100644
--- a/include/charge_state.h
+++ b/include/charge_state.h
@@ -117,6 +117,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;
};