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 /include/battery.h | |
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 'include/battery.h')
-rw-r--r-- | include/battery.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/battery.h b/include/battery.h index b4b54bc72e..0ccd29319d 100644 --- a/include/battery.h +++ b/include/battery.h @@ -142,6 +142,14 @@ void battery_override_params(struct batt_params *batt); enum battery_present battery_is_present(void); /** + * Check for physical presence of battery. + * + * @return Whether there is a battery physically present, but possibly + * in a disconnected or cut off state, or if we can't tell; + */ +enum battery_present battery_hw_present(void); + +/** * Check for battery initialization status. * * @return zero if not initialized. |