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 /include | |
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 'include')
-rw-r--r-- | include/usb_dp_alt_mode.h | 9 | ||||
-rw-r--r-- | include/usb_pd_dpm.h | 14 | ||||
-rw-r--r-- | include/usb_pe_sm.h | 28 | ||||
-rw-r--r-- | include/usb_tbt_alt_mode.h | 9 |
4 files changed, 42 insertions, 18 deletions
diff --git a/include/usb_dp_alt_mode.h b/include/usb_dp_alt_mode.h index 5fa703e109..4aceecd4ec 100644 --- a/include/usb_dp_alt_mode.h +++ b/include/usb_dp_alt_mode.h @@ -24,6 +24,15 @@ void dp_init(int port); /* + * Returns True if DisplayPort mode is in active state + * + * @param port USB-C port number + * @return True if DisplayPort mode is in active state + * False otherwise + */ +bool dp_is_active(int port); + +/* * Handles received DisplayPort VDM ACKs. * * @param port USB-C port number diff --git a/include/usb_pd_dpm.h b/include/usb_pd_dpm.h index 22fb2d71bd..d431256e18 100644 --- a/include/usb_pd_dpm.h +++ b/include/usb_pd_dpm.h @@ -27,6 +27,13 @@ void dpm_init(int port); void dpm_set_mode_entry_done(int port); /* + * Informs the DPM that Exit Mode request is received + * + * @param port USB-C port number + */ +void dpm_set_mode_exit_request(int port); + +/* * Informs the DPM that a VDM ACK was received. * * @param port USB-C port number @@ -59,4 +66,11 @@ void dpm_vdm_naked(int port, enum tcpm_transmit_type type, uint16_t svid, */ void dpm_attempt_mode_entry(int port); +/* + * Drives the Policy Engine through exit mode process for each active mode + * + * @param port USB-C port number + */ +void dpm_attempt_mode_exit(int port); + #endif /* __CROS_EC_USB_DPM_H */ diff --git a/include/usb_pe_sm.h b/include/usb_pe_sm.h index 1da649b865..511bf263b5 100644 --- a/include/usb_pe_sm.h +++ b/include/usb_pe_sm.h @@ -33,17 +33,16 @@ enum pe_dpm_request { DPM_REQUEST_SEND_PING = BIT(6), DPM_REQUEST_SOURCE_CAP = BIT(7), DPM_REQUEST_NEW_POWER_LEVEL = BIT(8), - DPM_REQUEST_EXIT_DP_MODE = BIT(9), - DPM_REQUEST_VDM = BIT(10), - DPM_REQUEST_BIST_RX = BIT(11), - DPM_REQUEST_BIST_TX = BIT(12), - DPM_REQUEST_SNK_STARTUP = BIT(13), - DPM_REQUEST_SRC_STARTUP = BIT(14), - DPM_REQUEST_HARD_RESET_SEND = BIT(15), - DPM_REQUEST_SOFT_RESET_SEND = BIT(16), - DPM_REQUEST_PORT_DISCOVERY = BIT(17), - DPM_REQUEST_SEND_ALERT = BIT(18), - DPM_REQUEST_ENTER_USB = BIT(19), + DPM_REQUEST_VDM = BIT(9), + DPM_REQUEST_BIST_RX = BIT(10), + DPM_REQUEST_BIST_TX = BIT(11), + DPM_REQUEST_SNK_STARTUP = BIT(12), + DPM_REQUEST_SRC_STARTUP = BIT(13), + DPM_REQUEST_HARD_RESET_SEND = BIT(14), + DPM_REQUEST_SOFT_RESET_SEND = BIT(15), + DPM_REQUEST_PORT_DISCOVERY = BIT(16), + DPM_REQUEST_SEND_ALERT = BIT(17), + DPM_REQUEST_ENTER_USB = BIT(18), }; /** @@ -115,13 +114,6 @@ void pe_got_soft_reset(int port); void pe_hard_reset_sent(int port); /** - * Exit DP mode - * - * @param port USB-C port number - */ -void pe_exit_dp_mode(int port); - -/** * Get the id of the current Policy Engine state * * @param port USB-C port number diff --git a/include/usb_tbt_alt_mode.h b/include/usb_tbt_alt_mode.h index 186c2f8139..c46c471035 100644 --- a/include/usb_tbt_alt_mode.h +++ b/include/usb_tbt_alt_mode.h @@ -23,6 +23,15 @@ void tbt_init(int port); /* + * Returns True if Thunderbolt mode is in active state + * + * @param port USB-C port number + * @return True if Thunderbolt mode is in active state + * False otherwise + */ +bool tbt_is_active(int port); + +/* * Handles received Thunderbolt VDM ACKs. * * @param port USB-C port number |