summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorudaykiran <udaykiran@google.com>2021-05-24 15:04:13 -0700
committerCommit Bot <commit-bot@chromium.org>2021-05-27 00:10:41 +0000
commit397e64350dae07e4f391b558538f86be71068785 (patch)
treefc6284e20a09f962665ff4e0916ae788cb96d9d0 /common
parentaa1b46525d79aed93b4aadbffc3e1846c5bf94bd (diff)
downloadchrome-ec-397e64350dae07e4f391b558538f86be71068785.tar.gz
TCPMv2: Enable logging of CCD line state
This CL logs the CCD line state of CCD_MODE_ODL upon DP-Altmode entry. BUG=b:170895220 BRANCH=none TEST=make buildall -j and verify that images build successfully. Signed-off-by: udaykiran <udaykiran@google.com> Change-Id: Iabee1a16e2497fd4ada2c2c06b65bef9d5ab1593 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2915756 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usb_pd_alt_mode_dfp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c
index 700af4ea25..930f77a4b5 100644
--- a/common/usb_pd_alt_mode_dfp.c
+++ b/common/usb_pd_alt_mode_dfp.c
@@ -1157,6 +1157,23 @@ __overridable int svdm_enter_dp_mode(int port, uint32_t mode_caps)
if (chipset_in_state(CHIPSET_STATE_ANY_OFF))
return -1;
#endif
+
+ /*
+ * TCPMv2: Enable logging of CCD line state CCD_MODE_ODL.
+ * DisplayPort Alternate mode requires that the SBU lines are used for
+ * AUX communication.
+ * However, in Chromebooks SBU signals are repurposed as USB2 signals
+ * for CCD. This functionality is accomplished by override fets whose
+ * state is controlled by CCD_MODE_ODL.
+ *
+ * This condition helps in debugging unexpected AUX timeout issues by
+ * indicating the state of the CCD override fets.
+ */
+#ifdef GPIO_CCD_MODE_ODL
+ if (!gpio_get_level(GPIO_CCD_MODE_ODL))
+ CPRINTS("WARNING: Tried to EnterMode DP with [CCD on AUX/SBU]");
+#endif
+
/* Only enter mode if device is DFP_D capable */
if (mode_caps & MODE_DP_SNK) {
svdm_safe_dp_mode(port);