summaryrefslogtreecommitdiff
path: root/common/usbc/dp_alt_mode.c
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2020-10-08 16:31:53 -0700
committerCommit Bot <commit-bot@chromium.org>2020-10-14 20:33:13 +0000
commite4c3ec56c5002ce4ed425495eaa50379d9eb3b96 (patch)
tree153bc7d0ea9f2b688e6b38b9c23c04d8b93fc324 /common/usbc/dp_alt_mode.c
parent913b68e8e43d5700e3432148b33428e1e1ce0d79 (diff)
downloadchrome-ec-e4c3ec56c5002ce4ed425495eaa50379d9eb3b96.tar.gz
TCPMv2: Avoid alt mode files from changing DPM states
USB4 mode: Added a function to check if the USB4 entry is completed Thunderbolt mode: Added 2 flags TBT_RETRY_DONE, TBT_EXIT_DONE to track the Thunderbolt mode's exit and if retry is needed and a new function to check if if the Thunderbolt mode entry is completed DisplayPort mode: Added a function to check if the DisplayPort entry is completed BUG=b:169169804 BRANCH=None TEST=1. Able to enter alternate mode on hotplug and reboot 2. Able to exit the alternate mode on chipset transition and on DPM's exit mode request. Change-Id: I09662449143ad8d94b30ae102ed5ce79db852687 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2421425 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common/usbc/dp_alt_mode.c')
-rw-r--r--common/usbc/dp_alt_mode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/usbc/dp_alt_mode.c b/common/usbc/dp_alt_mode.c
index cd5eec1650..b53c448a8a 100644
--- a/common/usbc/dp_alt_mode.c
+++ b/common/usbc/dp_alt_mode.c
@@ -15,7 +15,6 @@
#include "usb_common.h"
#include "usb_dp_alt_mode.h"
#include "usb_pd.h"
-#include "usb_pd_dpm.h"
#include "usb_pd_tcpm.h"
#ifdef CONFIG_COMMON_RUNTIME
@@ -62,11 +61,16 @@ void dp_init(int port)
dp_state[port] = DP_START;
}
+bool dp_entry_is_done(int port)
+{
+ return dp_state[port] == DP_ACTIVE ||
+ dp_state[port] == DP_INACTIVE;
+}
+
static void dp_entry_failed(int port)
{
CPRINTS("C%d: DP alt mode protocol failed!", port);
dp_state[port] = DP_INACTIVE;
- dpm_set_mode_entry_done(port);
}
static bool dp_response_valid(int port, enum tcpm_transmit_type type,
@@ -116,7 +120,6 @@ void dp_vdm_acked(int port, enum tcpm_transmit_type type, int vdo_count,
case DP_STATUS_ACKED:
if (modep && modep->opos && modep->fx->post_config)
modep->fx->post_config(port);
- dpm_set_mode_entry_done(port);
dp_state[port] = DP_ACTIVE;
CPRINTS("C%d: Entered DP mode", port);
break;