summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2019-06-28 14:08:00 -0700
committerCommit Bot <commit-bot@chromium.org>2019-07-23 17:17:40 +0000
commitc36216efdf4ae6876273855067cf849a9776b97c (patch)
tree2e11c181376d631212f393b46d58c2d37dc71578
parentbaf1ebd8c80fd9e3793d193aaf1554cbcc8562df (diff)
downloadchrome-ec-c36216efdf4ae6876273855067cf849a9776b97c.tar.gz
servo_v4: Minor update the PD policy and comments
Update the PD policy and comments: * Only allow data role swap on DUT port; * Remove the dts mode condition to initiate a data role swap (not necessary to limit it to dts mode). BRANCH=servo BUG=b:135691171 TEST=Checked the CHG port is always UFP. TEST=Checked the DUT port is SRC/UFP, a data role swap happened (but it was initiated by DUT). Change-Id: I668703209301a9542e94768f31f6ce8e2d9eb0f4 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1682918 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> (cherry picked from commit 598c2c11d4024ed84fa1b185ef447c8a732c8535) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1686278
-rw-r--r--board/servo_v4/usb_pd_policy.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/board/servo_v4/usb_pd_policy.c b/board/servo_v4/usb_pd_policy.c
index 0ae2552e02..9a781c6534 100644
--- a/board/servo_v4/usb_pd_policy.c
+++ b/board/servo_v4/usb_pd_policy.c
@@ -632,23 +632,32 @@ int pd_check_power_swap(int port)
int pd_check_data_swap(int port, int data_role)
{
- /* Servo can allow data role swaps */
+ /*
+ * Servo should allow data role swaps to let DUT see the USB hub, but
+ * doing it on CHG port is a waste as its data lines is unconnected.
+ */
+ if (port == CHG)
+ return 0;
+
return 1;
}
void pd_execute_data_swap(int port, int data_role)
{
- /* Should we do something here? */
+ /*
+ * TODO(b/137887386): Turn on the fastboot/DFU path when data swap to
+ * DFP?
+ */
}
void pd_check_pr_role(int port, int pr_role, int flags)
{
/*
- * TODO(crosbug.com/p/60792): CHG port can't do a power swap as it's SNK
- * only. DUT port should be able to support a power role swap, but VBUS
- * will need to be present. For now, don't allow swaps on either port.
+ * Don't define any policy to initiate power role swap.
+ *
+ * CHG port is SNK only. DUT port requires a user to switch its
+ * role by commands. So don't do anything implicitly.
*/
-
}
void pd_check_dr_role(int port, int dr_role, int flags)
@@ -656,9 +665,8 @@ void pd_check_dr_role(int port, int dr_role, int flags)
if (port == CHG)
return;
- /* If DFP, try to switch to UFP */
- if ((flags & PD_FLAGS_PARTNER_DR_DATA) && dr_role == PD_ROLE_DFP &&
- !disable_dts_mode)
+ /* If DFP, try to switch to UFP, to let DUT see the USB hub. */
+ if ((flags & PD_FLAGS_PARTNER_DR_DATA) && dr_role == PD_ROLE_DFP)
pd_request_data_swap(port);
}