summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/usbc/usb_prl_sm.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/common/usbc/usb_prl_sm.c b/common/usbc/usb_prl_sm.c
index f36248e8ac..0fcc9ba663 100644
--- a/common/usbc/usb_prl_sm.c
+++ b/common/usbc/usb_prl_sm.c
@@ -1229,7 +1229,7 @@ static void prl_tx_snk_pending_entry(const int port)
static void prl_tx_snk_pending_run(const int port)
{
- enum tcpc_cc_voltage_status cc1, cc2;
+ bool start_tx = false;
/*
* Wait unit the SRC applies SINK_TX_OK so we can transmit. In FRS mode,
@@ -1237,9 +1237,17 @@ static void prl_tx_snk_pending_run(const int port)
* gone or the TCPC CC_STATUS update time could be too long to meet
* tFRSwapInit.
*/
- tcpm_get_cc(port, &cc1, &cc2);
- if (cc1 == TYPEC_CC_VOLT_RP_3_0 || cc2 == TYPEC_CC_VOLT_RP_3_0 ||
- pe_in_frs_mode(port)) {
+ if (pe_in_frs_mode(port)) {
+ /* shortcut to save some i2c_xfer calls on the FRS path. */
+ start_tx = true;
+ } else {
+ enum tcpc_cc_voltage_status cc1, cc2;
+
+ tcpm_get_cc(port, &cc1, &cc2);
+ start_tx = (cc1 == TYPEC_CC_VOLT_RP_3_0 ||
+ cc2 == TYPEC_CC_VOLT_RP_3_0);
+ }
+ if (start_tx) {
/*
* We clear the pending XMIT flag here right before we send so
* we can detect if we discarded this message or not