From cf32f9f86ca2add5a457f53670c42123b429bffa Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Thu, 13 Feb 2020 15:29:55 -0800 Subject: tcpci: Don't set 1 CC to open based on polarity This commit fixes an issue where the TCPCI driver was setting 1 CC line to open when the polarity was known. This was causing issues where a charger would only work in one orientation without a battery. Ideally, this behaviour should be done a bit higher up in the stack whenever we are sourcing VCONN. BUG=b:149496312,chromium:149496312 BRANCH=hatch TEST=Build and flash waddledoo, remove the battery, plug in a PD charger, verify that the EC does not brown out. Change-Id: Idbcb915c0bbd867cfafc1e32c0f6534b363a867b Signed-off-by: Aseda Aboagye Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2055618 Tested-by: Aseda Aboagye Auto-Submit: Aseda Aboagye Reviewed-by: Denis Brockus Commit-Queue: Denis Brockus --- driver/tcpm/tcpci.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'driver') diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c index 0ada2111ee..b4d44e0a31 100644 --- a/driver/tcpm/tcpci.c +++ b/driver/tcpm/tcpci.c @@ -360,23 +360,12 @@ int tcpci_tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1, int tcpci_tcpm_set_cc(int port, int pull) { int cc1, cc2; - enum tcpc_cc_polarity polarity; cc1 = cc2 = pull; /* Keep track of current CC pull value */ tcpci_set_cached_pull(port, pull); - /* - * Only drive one CC line when attached crbug.com/951681 - * and drive both when unattached. - */ - polarity = pd_get_polarity(port); - if (polarity == POLARITY_CC1) - cc2 = TYPEC_CC_OPEN; - else if (polarity == POLARITY_CC2) - cc1 = TYPEC_CC_OPEN; - return tcpc_write(port, TCPC_REG_ROLE_CTRL, TCPC_REG_ROLE_CTRL_SET(0, tcpci_get_cached_rp(port), -- cgit v1.2.1