From 6971fd7a7f8a2351f011bdd60eabda664e0c3ba2 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Thu, 28 Feb 2013 13:56:02 -0800 Subject: After shutting down AP, hibernate EC if battery is low This preserves more battery for the real-time clock. It also gets rid of one battery level/state, since the EC will now shut down at the same level (2%) as the AP. Having the EC hibernate at the same level as the AP shuts down also prevents the following weird scenario: - EC powers on at 2% battery. - EC won't power on the AP to do software sync because battery is low. - But the charge state machine won't actually hibernate the EC until 1%. - Between 2% and 1%, AC is inserted and system starts charging. - But EC-RO is what's doing the charging; we should go through software sync before charging. BUG=chrome-os-partner:17124 BRANCH=link TEST=manual On battery power, 1) With system on, battfake 2 -> system shuts down and EC hibernates 2) With system off, battfake 2 -> EC hibernates Change-Id: I87d17f70d60673f3e3f1c6eb88f3f00a8c9ed4e7 Signed-off-by: Randall Spangler Reviewed-on: https://gerrit.chromium.org/gerrit/44314 --- include/battery.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/battery.h b/include/battery.h index da4071e158..50b4e53f7c 100644 --- a/include/battery.h +++ b/include/battery.h @@ -23,10 +23,11 @@ * level. */ #define BATTERY_LEVEL_CRITICAL 5 -/* Shut down main processor when discharging and battery level < this level */ +/* + * Shut down main processor and/or hibernate EC when discharging and battery + * level < this level. + */ #define BATTERY_LEVEL_SHUTDOWN 3 -/* Hibernate EC immediately when discharging and battery level < this level */ -#define BATTERY_LEVEL_HIBERNATE_EC 2 #endif /* __CROS_EC_BATTERY_H */ -- cgit v1.2.1