From ab99cceef9c19ea6499fccbf973195d07825c24d Mon Sep 17 00:00:00 2001 From: johnwc_yeh Date: Wed, 26 May 2021 16:45:55 +0800 Subject: cret: Modify three battery parameter Add three battery type for cret. And modify device name and device length to identify. 1. New battery type of manufacture name is same as BATTERY_BYD_1VX1H, BATTERY_SMP_ATL_VM732 and BATTERY_SMP_COS_VM732, so use device name to recognize. 2. The last three strings of the battery device name are the production date, need ignore,so modify the read length of the device name. BUG=b:183875170 BRANCH=dedede TEST=Battery can be found via EC log check and battery can be cutoff by ectool command. Signed-off-by: johnwc_yeh Change-Id: I1ab8116d8e6c41d3eeb48852058fbd71bee0eca6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2919151 Reviewed-by: Elthan Huang Reviewed-by: Aseda Aboagye Tested-by: Elthan Huang Commit-Queue: Aseda Aboagye --- board/cret/battery.c | 33 +++++++++++++++------------------ board/cret/board.h | 12 ++++++------ 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/board/cret/battery.c b/board/cret/battery.c index b3804d01af..f450f80a45 100644 --- a/board/cret/battery.c +++ b/board/cret/battery.c @@ -33,10 +33,10 @@ */ const struct board_batt_params board_battery_info[] = { /* BYD Battery Information */ - [BATTERY_BYD_1VX1HYMD] = { + [BATTERY_BYD_1VX1H] = { .fuel_gauge = { .manuf_name = "BYD", - .device_name = "1VX1HYMD", + .device_name = "DELL 1VX1H", .ship_mode = { .wb_support = 1, .reg_addr = 0x44, @@ -65,12 +65,11 @@ const struct board_batt_params board_battery_info[] = { }, /* BYD Battery Information */ - [BATTERY_BYD_X0Y5MYMD] = { + [BATTERY_BYD_X0Y5M] = { .fuel_gauge = { .manuf_name = "BYD", - .device_name = "X0Y5MYMD", + .device_name = "DELL X0Y5M", .ship_mode = { - .wb_support = 1, .reg_addr = 0x00, .reg_data = { 0x0010, 0x0010 }, }, @@ -190,10 +189,10 @@ const struct board_batt_params board_battery_info[] = { }, /* SMP-ATL Battery Information */ - [BATTERY_SMP_ATL_VM73297U] = { + [BATTERY_SMP_ATL_VM732] = { .fuel_gauge = { .manuf_name = "SMP-ATL-3.61", - .device_name = "VM73297U", + .device_name = "DELL VM732", .ship_mode = { .wb_support = 1, .reg_addr = 0x44, @@ -222,17 +221,16 @@ const struct board_batt_params board_battery_info[] = { }, /* SMP-ATL Battery Information */ - [BATTERY_SMP_ATL_RF9H3YMD] = { + [BATTERY_SMP_ATL_RF9H3] = { .fuel_gauge = { .manuf_name = "SMP-ATL-3.61", - .device_name = "RF9H3YMD", + .device_name = "DELL RF9H3", .ship_mode = { - .wb_support = 1, .reg_addr = 0x00, .reg_data = { 0x0010, 0x0010 }, }, .fet = { - .reg_addr = 0x41, + .reg_addr = 0x43, .reg_mask = 0x0001, .disconnect_val = 0x0000, .cfet_mask = 0x0002, @@ -254,10 +252,10 @@ const struct board_batt_params board_battery_info[] = { }, /* SMP-COS Battery Information */ - [BATTERY_SMP_COS_VM732835] = { + [BATTERY_SMP_COS_VM732] = { .fuel_gauge = { .manuf_name = "SMP-COS3.63", - .device_name = "VM732835", + .device_name = "DELL VM732", .ship_mode = { .wb_support = 1, .reg_addr = 0x44, @@ -286,17 +284,16 @@ const struct board_batt_params board_battery_info[] = { }, /* SMP-COS Battery Information */ - [BATTERY_SMP_COS_RF9H3YMD] = { + [BATTERY_SMP_COS_RF9H3] = { .fuel_gauge = { .manuf_name = "SMP-COS3.63", - .device_name = "RF9H3YMD", + .device_name = "DELL RF9H3", .ship_mode = { - .wb_support = 1, .reg_addr = 0x00, .reg_data = { 0x0010, 0x0010 }, }, .fet = { - .reg_addr = 0x41, + .reg_addr = 0x43, .reg_mask = 0x0001, .disconnect_val = 0x0000, .cfet_mask = 0x0002, @@ -439,4 +436,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_BYD_1VX1HYMD; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_BYD_1VX1H; diff --git a/board/cret/board.h b/board/cret/board.h index 5ddebc554c..cb61902d61 100644 --- a/board/cret/board.h +++ b/board/cret/board.h @@ -161,15 +161,15 @@ enum pwm_channel { /* List of possible batteries */ enum battery_type { - BATTERY_BYD_1VX1HYMD, - BATTERY_BYD_X0Y5MYMD, + BATTERY_BYD_1VX1H, + BATTERY_BYD_X0Y5M, BATTERY_LGC, BATTERY_SWD_ATL, BATTERY_SWD_COS, - BATTERY_SMP_ATL_VM73297U, - BATTERY_SMP_ATL_RF9H3YMD, - BATTERY_SMP_COS_VM732835, - BATTERY_SMP_COS_RF9H3YMD, + BATTERY_SMP_ATL_VM732, + BATTERY_SMP_ATL_RF9H3, + BATTERY_SMP_COS_VM732, + BATTERY_SMP_COS_RF9H3, BATTERY_BYD16, BATTERY_LGC3, BATTERY_SIMPLO, -- cgit v1.2.1