summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-02-14 13:27:12 -0800
committerCommit Bot <commit-bot@chromium.org>2020-02-21 10:30:09 +0000
commitb7b3d637ead031ce244f192cbcb5c1dad91e487e (patch)
tree476b1a2a00f785329f88d3829efa7dfbef13bd50
parent4ffec9dbb3035154b952044d58cbeb9d1874e1ec (diff)
downloadchrome-ec-b7b3d637ead031ce244f192cbcb5c1dad91e487e.tar.gz
raa489000: Utilize VBUS auto discharge
The Renesas RAA489000 has an issue where GoodCRC messages are not emitted unless the VBUS Auto Discharge Disconnect setting is enabled. This needs to occur after determining orientation. However, there appears to be another issue where the device will not DRP toggle while that VBUS Auto Discharge Disconnect setting is set. Luckily, our TCPMv2 state machine will enable/disable this setting at these times for us. Therefore, this commit leverages the TCPCI auto discharge disconnect function which allows DRP toggling to work. BUG=b:149337338 BRANCH=None TEST=Build and flash waddledoo, boot to S0, verify DUT DRP toggles. Plug in a PD port partner, verify that PD communication works. TEST=Repeat above test in both orientations. Change-Id: Ieb79392f3cd7c1939bb6fb3de0d6785cec0b24c4 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2057847 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--driver/tcpm/raa489000.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/driver/tcpm/raa489000.c b/driver/tcpm/raa489000.c
index 9b4581a421..dec9313fba 100644
--- a/driver/tcpm/raa489000.c
+++ b/driver/tcpm/raa489000.c
@@ -83,9 +83,12 @@ int raa489000_init(int port)
if (rv)
CPRINTS("c%d: failed to set PD PHY setting1", port);
- /* Enable VBUS auto discharge. needed to goodcrc */
+ /*
+ * Disable VBUS auto discharge, we'll turn it on later as its needed to
+ * goodcrc.
+ */
rv = tcpc_read(port, TCPC_REG_POWER_CTRL, &regval);
- regval |= TCPC_REG_POWER_CTRL_AUTO_DISCHARGE_DISCONNECT;
+ regval &= ~TCPC_REG_POWER_CTRL_AUTO_DISCHARGE_DISCONNECT;
rv |= tcpc_write(port, TCPC_REG_POWER_CTRL, regval);
if (rv)
CPRINTS("c%d: failed to set auto discharge", port);
@@ -154,4 +157,6 @@ const struct tcpm_drv raa489000_tcpm_drv = {
#ifdef CONFIG_USB_PD_TCPC_LOW_POWER
.enter_low_power_mode = &tcpci_enter_low_power_mode,
#endif
+ .tcpc_enable_auto_discharge_disconnect =
+ &tcpci_tcpc_enable_auto_discharge_disconnect,
};