diff options
author | Diana Z <dzigterman@chromium.org> | 2020-10-16 15:24:54 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-19 23:20:56 +0000 |
commit | dc5a1a0294ac6933205866a41e0f6ae1c4e4c615 (patch) | |
tree | df19f43dc15730b9158b5d6c8c5cad7129f1ba03 /driver/tcpm/tcpm.h | |
parent | e1d70859fa3543c5ae5b4bed820aca2ca277ea17 (diff) | |
download | chrome-ec-dc5a1a0294ac6933205866a41e0f6ae1c4e4c615.tar.gz |
TCPMv2: Add debug detach interface
Some TCPCs may require special commands to be run after a debug
accessory leaves the Attached.SNK/SRC states. Add an interface to
support this, and call it from the TC when needed.
BRANCH=None
BUG=b:159495742,b:170259606
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I79c7ebc308958c598cfa228598362c97b9b00e86
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2481941
Diffstat (limited to 'driver/tcpm/tcpm.h')
-rw-r--r-- | driver/tcpm/tcpm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/driver/tcpm/tcpm.h b/driver/tcpm/tcpm.h index e1db30ecb8..7450bbf7c3 100644 --- a/driver/tcpm/tcpm.h +++ b/driver/tcpm/tcpm.h @@ -312,6 +312,15 @@ static inline int tcpm_debug_accessory(int port, bool enable) return EC_SUCCESS; } +static inline int tcpm_debug_detach(int port) +{ + if (tcpc_config[port].drv->debug_detach) + return tcpc_config[port].drv->debug_detach(port); + + /* No special handling for debug disconnections? Success! */ + return EC_SUCCESS; +} + #ifdef CONFIG_USB_PD_TCPC_LOW_POWER static inline int tcpm_enter_low_power_mode(int port) { |