summaryrefslogtreecommitdiff
path: root/common/usb_pd_alt_mode_dfp.c
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2020-10-08 16:28:35 -0700
committerCommit Bot <commit-bot@chromium.org>2020-10-14 20:33:10 +0000
commit913b68e8e43d5700e3432148b33428e1e1ce0d79 (patch)
tree425c5caf498b167ac1b8c0cf9cf57c21c18d4633 /common/usb_pd_alt_mode_dfp.c
parentc7c8840bae1d3e833655a2b09b6deb5a47db680b (diff)
downloadchrome-ec-913b68e8e43d5700e3432148b33428e1e1ce0d79.tar.gz
TBT:Add support for exit mode SOP'/SOP'' on chipset transition
When chipset is transitioning to a new state or on sysjump, the EC re-negotiates to enter an alternate mode on booting up. This commit adds support for exiting Thunderbolt mode for SOP' and SOP'' for active cable on chipset transition and also moves all the alternate mode exit rotines to their respective files. It also delays deleting the SVID data until after the EXIT_MODE message has ACKed and avoids pd_dfp_exit_mode() from changing the alternate mode's internal states. This commit also makes sure that the mux is set to safe state before exiting the alternate mode and it is reconfigured according to the port's current data role on receiving ACK/NAK from the cable/port partner. BUG=b:151169925, b:159717794 BRANCH=none TEST=On reboot, able to exit and re-enter into DisplayPort mode, Thunderbolt mode with passive cable and thunderbolt mode with active cable. Change-Id: If1e48e9f31cd678e23fe89bd3494551b5d1a78f1 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2415082 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'common/usb_pd_alt_mode_dfp.c')
-rw-r--r--common/usb_pd_alt_mode_dfp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c
index 75d7744597..aba8075a27 100644
--- a/common/usb_pd_alt_mode_dfp.c
+++ b/common/usb_pd_alt_mode_dfp.c
@@ -259,6 +259,7 @@ uint32_t pd_dfp_enter_mode(int port, enum tcpm_transmit_type type,
return VDO(modep->fx->svid, 1, CMD_ENTER_MODE | VDO_OPOS(modep->opos));
}
+/* TODO(b/170372521) : Incorporate exit mode specific changes to DPM SM */
int pd_dfp_exit_mode(int port, enum tcpm_transmit_type type, uint16_t svid,
int opos)
{
@@ -1180,7 +1181,6 @@ __overridable int svdm_dp_attention(int port, uint32_t *payload)
__overridable void svdm_exit_dp_mode(int port)
{
- svdm_safe_dp_mode(port);
#ifdef CONFIG_USB_PD_DP_HPD_GPIO
svdm_set_hpd_gpio(port, 0);
#endif /* CONFIG_USB_PD_DP_HPD_GPIO */
@@ -1189,9 +1189,6 @@ __overridable void svdm_exit_dp_mode(int port)
if (port == USB_PD_PORT_TCPC_MST)
baseboard_mst_enable_control(port, 0);
#endif
-#ifdef CONFIG_USB_PD_TCPMV2
- dp_teardown(port);
-#endif
}
__overridable int svdm_enter_gfu_mode(int port, uint32_t mode_caps)
@@ -1232,10 +1229,6 @@ __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)
@@ -1254,6 +1247,10 @@ __overridable int svdm_tbt_compat_attention(int port, uint32_t *payload)
}
#endif /* CONFIG_USB_PD_TBT_COMPAT_MODE */
+/*
+ * TODO: b:169262276: For TCPMv2, move alternate mode specific entry, exit and
+ * configuration to Device Policy Manager.
+ */
const struct svdm_amode_fx supported_modes[] = {
{
.svid = USB_SID_DISPLAYPORT,