diff options
author | Ayushee <ayushee.shah@intel.com> | 2020-06-26 12:14:25 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-17 02:57:09 +0000 |
commit | 5270ea2b0cfc2ce699281c2e59ffce3546551d7e (patch) | |
tree | 04015789df81cfe1c8559a5d300ca80789ce0d58 /common/usb_pd_alt_mode_dfp.c | |
parent | 51cf32c16205af580dc1475ddf2c5731e199a133 (diff) | |
download | chrome-ec-5270ea2b0cfc2ce699281c2e59ffce3546551d7e.tar.gz |
TCPMv2: Add common exit mode for all the alternate modes
When chipset is transitioning to a new state or on sysjump, the SOC
re-negotiates to enter an alternate mode on booting up.
This commit:
1. Adds a common DPM function to check for all the active alternate modes
one at a time, construct the VDM and send the DPM request to exit the
mode.
2. Marks thunderbolt mode as inactive in DFP's thunderbolt mode exit
function.
BUG=b:152235216
BRANCH=None
TEST=Tested on volteer:
1. On connecting a DP dongle, able to enter into DP alternate mode
on reboot
2. On connecting a Thunderbolt dock, able to enter into Thunderbolt
mode on reboot
Change-Id: I7da6a4b08cab9abb3446c0dafdc7c9e9378ef00e
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2270877
Tested-by: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common/usb_pd_alt_mode_dfp.c')
-rw-r--r-- | common/usb_pd_alt_mode_dfp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c index dde6b771c9..8de23095d5 100644 --- a/common/usb_pd_alt_mode_dfp.c +++ b/common/usb_pd_alt_mode_dfp.c @@ -15,6 +15,7 @@ #include "usb_mux.h" #include "usb_pd.h" #include "usb_pd_tcpm.h" +#include "usb_tbt_alt_mode.h" #include "usbc_ppc.h" #include "util.h" @@ -1248,6 +1249,10 @@ __overridable int svdm_tbt_compat_enter_mode(int port, uint32_t mode_caps) __overridable void svdm_tbt_compat_exit_mode(int port) { + if (IS_ENABLED(CONFIG_USB_PD_TCPMV2)) { + usb_mux_set_safe_mode(port); + tbt_teardown(port); + } } __overridable int svdm_tbt_compat_status(int port, uint32_t *payload) |