diff options
author | Hsu Henry <Henry.Hsu@quantatw.com> | 2015-05-21 14:05:02 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-05-22 01:22:11 +0000 |
commit | 349aaa43da4a1453743fbc18eee32844bf641261 (patch) | |
tree | 6e024b661ecbb612cf0ca0c2c250abc9525a3d72 | |
parent | 6791ac717438ea7d53c640cb3c0f6da6f1114a59 (diff) | |
download | chrome-ec-349aaa43da4a1453743fbc18eee32844bf641261.tar.gz |
Cyan: add battery cutoff command
The battery of cyan only support specific shipmode command.
BUG=chrome-os-partner:40464
BRANCH=cyan
TEST=verify that "ectool batterycutoff" and "ectool batterycutoff
at-shutdown" are workable.
Change-Id: I48538d57eda77ae798b3b843252df297c2d8fa81
Signed-off-by: Henry Hsu <Henry.Hsu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/272414
Reviewed-by: Mohammed Habibulla <moch@google.com>
-rw-r--r-- | board/cyan/battery.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/board/cyan/battery.c b/board/cyan/battery.c index d0e9dc78e9..5c21d1d29b 100644 --- a/board/cyan/battery.c +++ b/board/cyan/battery.c @@ -8,8 +8,8 @@ #include "battery.h" #include "battery_smart.h" -/* Shutdown mode parameter to write to manufacturer access register */ -#define SB_SHUTDOWN_DATA 0x0010 +#define SB_SHIP_MODE_ADDR 0x3a +#define SB_SHIP_MODE_DATA 0xc574 static const struct battery_info info = { .voltage_max = 12600,/* mV */ @@ -31,13 +31,5 @@ const struct battery_info *battery_get_info(void) int board_cut_off_battery(void) { - int rv; - - /* Ship mode command must be sent twice to take effect */ - rv = sb_write(SB_MANUFACTURER_ACCESS, SB_SHUTDOWN_DATA); - - if (rv != EC_SUCCESS) - return rv; - - return sb_write(SB_MANUFACTURER_ACCESS, SB_SHUTDOWN_DATA); + return sb_write(SB_SHIP_MODE_ADDR, SB_SHIP_MODE_DATA); } |