From 9ebaece91b94f42bcb2b9c94af5fe2e328d3bca2 Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Tue, 15 May 2018 08:44:08 -0700 Subject: [PATCH] bip: Add support for Sanyo AC15A3J battery For Bip P0, we are using some of the Sanyo batteries. Need to add support in battery.c/board.h so this battery is recognized and battery disconnect and cutoff functions are supported. BRANCH=none BUG=b:79734977 TEST=Verfied Sanyo battery is found at EC init time and that 'cuttof' EC console command works. Change-Id: I4b69296869e1eed6248800eb4b7b3c35a79bae4c Signed-off-by: Scott Collyer Reviewed-on: https://chromium-review.googlesource.com/1059935 Commit-Ready: Scott Collyer Tested-by: Scott Collyer Reviewed-by: Jett Rink --- board/bip/battery.c | 28 ++++++++++++++++++++++++++++ board/bip/board.h | 1 + 2 files changed, 29 insertions(+) diff --git a/board/bip/battery.c b/board/bip/battery.c index 550c7b2a24..584584af32 100644 --- a/board/bip/battery.c +++ b/board/bip/battery.c @@ -59,6 +59,34 @@ const struct board_batt_params board_battery_info[] = { .discharging_max_c = 60, }, }, + + /* SANYO AC15A3J Battery Information */ + [BATTERY_SANYO] = { + .fuel_gauge = { + .manuf_name = "SANYO", + .ship_mode = { + .reg_addr = 0x3A, + .reg_data = { 0xC574, 0xC574 }, + }, + .fet = { + .reg_addr = 0x0, + .reg_mask = 0x4000, + .disconnect_val = 0x0, + } + }, + .batt_info = { + .voltage_max = TARGET_WITH_MARGIN(13200, 5), + .voltage_normal = 11550, /* mV */ + .voltage_min = 9000, /* mV */ + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 50, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = 0, + .discharging_max_c = 60, + }, + }, }; BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT); diff --git a/board/bip/board.h b/board/bip/board.h index 2a9310ed48..6db1145b3a 100644 --- a/board/bip/board.h +++ b/board/bip/board.h @@ -30,6 +30,7 @@ enum adc_channel { /* List of possible batteries */ enum battery_type { BATTERY_PANASONIC, + BATTERY_SANYO, BATTERY_TYPE_COUNT, };