summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2023-01-28 10:35:26 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-07 23:24:10 +0000
commit7884deec9f9c255724cf3d32566e7876e0dc3b71 (patch)
tree3a618941b71ea047762631d3c6c0f7effa144846 /test
parentd9b9cb6e89a9d3082421e26a3bd20ce08e73379b (diff)
downloadchrome-ec-7884deec9f9c255724cf3d32566e7876e0dc3b71.tar.gz
TCPMv2: Gate DP module support on a CONFIG
Add a CONFIG option to gate DP mode support within the embedded controller. By default, turn the DP module off if the AP is controlling the VDMs for mode entry. For modules which do not implement the DP config option, the header now defines stubs for DP specific functions to use. This obsoletes some of the stub functions from older unit tests. BRANCH=None BUG=b:266714542 TEST=on skyrim, compile with DP disabled and observe 3162 bytes saved, run zmake compare-builds -a and util/compare_build.sh -b all, ./twister -T ./zephyr/test passes (note: ECOS compare builds needed all assert statements removed to pass, as they grab the line number, zephyr compare builds passed before HC mode entry was revamped) Change-Id: I9619eb5d34e418f1972c4bf16d4cf9c8d551eac5 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4201454 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/fake_usbc.c8
-rw-r--r--test/test_config.h3
2 files changed, 3 insertions, 8 deletions
diff --git a/test/fake_usbc.c b/test/fake_usbc.c
index 19e14ba5c8..798cd1fc57 100644
--- a/test/fake_usbc.c
+++ b/test/fake_usbc.c
@@ -270,14 +270,6 @@ const char *pd_get_task_state_name(int port)
}
#endif /* CONFIG_USB_DRP_ACC_TRYSRC */
-void dp_init(int port)
-{
-}
-
-void dp_vdm_acked(int port, int cmd)
-{
-}
-
void dpm_init(int port)
{
}
diff --git a/test/test_config.h b/test/test_config.h
index 704c3b42c1..bc5b2ae133 100644
--- a/test/test_config.h
+++ b/test/test_config.h
@@ -451,6 +451,7 @@ int ncp15wb_calculate_temp(uint16_t adc);
#define CONFIG_USB_PD_DISCHARGE_GPIO
#undef CONFIG_USB_PD_HOST_CMD
#define CONFIG_USB_PD_ALT_MODE_DFP
+#define CONFIG_USB_PD_DP_MODE
#define CONFIG_USBC_SS_MUX
#define CONFIG_USB_PD_3A_PORTS 0 /* Host does not define a 3.0 A PDO */
#endif
@@ -475,6 +476,7 @@ int ncp15wb_calculate_temp(uint16_t adc);
#define CONFIG_USB_PD_DISCHARGE_GPIO
#undef CONFIG_USB_PD_HOST_CMD
#define CONFIG_USB_PD_ALT_MODE_DFP
+#define CONFIG_USB_PD_DP_MODE
#define CONFIG_USBC_SS_MUX
#define I2C_PORT_HOST_TCPC 0
#define CONFIG_CHARGE_MANAGER
@@ -551,6 +553,7 @@ int ncp15wb_calculate_temp(uint16_t adc);
#define CONFIG_USB_POWER_DELIVERY
#define CONFIG_TEST_USB_PE_SM
#define CONFIG_USB_PD_ALT_MODE_DFP
+#define CONFIG_USB_PD_DP_MODE
#define CONFIG_USBC_VCONN
#define CONFIG_USBC_VCONN_SWAP
#define CONFIG_USB_PID 0x5036