summaryrefslogtreecommitdiff
path: root/src/ec/google
diff options
context:
space:
mode:
authorKapil Porwal <kapilporwal@google.com>2023-07-10 11:27:17 +0000
committerSubrata Banik <subratabanik@google.com>2023-07-15 12:47:02 +0000
commitc2c5801dcd06fece4ea477c22c2eca3ecbed3a04 (patch)
tree89bf99ae036fb754bb3e209c571a524dd204dc54 /src/ec/google
parentba7fee9159ca99afe8f1713f00e79bc3d909abb7 (diff)
ec/google/chromeec: Skip unnecessary call to TCSS `enter_dp_mode` cmd
Skip TCSS `enter_dp_mode` command when there is no USB device detected on the port. BUG=b:247670186 TEST=Verify display over TCSS and its impact on boot time for google/rex Signed-off-by: Kapil Porwal <kapilporwal@google.com> Change-Id: Ie6cd84cab3631596d4d7178dae2040e25c621f63 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76352 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com>
Diffstat (limited to 'src/ec/google')
-rw-r--r--src/ec/google/chromeec/ec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index cad48618bf..effce6e586 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -1213,9 +1213,16 @@ static int google_chromeec_usb_pd_get_info(int port, bool *ufp, bool *dbg_acc,
int google_chromeec_typec_control_enter_dp_mode(int port)
{
+ int ret;
+ struct usbc_mux_info mux_info;
+
if (!google_chromeec_check_feature(EC_FEATURE_TYPEC_REQUIRE_AP_MODE_ENTRY))
return 0;
+ ret = google_chromeec_get_usbc_mux_info(port, &mux_info);
+ if ((ret < 0) || (!mux_info.usb))
+ return -1;
+
const struct ec_params_typec_control typec_control = {
.port = port,
.command = TYPEC_CONTROL_COMMAND_ENTER_MODE,