diff options
author | Jett Rink <jettrink@chromium.org> | 2019-10-17 09:33:31 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-24 18:01:17 +0000 |
commit | e248f208ab8a55667bfe60ce48a188fc1a4620cc (patch) | |
tree | 2b3955afb2a53432c09467998e930407a47f02c1 /common/usb_pd_protocol.c | |
parent | 39f7d5d0e5c3ae72b9837a676fac401dfe51e745 (diff) | |
download | chrome-ec-e248f208ab8a55667bfe60ce48a188fc1a4620cc.tar.gz |
cleanup: clean up reference to power role vs cable plug
The PD header specifies the power role for SOP packets and cable plug for
SOP' and SOP" packets. Refactor code to make this more obvious.
BRANCH=none
BUG=none
TEST=builds and new stack runs on hatch
Change-Id: I6cdb1561082d2142214ac65703ff42586b16d70b
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1865986
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r-- | common/usb_pd_protocol.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 266c83788b..1ce06d9260 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -2212,10 +2212,14 @@ static void pd_vdm_send_state_machine(int port) if (is_sop_prime_ready(port, pd[port].data_role, pd[port].flags)) { /* Prepare SOP'/SOP'' header and send VDM */ - header = PD_HEADER(PD_DATA_VENDOR_DEF, PD_PLUG_DFP_UFP, - 0, pd[port].msg_id, - (int)pd[port].vdo_count, - pd_get_rev(port), 0); + header = PD_HEADER( + PD_DATA_VENDOR_DEF, + PD_PLUG_FROM_DFP_UFP, + 0, + pd[port].msg_id, + (int)pd[port].vdo_count, + pd_get_rev(port), + 0); res = pd_transmit(port, TCPC_TX_SOP_PRIME, header, pd[port].vdo_data); /* |