From 2a60f3ac95ad449fd073d0205d4ae73193a3171d Mon Sep 17 00:00:00 2001 From: Ting Shen Date: Tue, 6 Apr 2021 16:54:38 +0800 Subject: cherry: add battery BUG=b:181838424 TEST=1) EC console prints "found batt:LGC KT0030G020" 2) cutoff works BRANCH=main Signed-off-by: Ting Shen Change-Id: I903d0140e75a7877fa8ae6a8f04997f44989755b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2807249 Tested-by: Ting Shen Tested-by: Parker Lin Reviewed-by: Eric Yilun Lin Commit-Queue: Ting Shen --- board/cherry/battery.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'board/cherry/battery.c') diff --git a/board/cherry/battery.c b/board/cherry/battery.c index f07c38e1b8..f76af4d99b 100644 --- a/board/cherry/battery.c +++ b/board/cherry/battery.c @@ -14,34 +14,35 @@ #include "usb_pd.h" const struct board_batt_params board_battery_info[] = { - [BATTERY_C235] = { + [BATTERY_LGC_AP18C8K] = { .fuel_gauge = { - .manuf_name = "AS3GWRc3KA", - .device_name = "C235-41", + .manuf_name = "LGC KT0030G020", .ship_mode = { - .reg_addr = 0x0, - .reg_data = { 0x10, 0x10 }, + .reg_addr = 0x3A, + .reg_data = { 0xC574, 0xC574 }, }, .fet = { - .reg_addr = 0x99, - .reg_mask = 0x0c, - .disconnect_val = 0x0c, - } + .reg_addr = 0x43, + .reg_mask = 0x0001, + .disconnect_val = 0x0, + .cfet_mask = 0x0002, + .cfet_off_val = 0x0000, + }, }, .batt_info = { - .voltage_max = 8800, - .voltage_normal = 7700, - .voltage_min = 6000, - .precharge_current = 256, - .start_charging_min_c = 0, - .start_charging_max_c = 45, - .charging_min_c = 0, - .charging_max_c = 60, - .discharging_min_c = 0, - .discharging_max_c = 60, + .voltage_max = 13050, + .voltage_normal = 11250, + .voltage_min = 9000, + .precharge_current = 256, + .start_charging_min_c = 0, + .start_charging_max_c = 50, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = -20, + .discharging_max_c = 75, }, }, }; BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT); -const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_C235; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_LGC_AP18C8K; -- cgit v1.2.1