diff options
author | Scott Collyer <scollyer@google.com> | 2021-02-26 09:39:27 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-20 23:27:05 +0000 |
commit | 602cf8193383c940dbf740d2dde03f9257cad9ba (patch) | |
tree | 60edbf371028425558c5d3a56eef76c3a989107e /include | |
parent | 2104092b713e81cae64d688290eca449924d292f (diff) | |
download | chrome-ec-602cf8193383c940dbf740d2dde03f9257cad9ba.tar.gz |
TCPMv2: PE: Add mechanism to request source power role
This CL makes the function pd_can_source_from_device()
overridable. This default implementation is used in deciding whether
to request a power role swap. By making this overridable, boards have
the option of implementing custom per port policy for requesting power
role swaps.
BUG=b:182441965
BRANCH=None
TEST=verfied that on quiche when attaching as a sink that a power role
swap request is generated. Previously, quiche relied on the host
requesting a power role swap.
Signed-off-by: Scott Collyer <scollyer@google.com>
Change-Id: I9c5bdb77405a6075de9c5b4269213f810a20cc6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2722989
Commit-Queue: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/usb_pd.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h index 534e0b7ceb..3337a9aa5c 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -1608,6 +1608,17 @@ void pd_vbus_low(int port); __override_proto int pd_check_power_swap(int port); /** + * Check if we are allowed to automatically be charging from port partner + * + * @param port USB-C port number + * @pdo_cnt number of source cap PDOs + * @*pdos pointer to source cap PDOs + * @return True if port partner can supply power + */ +__override_proto bool pd_can_source_from_device(int port, const int pdo_cnt, + const uint32_t *pdos); + +/** * Check if data swap is allowed. * * @param port USB-C port number |