summaryrefslogtreecommitdiff
path: root/driver/tcpm
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@google.com>2020-06-30 12:42:04 -0600
committerCommit Bot <commit-bot@chromium.org>2020-07-01 23:35:52 +0000
commitdc3e8d69dbffc330a0725eacf00da14f54ac86fc (patch)
tree30d440d51929310a4936a36c9b0cd50463f561cd /driver/tcpm
parente8bd3c057ceb1c881ccd5112b577d94cd730b7d6 (diff)
downloadchrome-ec-dc3e8d69dbffc330a0725eacf00da14f54ac86fc.tar.gz
TCPMv2: make sure Vbus is not sourced in AttachWait.SRC
The TCPC on zork appears to enable Vbus sourcing some of the time when we come out of auto-toggle. It looks like about a 60ms delay before it is enabled. We then go to AttachWait.SRC and since the exit condition to get to Attached.SRC is a debounced/valid Attached.SRC CC and Safe0V, it has to be disabled manually in order to move to Attached.SRC BUG=b:160227699,b:160253746 BRANCH=none TEST=dut-control servo_v4_role:snk should attach Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I1dfc5d2536aaa4d7a5ffc7bbb52c647b15764196 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2276463 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'driver/tcpm')
-rw-r--r--driver/tcpm/tcpm.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/driver/tcpm/tcpm.h b/driver/tcpm/tcpm.h
index 7147bdada1..9bb8362158 100644
--- a/driver/tcpm/tcpm.h
+++ b/driver/tcpm/tcpm.h
@@ -245,6 +245,16 @@ static inline int tcpm_set_src_ctrl(int port, int enable)
else
return EC_ERROR_UNIMPLEMENTED;
}
+
+static inline int tcpm_disable_bad_vbus_sourcing(int port)
+{
+ if (tcpc_config[port].flags & TCPC_FLAGS_TCPCI_BAD_VBUS_SOURCING)
+ return tcpm_set_src_ctrl(port, 0);
+ else
+ return EC_ERROR_UNIMPLEMENTED;
+}
+#else
+int tcpm_disable_bad_vbus_sourcing(int port);
#endif
static inline void tcpc_alert(int port)