From f64353f1e582b6a70f4af97c07cdefe25ef0d87e Mon Sep 17 00:00:00 2001 From: Devin Lu Date: Fri, 19 Jul 2019 10:47:48 +0800 Subject: garg: add simplo BYD 916Q2294H battery BUG=b:135986521,b:136786005 BRANCH=octopus TEST=Test on charging/discharging/battery cut off pass. Change-Id: Idda1c4bc027b44980e047dc89ccae3c26e23cfbe Signed-off-by: Devin Lu Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1710208 Reviewed-by: Marco Chen (cherry picked from commit db49bc03b9b816e8c902a48478a18b9abe52b9a7) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715954 --- board/garg/battery.c | 35 ++++++++++++++++++++++++++++++++--- board/garg/board.h | 3 ++- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/board/garg/battery.c b/board/garg/battery.c index 70d6891d4f..119023877e 100644 --- a/board/garg/battery.c +++ b/board/garg/battery.c @@ -32,8 +32,8 @@ * address, mask, and disconnect value need to be provided. */ const struct board_batt_params board_battery_info[] = { - /* Simplo 916Q2286H battery information */ - [BATTERY_SIMPLO] = { + /* Simplo SDI 916Q2286H battery information */ + [BATTERY_SIMPLO_SDI] = { .fuel_gauge = { .manuf_name = "SMP-SDI3320", .ship_mode = { @@ -60,7 +60,36 @@ const struct board_batt_params board_battery_info[] = { .discharging_max_c = 60, }, }, + + /* Simplo BYD 916Q2294H battery information */ + [BATTERY_SIMPLO_BYD] = { + .fuel_gauge = { + .manuf_name = "SMP-LP485780", + .ship_mode = { + .reg_addr = 0x00, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .mfgacc_support = 1, + .reg_addr = 0x0, + .reg_mask = 0x0002, + .disconnect_val = 0x0, + }, + }, + .batt_info = { + .voltage_max = TARGET_WITH_MARGIN(13200, 5), /* mV */ + .voltage_normal = 11550, + .voltage_min = 9000, + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 45, + .discharging_min_c = -20, + .discharging_max_c = 60, + }, + }, }; BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT); -const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SIMPLO; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SIMPLO_SDI; diff --git a/board/garg/board.h b/board/garg/board.h index 0e614067a0..218f794b0d 100644 --- a/board/garg/board.h +++ b/board/garg/board.h @@ -99,7 +99,8 @@ enum sensor_id { /* List of possible batteries */ enum battery_type { - BATTERY_SIMPLO, + BATTERY_SIMPLO_SDI, + BATTERY_SIMPLO_BYD, BATTERY_TYPE_COUNT, }; -- cgit v1.2.1