summaryrefslogtreecommitdiff
path: root/board/eve/battery.c
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2017-08-22 10:28:33 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-08-23 21:17:22 -0700
commit6d286d157ca32f8c6a39e463ea26b01715b10750 (patch)
treec9e61c3c5a9718b75da95f03d799ba6972b88624 /board/eve/battery.c
parentc36102149845f7fb0238a0839f1e3fd96d89f0d7 (diff)
downloadchrome-ec-6d286d157ca32f8c6a39e463ea26b01715b10750.tar.gz
battery: Check physical battery presence before inhibiting power
In order to satisfy factory testing requirements we need to boot a bare board with just an AC adapter without requiring a power button. However we also don't want to always allow booting of the battery is present but cut-off (which will indicate BP_NO so we can't use the existing battery_is_present function) or has critically low level as it may not immediately boot. To accomplish this add a function that allows the board to specify a custom "hardware presence" for the battery that is separate from the battery presence check. This CL is taking a change done for Eve and pulling into TOT so it can be used for other projects that have the same requirements. https://chromium-review.googlesource.com/c/582544 BUG=b:63957122 BRANCH=none TEST=manual Change-Id: Ib1dc4f659adbf0eebd3dc8c3c61b39b8fa36cb4a Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/627113 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'board/eve/battery.c')
-rw-r--r--board/eve/battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/board/eve/battery.c b/board/eve/battery.c
index 0cb3a3bf1d..df0c976f7e 100644
--- a/board/eve/battery.c
+++ b/board/eve/battery.c
@@ -282,7 +282,7 @@ enum ec_status charger_profile_override_set_param(uint32_t param,
return EC_RES_INVALID_PARAM;
}
-static inline enum battery_present battery_hw_present(void)
+enum battery_present battery_hw_present(void)
{
/* The GPIO is low when the battery is physically present */
return gpio_get_level(GPIO_BATTERY_PRESENT_L) ? BP_NO : BP_YES;