From 53a9890eb203d7f5ba88d4e94fd86b58c3d1a204 Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Wed, 9 Jan 2019 18:32:31 -0800 Subject: hatch: Fix battery name and add SMP-SDP battery support This CL fixes the manufacturer name field for the battery used in factory bring up and adds support for the battery being shipped with P0 units. BRANCH=none BUG=b:123244947 TEST=Verifed that both the battery used in the factory and that being shipped with P0 units are found at init time. Change-Id: I572879fc32aaf8aad8289fc52a385262ea61cdc2 Signed-off-by: Scott Collyer Reviewed-on: https://chromium-review.googlesource.com/1406495 Commit-Ready: Scott Collyer Tested-by: Scott Collyer Reviewed-by: Aseda Aboagye --- board/hatch/battery.c | 36 ++++++++++++++++++++++++++++++++---- board/hatch/board.h | 3 ++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/board/hatch/battery.c b/board/hatch/battery.c index ad8fe6c3d3..b81fa795b9 100644 --- a/board/hatch/battery.c +++ b/board/hatch/battery.c @@ -32,10 +32,38 @@ * address, mask, and disconnect value need to be provided. */ const struct board_batt_params board_battery_info[] = { - /* SMP Dell FMXMT Battery Information */ - [BATTERY_KEYSTONE] = { + /* SMP LIS Dell FMXMT Battery Information */ + [BATTERY_SMP_LIS] = { .fuel_gauge = { - .manuf_name = "SMP-LIS", + .manuf_name = "SMP-LIS3.78", + .ship_mode = { + .reg_addr = 0x0, + .reg_data = { 0x10, 0x10 }, + }, + .fet = { + .reg_addr = 0x0, + .reg_mask = 0x2000, + .disconnect_val = 0x2000, + } + }, + .batt_info = { + .voltage_max = 8800, + .voltage_normal = 7660, /* mV */ + .voltage_min = 6000, /* mV */ + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 60, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = 0, + .discharging_max_c = 60, + }, + }, + + /* SMP SDI Dell FMXMT Battery Information */ + [BATTERY_SMP_SDI] = { + .fuel_gauge = { + .manuf_name = "SMP-SDI-3727", .ship_mode = { .reg_addr = 0x0, .reg_data = { 0x10, 0x10 }, @@ -62,4 +90,4 @@ const struct board_batt_params board_battery_info[] = { }; BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT); -const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_KEYSTONE; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SMP_SDI; diff --git a/board/hatch/board.h b/board/hatch/board.h index ad665c6867..3cfc6aff0a 100644 --- a/board/hatch/board.h +++ b/board/hatch/board.h @@ -88,7 +88,8 @@ enum temp_sensor_id { /* List of possible batteries */ enum battery_type { - BATTERY_KEYSTONE, + BATTERY_SMP_LIS, + BATTERY_SMP_SDI, BATTERY_TYPE_COUNT, }; -- cgit v1.2.1