From 37099f548be3c5c8486bee51e724f5153d18a6c8 Mon Sep 17 00:00:00 2001 From: Yu-An Chen Date: Thu, 29 Oct 2020 08:33:08 +0800 Subject: Metaknight: Add battery PC-VP-BP144 Support new battery PC-VP-BP144 BUG=b:172390536 BRANCH=master TEST=Make sure battery can cutoff by console "cutoff" or "ectool batterycutoff" and resume by plug in adapter. Signed-off-by: yu-an.chen@quanta.corp-partner.google.com Change-Id: I11db98f37a27afd513a0f5adf04ff57a5eb2fbfe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2526040 Reviewed-by: Diana Z --- board/metaknight/battery.c | 40 +++++++++++++++++++++------------------- board/metaknight/board.h | 2 +- 2 files changed, 22 insertions(+), 20 deletions(-) (limited to 'board/metaknight') diff --git a/board/metaknight/battery.c b/board/metaknight/battery.c index 64af3b4302..9edc99b811 100644 --- a/board/metaknight/battery.c +++ b/board/metaknight/battery.c @@ -32,35 +32,37 @@ * address, mask, and disconnect value need to be provided. */ const struct board_batt_params board_battery_info[] = { - /* POW-TECH Battery Information */ - [BATTERY_POWER_TECH] = { + /* Simplo PC-VP-BP44 Battery Information */ + [BATTERY_SMP_PCVPBP144] = { .fuel_gauge = { - .manuf_name = "POW-TECH", + .manuf_name = "SIMPLO", + .device_name = "PC-VP-BP144", .ship_mode = { - .reg_addr = 0x0, - .reg_data = { 0x10, 0x10 }, + .reg_addr = 0x34, + .reg_data = { 0x0000, 0x1000 }, }, .fet = { .reg_addr = 0x00, - .reg_mask = 0x2000, - .disconnect_val = 0x2000, + .reg_mask = 0x10, + .disconnect_val = 0x00, + .cfet_mask = 0x08, + .cfet_off_val = 0x00, } }, .batt_info = { - .voltage_max = 8800, /* mV */ - .voltage_normal = 7700, - .voltage_min = 6000, - .precharge_current = 160, /* 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, + .voltage_max = 13050, /* mV */ + .voltage_normal = 11250, + .voltage_min = 9000, + .precharge_current = 128, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 60, + .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_POWER_TECH; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SMP_PCVPBP144; diff --git a/board/metaknight/board.h b/board/metaknight/board.h index 8ffbc4390e..a2b8d4a209 100644 --- a/board/metaknight/board.h +++ b/board/metaknight/board.h @@ -152,7 +152,7 @@ enum pwm_channel { /* List of possible batteries */ enum battery_type { - BATTERY_POWER_TECH, + BATTERY_SMP_PCVPBP144, BATTERY_TYPE_COUNT, }; -- cgit v1.2.1