summaryrefslogtreecommitdiff
path: root/board/eldrid
diff options
context:
space:
mode:
authorScott Chao <scott_chao@wistron.corp-partner.google.com>2020-09-14 17:24:41 +0800
committerCommit Bot <commit-bot@chromium.org>2020-09-21 19:13:57 +0000
commitc6e2ac5ba87352505985c6f374c142fa6189b5ac (patch)
treeddbcfe88825a600ac79af706033c64de532dbbe5 /board/eldrid
parentdb78abe0160364bf075e1595850407dfdd182297 (diff)
downloadchrome-ec-c6e2ac5ba87352505985c6f374c142fa6189b5ac.tar.gz
eldrid: fix battery cutoff
Eldrid's battery need to apply charging voltage input>3V and aleast 2 sec to let C/D FET will turn on. So add board_battery_is_initialized to check battery initialization. And try to provide pre-charge current to battery when battery have no response. BUG=b:165780074 BRANCH=none TEST=make -j BOARD=eldrid TEST=make buildall Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Change-Id: I4265538b5a789b76a85d21a1459d19142a86106e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2409712 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/eldrid')
-rw-r--r--board/eldrid/battery.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/board/eldrid/battery.c b/board/eldrid/battery.c
index 01c2937fe0..3c9f2b0c21 100644
--- a/board/eldrid/battery.c
+++ b/board/eldrid/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"
@@ -92,3 +94,13 @@ 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_SIMPLO_HIGHPOWER;
+
+__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;
+}