diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-10-08 10:07:17 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-17 03:13:01 +0000 |
commit | 3a8f417306a69e12794b38ea2a01d2f1cc7eb5f5 (patch) | |
tree | f4c3a9a2c1e69ad15ff02b47e43b4c68973ba78b /include/usb_pd.h | |
parent | fca847fa644cfeb5182801a9dde08c0260faa05b (diff) | |
download | chrome-ec-3a8f417306a69e12794b38ea2a01d2f1cc7eb5f5.tar.gz |
TCPMv2: Use a common function to check if the battery is capable
Move the battery checks to a common function, which is used to enable
Try.SRC and enable PD comm for CONFIG_SYSTEM_LOCKED.
BRANCH=None
BUG=b:169453974
TEST=On a board with battery which takes longer time to enable its
discharge FET, cut off the battery and booted the board. Checked
on startup the Try.SRC was disabled and the PD comm was disabled.
When the battery discharge FET became active, PD comm was enabled.
Change-Id: I236d5f8a462ece056b4adedd0b6e6ef1e402966c
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2461942
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include/usb_pd.h')
-rw-r--r-- | include/usb_pd.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h index 46222ea14a..0fea201e9e 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -995,8 +995,17 @@ enum pd_data_role pd_get_data_role(int port); */ enum pd_power_role pd_get_power_role(int port); -/* - * Return true if PD is capable of trying as source else false +/** + * Check if the battery is capable of powering the system + * + * @return true if capable of, else false. + */ +bool pd_is_battery_capable(void); + +/** + * Check if PD is capable of trying as source + * + * @return true if capable of, else false. */ bool pd_is_try_source_capable(void); |