summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/tcpm/ps8xxx.c16
-rw-r--r--driver/tcpm/tcpci.c9
2 files changed, 15 insertions, 10 deletions
diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c
index 4643c669c0..11551b1a7c 100644
--- a/driver/tcpm/ps8xxx.c
+++ b/driver/tcpm/ps8xxx.c
@@ -895,6 +895,20 @@ static int ps8xxx_tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1,
return tcpci_tcpm_get_cc(port, cc1, cc2);
}
+static int ps8xxx_tcpm_set_vconn(int port, int enable)
+{
+ /*
+ * Add delay of writing TCPC_REG_POWER_CTRL makes
+ * CC status being judged correctly when disable VCONN.
+ * This may be a PS8XXX firmware issue, Parade is still trying.
+ * https://partnerissuetracker.corp.google.com/issues/185202064
+ */
+ if (!enable)
+ msleep(PS8XXX_VCONN_TURN_OFF_DELAY_US);
+
+ return tcpci_tcpm_set_vconn(port, enable);
+}
+
const struct tcpm_drv ps8xxx_tcpm_drv = {
.init = ps8xxx_tcpm_init,
.release = ps8xxx_tcpm_release,
@@ -908,7 +922,7 @@ const struct tcpm_drv ps8xxx_tcpm_drv = {
#ifdef CONFIG_USB_PD_DECODE_SOP
.sop_prime_enable = tcpci_tcpm_sop_prime_enable,
#endif
- .set_vconn = tcpci_tcpm_set_vconn,
+ .set_vconn = ps8xxx_tcpm_set_vconn,
.set_msg_header = tcpci_tcpm_set_msg_header,
.set_rx_enable = tcpci_tcpm_set_rx_enable,
.get_message_raw = tcpci_tcpm_get_message_raw,
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c
index 1e08e0967d..e22a284a1a 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -661,15 +661,6 @@ int tcpci_tcpm_set_vconn(int port, int enable)
reg &= ~TCPC_REG_POWER_CTRL_VCONN(1);
reg |= TCPC_REG_POWER_CTRL_VCONN(enable);
- /*
- * Add delay of writing TCPC_REG_POWER_CTRL makes
- * CC status being judged correctly when disable VCONN.
- * This may be a PS8XXX firmware issue, Parade is still trying.
- * https://partnerissuetracker.corp.google.com/issues/185202064
- */
- if (!enable)
- msleep(PS8XXX_VCONN_TURN_OFF_DELAY_US);
-
return tcpc_write(port, TCPC_REG_POWER_CTRL, reg);
}