summaryrefslogtreecommitdiff
path: root/driver/tcpm/tusb422.c
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2021-02-08 15:11:12 +0100
committerCommit Bot <commit-bot@chromium.org>2021-02-10 08:57:23 +0000
commit69fd9b54fb2785ef0ff020c9b8cfaec9a5a412a9 (patch)
tree671c683f8a69227afa4c4aa375f426535db408d6 /driver/tcpm/tusb422.c
parentccf7e98b4176c80780a80f53b465d992e09ce68d (diff)
downloadchrome-ec-69fd9b54fb2785ef0ff020c9b8cfaec9a5a412a9.tar.gz
tusb422: Don't perform soft reset during initialization
After waking from Low Power Mode, TCPMv2 always performs TCPC initialization. Issuing soft reset during initialization leads to lose information about DRP result and set CC lines to Rd. When attaching sink, TCPC will report that nothing is connected and as a result TCPMv2 will enable DRP and go to Low Power Mode again. When LPM debounce delay is longer than tDRP (time in which TCPC will advertise source and sink, between 50ms and 100ms according to Type-C specification), then TCPC will always find connection before going to Low Power Mode. If it is smaller, TCPMv2 will loop between LowPowerMode and DRPAutoToggle states. BUG=b:176986511 BRANCH=none TEST=Run EC on Volteer board. Check if TCPC works. TEST=Change PD_LPM_DEBOUNCE_US to 10ms and check if sink (eg. pendrive) is detected correctly. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I0cd56d9a9ca31239afb4e41302e98b7996fb3a47 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2682482 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'driver/tcpm/tusb422.c')
-rw-r--r--driver/tcpm/tusb422.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/driver/tcpm/tusb422.c b/driver/tcpm/tusb422.c
index 511c18853f..7910b8b2de 100644
--- a/driver/tcpm/tusb422.c
+++ b/driver/tcpm/tusb422.c
@@ -51,11 +51,16 @@ static int tusb422_tcpci_tcpm_init(int port)
{
int rv;
- /* TUSB422 has a vendor-defined register reset */
- rv = tcpc_update8(port, TUSB422_REG_CC_GEN_CTRL,
- TUSB422_REG_CC_GEN_CTRL_GLOBAL_SW_RST, MASK_SET);
- if (rv)
- return rv;
+ /*
+ * Do not perform TCPC soft reset while waking from Low Power Mode,
+ * because it makes DRP incapable of looking for connection correctly
+ * (see b/176986511) and probably breaks firmware_PDTrySrc test
+ * (see b/179234089).
+ *
+ * TODO(b/179234089): Consider implementing function that performs
+ * only necessary things when leaving Low Power Mode, so we can perform
+ * TCPC soft reset here.
+ */
rv = tcpci_tcpm_init(port);
if (rv)