summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrover Yen <Grover_Yen@wistron.com>2015-02-16 18:23:19 +0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-25 02:05:16 +0000
commitee4d8db58939c2fbeb9535815c8195d34a268abd (patch)
treee596505d9dbea21063a43dbdf300959fb9513c75
parent461499b2e99ea8bd7fa67d9f6dc7f606ee2e5154 (diff)
downloadchrome-ec-ee4d8db58939c2fbeb9535815c8195d34a268abd.tar.gz
cid: Implement battery cut-off function.
Modify cut-off command to meet battery spec. BUG=chrome-os-partner:37028 BRANCH=none TEST=Apply "batterycutoff" command of ectool to confirm. Change-Id: I09d60ac26edd52f266c4913dcd76e5dfc7841282 Signed-off-by: Grover Yen <Grover_Yen@wistron.com> Reviewed-on: https://chromium-review.googlesource.com/250227 Reviewed-by: Mohammed Habibulla <moch@chromium.org>
-rw-r--r--board/cid/battery.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/board/cid/battery.c b/board/cid/battery.c
index fbd4fb3f0a..dc3f4ca6d6 100644
--- a/board/cid/battery.c
+++ b/board/cid/battery.c
@@ -10,8 +10,8 @@
#include "gpio.h"
#include "host_command.h"
-#define SB_SHIP_MODE_ADDR 0x3a
-#define SB_SHIP_MODE_DATA 0xc574
+#define SB_SHIP_MODE_ADDR 0x00
+#define SB_SHIP_MODE_DATA 0x0010
/* Values for 54Wh 3UPF656790-1-T1001 battery */
static const struct battery_info info = {
@@ -38,5 +38,9 @@ const struct battery_info *battery_get_info(void)
int board_cut_off_battery(void)
{
- return sb_write(SB_SHIP_MODE_ADDR, SB_SHIP_MODE_DATA);
+ int rv;
+ rv = sb_write(SB_SHIP_MODE_ADDR, SB_SHIP_MODE_DATA);
+ if (!rv)
+ rv = sb_write(SB_SHIP_MODE_ADDR, SB_SHIP_MODE_DATA);
+ return rv;
}