summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/usbc/usb_tc_drp_acc_trysrc_sm.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
index c56bcd2b81..1049326e42 100644
--- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c
+++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
@@ -2979,11 +2979,23 @@ static void tc_attached_src_entry(const int port)
* completed and tc_pr_swap_complete is called.
*/
} else {
+ /*
+ * Set up CC's, Vconn, and ADD before Vbus, as per
+ * Figure 4-24. DRP Initialization and Connection
+ * Detection in TCPCI r2 v1.2 specification.
+ */
+
/* Get connector orientation */
tcpm_get_cc(port, &cc1, &cc2);
tc[port].polarity = get_src_polarity(cc1, cc2);
pd_set_polarity(port, tc[port].polarity);
+ /* Attached.SRC - enable AutoDischargeDisconnect */
+ tcpm_enable_auto_discharge_disconnect(port, 1);
+
+ /* Apply Rp */
+ typec_update_cc(port);
+
/*
* Initial data role for sink is DFP
* This also sets the usb mux
@@ -3013,23 +3025,29 @@ static void tc_attached_src_entry(const int port)
tc[port].polarity);
}
- /* Attached.SRC - enable AutoDischargeDisconnect */
- tcpm_enable_auto_discharge_disconnect(port, 1);
-
- /* Apply Rp */
- typec_update_cc(port);
-
tc_enable_pd(port, 0);
pd_timer_enable(port, TC_TIMER_TIMEOUT,
MAX(PD_POWER_SUPPLY_TURN_ON_DELAY,
PD_T_VCONN_STABLE));
}
} else {
+ /*
+ * Set up CC's, Vconn, and ADD before Vbus, as per
+ * Figure 4-24. DRP Initialization and Connection
+ * Detection in TCPCI r2 v1.2 specification.
+ */
+
/* Get connector orientation */
tcpm_get_cc(port, &cc1, &cc2);
tc[port].polarity = get_src_polarity(cc1, cc2);
pd_set_polarity(port, tc[port].polarity);
+ /* Attached.SRC - enable AutoDischargeDisconnect */
+ tcpm_enable_auto_discharge_disconnect(port, 1);
+
+ /* Apply Rp */
+ typec_update_cc(port);
+
/*
* Initial data role for sink is DFP
* This also sets the usb mux
@@ -3056,12 +3074,6 @@ static void tc_attached_src_entry(const int port)
usb_mux_set(port, USB_PD_MUX_NONE,
USB_SWITCH_DISCONNECT, tc[port].polarity);
}
-
- /* Attached.SRC - enable AutoDischargeDisconnect */
- tcpm_enable_auto_discharge_disconnect(port, 1);
-
- /* Apply Rp */
- typec_update_cc(port);
}
/* Inform PPC and OCP module that a sink is connected. */