From 8df230291a7dea06bc4b391caa8cb46a889893fe Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Tue, 15 Aug 2017 13:08:48 -0700 Subject: [PATCH] servo_v4: Tie data role preference to DTS mode setting When servo_v4 acts as a debug test system (DTS) its expected use case is for triggering CCD mode and Faft testing. To that end, its desired default data role is to be a UFP so that the enet and USB port are accessible by the DUT. However, when servo is acting a regular SRC port, it makes more sense for the data role pairing to be consistent with a normal SRC port device which is SRC/DFP. BUG=b:64720447 BRANCH=servo TEST=Tested with Eve using twinkie USB PD analyzer. Verified that when DTS mode is enabled a data role swap request is sent to the DUT and when DTS mode is disabled that servo_v4 does not send a data role swap request. Change-Id: I071f85fc99f1c877d86ef48ec7fa38d6850d5679 Signed-off-by: Scott Collyer Reviewed-on: https://chromium-review.googlesource.com/615813 Commit-Ready: Scott Collyer Tested-by: Scott Collyer Reviewed-by: Nick Sanders --- board/servo_v4/usb_pd_policy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/servo_v4/usb_pd_policy.c b/board/servo_v4/usb_pd_policy.c index 011994a2c9..224ca7396a 100644 --- a/board/servo_v4/usb_pd_policy.c +++ b/board/servo_v4/usb_pd_policy.c @@ -499,7 +499,8 @@ void pd_check_dr_role(int port, int dr_role, int flags) return; /* If DFP, try to switch to UFP */ - if ((flags & PD_FLAGS_PARTNER_DR_DATA) && dr_role == PD_ROLE_DFP) + if ((flags & PD_FLAGS_PARTNER_DR_DATA) && dr_role == PD_ROLE_DFP && + !disable_dts_mode) pd_request_data_swap(port); }