summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-10-17 09:32:44 -0600
committerCommit Bot <commit-bot@chromium.org>2019-10-23 18:19:39 +0000
commit0c9970ebeab1810667f49ebe6d7f3a14c5c7fe71 (patch)
tree296641c95ca3773ea8b82a657bb317aa7de0ad20 /common
parentbd751b403f996c603f28f20810a8fa2bf257553e (diff)
downloadchrome-ec-0c9970ebeab1810667f49ebe6d7f3a14c5c7fe71.tar.gz
usb: Remove invalid data role from enum
The data role as defined in the USB spec is 1 bit. Disconnected does not fit and no one is using it properly. All users of Disconnected value alias the value to DFP anyway. Just use DFP explicitly BRANCH=none BUG=none TEST=builds and runs new stack on hatch Change-Id: I5c7dddea8f34c8e3c524da8701913c87c23b42b2 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1865984
Diffstat (limited to 'common')
-rw-r--r--common/usb_pd_protocol.c7
-rw-r--r--common/usbc/usb_tc_drp_acc_trysrc_sm.c8
2 files changed, 10 insertions, 5 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index e06d424c39..266c83788b 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -818,10 +818,11 @@ static inline void set_state(int port, enum pd_states next_state)
pd_dfp_exit_mode(port, 0, 0);
#endif
/*
- * Indicate that the port is disconnected so the board
- * can restore state from any previous data swap.
+ * Indicate that the port is disconnected by setting role to
+ * DFP as SoCs have special signals when they are the UFP ports
+ * (e.g. OTG signals)
*/
- pd_execute_data_swap(port, PD_ROLE_DISCONNECTED);
+ pd_execute_data_swap(port, PD_ROLE_DFP);
#ifdef CONFIG_USBC_SS_MUX
usb_mux_set(port, TYPEC_MUX_NONE, USB_SWITCH_DISCONNECT,
pd[port].polarity);
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
index 15cc1e1f09..310ed0d76f 100644
--- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c
+++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
@@ -1649,8 +1649,10 @@ static void tc_unattached_snk_entry(const int port)
/*
* Indicate that the port is disconnected so the board
* can restore state from any previous data swap.
+ *
+ * NOTE: This is no-op change. This is cleaned up further in a child CL
*/
- pd_execute_data_swap(port, PD_ROLE_DISCONNECTED);
+ pd_execute_data_swap(port, PD_ROLE_DFP);
tc[port].next_role_swap = get_time().val + PD_T_DRP_SNK;
if (IS_ENABLED(CONFIG_USB_PE_SM)) {
@@ -2032,8 +2034,10 @@ static void tc_unattached_src_entry(const int port)
/*
* Indicate that the port is disconnected so the board
* can restore state from any previous data swap.
+ *
+ * NOTE: This is no-op change. This is cleaned up further in a child CL
*/
- pd_execute_data_swap(port, PD_ROLE_DISCONNECTED);
+ pd_execute_data_swap(port, PD_ROLE_DFP);
if (IS_ENABLED(CONFIG_USB_PE_SM)) {
tc[port].flags = 0;