From b38a6dcd377d67c281adeaa1a700ac6973b09b5c Mon Sep 17 00:00:00 2001 From: "amber.chen" Date: Fri, 18 Dec 2020 13:58:21 +0800 Subject: lillipup: fix Dut can't wake battery up from shutdown mode 1. Override "board_battery_is_initialized" to report correct battery initial state. That's same as eldrid board. 2. Once return BP_NOT_SURE for uninitialized battery, EC may require pre-charge current to wake battery up. 3. It shouldn't keep return BP_NO that it may cause EC not to set pre-charge current and cause battery keep in shutdown mode. BUG=b:175767091 BRANCH=firmware-volteer-13521.B TEST=make buildall, Verify battery which is under shutdown mode and wake it up. Signed-off-by: amber.chen Change-Id: I8b4736553224cf59ac098d41f615742590ef4a20 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597134 Reviewed-by: Zhuohao Lee (cherry picked from commit 23f7201a183a51843176df8b8d9309fc34cdefbd) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2598306 Tested-by: jerry2.huang Commit-Queue: Zhuohao Lee --- board/lindar/battery.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/board/lindar/battery.c b/board/lindar/battery.c index 7f37c6fe10..503b2f11c0 100644 --- a/board/lindar/battery.c +++ b/board/lindar/battery.c @@ -5,7 +5,9 @@ * Battery pack vendor provided charging profile */ +#include "battery.h" #include "battery_fuel_gauge.h" +#include "battery_smart.h" #include "common.h" #include "util.h" @@ -121,3 +123,14 @@ 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_SMP; + +__override bool board_battery_is_initialized(void) +{ + bool batt_initialization_state; + int batt_status; + + batt_initialization_state = (battery_status(&batt_status) ? false : + !!(batt_status & STATUS_INITIALIZED)); + return batt_initialization_state; +} + -- cgit v1.2.1