diff options
author | Furquan Shaikh <furquan@google.com> | 2019-07-15 16:03:36 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-07-16 05:49:42 +0000 |
commit | 519b75782a709b5efc94a36fbbfcf74c415d39ad (patch) | |
tree | dacda925a4a5b8314d4e56cad6463021b5996449 /board/kohaku | |
parent | b95d79b7e496390f6c9cc6f0813685cce286132e (diff) | |
download | chrome-ec-519b75782a709b5efc94a36fbbfcf74c415d39ad.tar.gz |
kohaku: Always return BP_YES for battery presence for board id 1
For kohaku board id 1, there is a known issue which prevents in
getting battery presence signal correctly. This change returns BP_YES
if the board id reads out as 1. In all other cases, it returns
BP_NOT_SURE to allow baseboard to read gpio to determine battery
present state.
BUG=b:135278000
BRANCH=None
TEST=None
Change-Id: I882f05ddcf4e8a0127f336b4a524bf162ad796b5
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1702870
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: YongBeum Ha <ybha@samsung.com>
Reviewed-by: Philip Chen <philipchen@chromium.org>
Tested-by: YongBeum Ha <ybha@samsung.com>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'board/kohaku')
-rw-r--r-- | board/kohaku/battery.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/board/kohaku/battery.c b/board/kohaku/battery.c index 1014d7825d..6026d40d2b 100644 --- a/board/kohaku/battery.c +++ b/board/kohaku/battery.c @@ -7,6 +7,7 @@ #include "battery_fuel_gauge.h" #include "common.h" +#include "system.h" #include "util.h" /* @@ -63,3 +64,17 @@ 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_DYNA; + +enum battery_present variant_battery_present(void) +{ + if (system_get_board_version() != 1) + return BP_NOT_SURE; + + /* + * For board version 1, there is a known issue with battery present + * signal. So, always return BP_YES indicating battery is + * present. battery_status() later should fail to talk to the battery in + * case the battery is not really present. + */ + return BP_YES; +} |