summaryrefslogtreecommitdiff
path: root/board/servo_v4/usb_pd_config.h
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2019-11-08 16:42:11 -0800
committerCommit Bot <commit-bot@chromium.org>2020-05-08 05:33:15 +0000
commitacce53e2ea4eb248a816f868a5b3817bbd4f83a0 (patch)
treea64d0679ec3db7a69e494255e5bef9cbc2a14a57 /board/servo_v4/usb_pd_config.h
parent2d60f3a731c196159d5bf8eb8509ff3cff7abb8a (diff)
downloadchrome-ec-acce53e2ea4eb248a816f868a5b3817bbd4f83a0.tar.gz
servo_v4: Introduce console commands to config DP alt-mode
New console commands, like: > usbc_action dp disable # disable DP alt-mode > usbc_action dp enable # enable DP alt-mode > usbc_action dp pins cde # support pin assignments C, D, and E > usbc_action dp pins cd # support pin assignments C and D > usbc_action dp pins d # support pin assignment D > usbc_action dp mf 1 # enable multi-function preference > usbc_action dp plug 1 # it is a plug > usbc_action dp plug 0 # it is a receptacle BRANCH=servo BUG=b:153647984 TEST=Tried the new console commands. Change-Id: I36744e772999f67f10189bc80dcec9f2b37123c2 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2143936 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/servo_v4/usb_pd_config.h')
-rw-r--r--board/servo_v4/usb_pd_config.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/board/servo_v4/usb_pd_config.h b/board/servo_v4/usb_pd_config.h
index d69062b02e..2d189d6267 100644
--- a/board/servo_v4/usb_pd_config.h
+++ b/board/servo_v4/usb_pd_config.h
@@ -56,12 +56,20 @@
#define CONFIG_HW_CRC
/* Servo v4 CC configuration */
-#define CC_DETACH (1 << 0) /* Emulate detach: both CC open */
-#define CC_DISABLE_DTS (1 << 1) /* Apply resistors to single or both CC? */
-#define CC_ALLOW_SRC (1 << 2) /* Allow charge through by policy? */
-#define CC_ENABLE_DRP (1 << 3) /* Enable dual-role port */
-#define CC_SNK_WITH_PD (1 << 4) /* Force enabling PD comm for sink role */
-#define CC_POLARITY (1 << 5) /* CC polarity */
+#define CC_DETACH BIT(0) /* Emulate detach: both CC open */
+#define CC_DISABLE_DTS BIT(1) /* Apply resistors to single or both CC? */
+#define CC_ALLOW_SRC BIT(2) /* Allow charge through by policy? */
+#define CC_ENABLE_DRP BIT(3) /* Enable dual-role port */
+#define CC_SNK_WITH_PD BIT(4) /* Force enabling PD comm for sink role */
+#define CC_POLARITY BIT(5) /* CC polarity */
+
+/* Servo v4 DP alt-mode configuration */
+#define ALT_DP_ENABLE BIT(0) /* Enable DP alt-mode or not */
+#define ALT_DP_PIN_C BIT(1) /* Pin assignment C supported */
+#define ALT_DP_PIN_D BIT(2) /* Pin assignment D supported */
+#define ALT_DP_PIN_E BIT(3) /* Pin assignment E supported */
+#define ALT_DP_MF_PREF BIT(4) /* Multi-Function preferred */
+#define ALT_DP_PLUG BIT(5) /* Plug or receptacle */
/* TX uses SPI1 on PB3-4 for CHG port, SPI2 on PB 13-14 for DUT port */
#define SPI_REGS(p) ((p) ? STM32_SPI2_REGS : STM32_SPI1_REGS)