summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrover Yen <Grover_Yen@wistron.com>2015-02-16 11:27:53 +0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-25 02:05:22 +0000
commit0f74dd091870cc0ba0c3ca45bc1f818e72458412 (patch)
tree31686959c5bc91705672b4260005cabe795f9385
parentee4d8db58939c2fbeb9535815c8195d34a268abd (diff)
downloadchrome-ec-0f74dd091870cc0ba0c3ca45bc1f818e72458412.tar.gz
lulu: 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: I301555ea6709e3450e79f10e57a0ea4ca8276553 Signed-off-by: Grover Yen <Grover_Yen@wistron.com> Reviewed-on: https://chromium-review.googlesource.com/250232 Reviewed-by: Mohammed Habibulla <moch@chromium.org>
-rw-r--r--board/lulu/battery.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/board/lulu/battery.c b/board/lulu/battery.c
index fbd4fb3f0a..dc3f4ca6d6 100644
--- a/board/lulu/battery.c
+++ b/board/lulu/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;
}