summaryrefslogtreecommitdiff
path: root/include/battery.h
diff options
context:
space:
mode:
authorDave Parker <dparker@google.com>2014-06-12 20:31:26 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-15 01:45:21 +0000
commitefd3a8925eecce4559d8c81175258d5974140db6 (patch)
tree091fee596c1c03a2cd3ea248e3f5cc199557240a /include/battery.h
parenta0119238c7e398135c2b8e4fbb06ba81d4a6a494 (diff)
downloadchrome-ec-efd3a8925eecce4559d8c81175258d5974140db6.tar.gz
Add 'at-shutdown' option to batterycutoff host command
If at-shutdown is specified, the battery is cut off 1 seconds after the host has shutdown. BUG=chrome-os-partner:29292,chrome-os-partner:28887 BRANCH=tot,nyan TEST=Run batterycutoff ectool command and cutoff console command with and without 'at-shutdown' option. Verify the battery is cut off immediately without the option specified and 1 seconds after shutdown with. View the console log to see the deferred cutoff occur. The following tests are verified on big. console: cutoff, AC on: system is off after removing AC. cutoff, AC off: system is off immediately. at-shutdown, AC on: system is off after "power off" and removing AC. at-shutdown, AC off: system is off after "power off". ectool: batterycutoff, AC on: system is off after removing AC. batterycutoff, AC off: system is off immediately. at-shutdown, AC on: battery is cut off after 1s of shutdown. system is off right after removing AC power. at-shutdown, AC off: system is off after 1s of shutdown. [84.058416 power state 3 = S0, in 0x0000] [84.058803 power lost input; wanted 0x0001, got 0x0000] [84.059120 power off 3] [84.072148 Cutting off battery in 1 second(s)] [84.123896 power shutdown complete] [84.128790 power state 7 = S0->S3, in 0x0002] [84.139694 power state 2 = S3, in 0x0002] [84.150857 power state 8 = S3->S5, in 0x0002] [84.166975 power state 1 = S5, in 0x0002] [84.177972 power state 1 = S5, in 0x0002] [85.080012 Battery cut off succeeded.] Change-Id: Id4bacf79ad3add885260655f80cb8127bafe1ad6 Signed-off-by: Dave Parker <dparker@google.com> Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/203694 Reviewed-by: Vic Yang <victoryang@chromium.org>
Diffstat (limited to 'include/battery.h')
-rw-r--r--include/battery.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/battery.h b/include/battery.h
index b61da1833c..898e3da403 100644
--- a/include/battery.h
+++ b/include/battery.h
@@ -43,6 +43,12 @@ enum battery_present {
BP_NOT_SURE,
};
+enum battery_cutoff_states {
+ BATTERY_CUTOFF_STATE_NORMAL = 0,
+ BATTERY_CUTOFF_STATE_CUT_OFF,
+ BATTERY_CUTOFF_STATE_PENDING,
+};
+
/* Battery parameters */
struct batt_params {
int temperature; /* Temperature in 0.1 K */