From 6d286d157ca32f8c6a39e463ea26b01715b10750 Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Tue, 22 Aug 2017 10:28:33 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/627113 Commit-Ready: Scott Collyer Tested-by: Scott Collyer Reviewed-by: Aaron Durbin --- board/eve/battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/eve/battery.c') 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; -- cgit v1.2.1