diff options
author | Scott Collyer <scollyer@google.com> | 2017-08-22 10:28:33 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-08-23 21:17:22 -0700 |
commit | 6d286d157ca32f8c6a39e463ea26b01715b10750 (patch) | |
tree | c9e61c3c5a9718b75da95f03d799ba6972b88624 /board/reef_it8320/battery.c | |
parent | c36102149845f7fb0238a0839f1e3fd96d89f0d7 (diff) | |
download | chrome-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/reef_it8320/battery.c')
-rw-r--r-- | board/reef_it8320/battery.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/board/reef_it8320/battery.c b/board/reef_it8320/battery.c index 1745bf736b..1b16a672b2 100644 --- a/board/reef_it8320/battery.c +++ b/board/reef_it8320/battery.c @@ -516,7 +516,7 @@ static inline const struct board_batt_params *board_get_batt_params(void) DEFAULT_BATTERY_TYPE : board_battery_type]; } -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_EC_BATT_PRES_L) ? BP_NO : BP_YES; |