diff options
author | Diana Z <dzigterman@chromium.org> | 2021-02-04 16:58:48 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-05 17:10:23 +0000 |
commit | b3f5b2b0dd38b5bf92eb14aa0a609142b9588f89 (patch) | |
tree | a4cbfb04abad06012a43e3b7319481615edc8479 /common/usbc | |
parent | 0dd8b63463bb45120625d3ca4e3dbc36824be352 (diff) | |
download | chrome-ec-b3f5b2b0dd38b5bf92eb14aa0a609142b9588f89.tar.gz |
TCPMv2: Consult board before setting power role swap request
If a board does not want to power role swap (ex. because it is in S5),
then do not allow the DPM request for the power role swap to be set.
This is equivalent to the logic done when a PR_SWAP message is received
by the system.
BRANCH=None
BUG=b:174726240
TEST=on madoo, plug in phone and shutdown. Verify DUT does not swap to
sourcing when in S5
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ia6684006d0de6d9f23bac8bd792c34191fabab14
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676931
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/usbc')
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index f8f07adf2a..c49ce15918 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -1710,6 +1710,10 @@ static void pe_update_src_pdo_flags(int port, int pdo_cnt, uint32_t *pdos) void pd_request_power_swap(int port) { + /* Ignore requests when the board does not wish to swap */ + if (!pd_check_power_swap(port)) + return; + /* * Always reset the SRC to SNK PR swap counter when a PR swap is * requested by policy. |