summaryrefslogtreecommitdiff
path: root/board/scarlet/battery.c
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2017-07-16 17:16:07 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-07-27 13:08:37 -0700
commit2fe0acefdd8293ca7e7f34ff6da5811b76e01c7d (patch)
treead410dbfaa0c6ebb616fc45a46dfb11cdb305da9 /board/scarlet/battery.c
parentfef7e102f606654cb72b5bd25555ffe90aab4f7f (diff)
downloadchrome-ec-2fe0acefdd8293ca7e7f34ff6da5811b76e01c7d.tar.gz
scarlet: Add rt946x charger for the new board
BUG=b:63739819 BRANCH=none TEST=build scarlet Change-Id: I8710412a591170d077dc217c192ec3b231e54659 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/573585 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'board/scarlet/battery.c')
-rw-r--r--board/scarlet/battery.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/board/scarlet/battery.c b/board/scarlet/battery.c
index 48e1f59c4c..03bcfc3a5e 100644
--- a/board/scarlet/battery.c
+++ b/board/scarlet/battery.c
@@ -9,6 +9,7 @@
#include "battery_smart.h"
#include "charge_state.h"
#include "console.h"
+#include "driver/charger/rt946x.h"
#include "ec_commands.h"
#include "extpower.h"
#include "util.h"
@@ -45,15 +46,7 @@ enum battery_present battery_is_present(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 EC_RES_ERROR;
-
- rv = sb_write(SB_MANUFACTURER_ACCESS, SB_SHUTDOWN_DATA);
- return rv ? EC_RES_ERROR : EC_RES_SUCCESS;
+ return rt946x_cutoff_battery();
}
enum battery_disconnect_state battery_get_disconnect_state(void)