From 50109efd01cbc99589e79dd1da98178c727e698f Mon Sep 17 00:00:00 2001 From: Devin Lu Date: Tue, 10 Sep 2019 10:58:54 +0800 Subject: dratini: add batteries configuration Add batteries configuration as following: 1. LGC MPPHPPBC031C 2. Simplo 996QA182H BUG=b:140635151 BRANCH=none TEST=make buildall -j Change-Id: I69eb4b256127a3e7a53fed914406626b34460910 Signed-off-by: Devin Lu Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1792420 Tested-by: Philip Chen Reviewed-by: Tim Wawrzynczak Reviewed-by: Paul Fagerburg Reviewed-by: Scott Collyer Reviewed-by: Philip Chen Commit-Queue: Philip Chen --- board/dratini/battery.c | 74 +++++++++++++++++++++++++------------------------ board/dratini/board.h | 4 +-- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/board/dratini/battery.c b/board/dratini/battery.c index b81fa795b9..e4350c1e08 100644 --- a/board/dratini/battery.c +++ b/board/dratini/battery.c @@ -10,7 +10,7 @@ #include "util.h" /* - * Battery info for all Hatch battery types. Note that the fields + * Battery info for all Dratini/Dragonair battery types. Note that the fields * start_charging_min/max and charging_min/max are not used for the charger. * The effective temperature limits are given by discharging_min/max_c. * @@ -32,62 +32,64 @@ * address, mask, and disconnect value need to be provided. */ const struct board_batt_params board_battery_info[] = { - /* SMP LIS Dell FMXMT Battery Information */ - [BATTERY_SMP_LIS] = { + /* Simplo Coslight 996QA182H Battery Information */ + [BATTERY_SIMPLO_COS] = { .fuel_gauge = { - .manuf_name = "SMP-LIS3.78", + .manuf_name = "333-1C-13-A", .ship_mode = { .reg_addr = 0x0, - .reg_data = { 0x10, 0x10 }, + .reg_data = { 0x0010, 0x0010 }, }, .fet = { + .mfgacc_support = 1, .reg_addr = 0x0, - .reg_mask = 0x2000, - .disconnect_val = 0x2000, - } + .reg_mask = 0x0006, + .disconnect_val = 0x0, + }, }, .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, + .voltage_max = 13200, /* mV */ + .voltage_normal = 11550, /* mV */ + .voltage_min = 9000, /* mV */ + .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 = -10, + .discharging_max_c = 60, }, }, - /* SMP SDI Dell FMXMT Battery Information */ - [BATTERY_SMP_SDI] = { + /* LGC MPPHPPBC031C Battery Information */ + [BATTERY_LGC] = { .fuel_gauge = { - .manuf_name = "SMP-SDI-3727", + .manuf_name = "333-42-0D-A", .ship_mode = { .reg_addr = 0x0, - .reg_data = { 0x10, 0x10 }, + .reg_data = { 0x0010, 0x0010 }, }, .fet = { + .mfgacc_support = 1, .reg_addr = 0x0, - .reg_mask = 0x2000, - .disconnect_val = 0x2000, - } + .reg_mask = 0x0006, + .disconnect_val = 0x0006, + }, }, .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, + .voltage_max = 13200, /* mV */ + .voltage_normal = 11550, /* mV */ + .voltage_min = 9000, /* mV */ + .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 = -10, + .discharging_max_c = 60, }, }, }; BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT); -const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SMP_SDI; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SIMPLO_COS; diff --git a/board/dratini/board.h b/board/dratini/board.h index fb6946066a..824284471a 100644 --- a/board/dratini/board.h +++ b/board/dratini/board.h @@ -155,8 +155,8 @@ enum temp_sensor_id { /* List of possible batteries */ enum battery_type { - BATTERY_SMP_LIS, - BATTERY_SMP_SDI, + BATTERY_SIMPLO_COS, + BATTERY_LGC, BATTERY_TYPE_COUNT, }; -- cgit v1.2.1