summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/CMakeLists.txt2
-rw-r--r--zephyr/Kconfig.usbc12
-rw-r--r--zephyr/shim/include/config_chip.h5
3 files changed, 19 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index 69daa02ca9..8a7359ec65 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -303,6 +303,8 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_ALT_MODE_UFP
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_DUAL_ROLE
"${PLATFORM_EC}/common/usb_pd_dual_role.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_CONSOLE_CMD
+ "${PLATFORM_EC}/common/usb_pd_console_cmd.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_HOST_CMD
"${PLATFORM_EC}/common/usb_pd_host_cmd.c"
"${PLATFORM_EC}/common/usbc/usb_pd_host.c")
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc
index 0eebb5ae8f..a4eabb0fcf 100644
--- a/zephyr/Kconfig.usbc
+++ b/zephyr/Kconfig.usbc
@@ -524,8 +524,17 @@ config PLATFORM_EC_USB_PD_LOGGING
The log events are stored in a circular buffer, each one being a
struct event_log_entry.
+menuconfig PLATFORM_EC_USB_PD_CONSOLE_CMD
+ bool "Enable USB PD console commands"
+ default y if PLATFORM_EC_USB_PD_ALT_MODE_DFP
+ help
+ Enables various USB-C PD related console commands.
+
+if PLATFORM_EC_USB_PD_CONSOLE_CMD
+
config PLATFORM_EC_CMD_USB_PD_PE
bool "Console command: pe"
+ default y
help
This command dumps information about the USB PD alternate mode options
discovered from the partner device. It can be useful for debugging.
@@ -545,6 +554,7 @@ config PLATFORM_EC_CMD_USB_PD_PE
config PLATFORM_EC_CMD_USB_PD_CABLE
bool "Console command: pdcable"
+ default y
help
This commands shows the USB cable charactistics as detected from the
device. It can be useful for debugging problems with cables and the
@@ -562,6 +572,8 @@ config PLATFORM_EC_CMD_USB_PD_CABLE
Link training: Bi-directional
Thunderbolt cable type: Passive
+endif # PLATFORM_EC_USB_PD_CONSOLE_CMD
+
choice "USB-C device type"
prompt "Select the USB-C device type"
default PLATFORM_EC_USB_DRP_ACC_TRYSRC
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 54466f8236..56e0ac7ae0 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -640,6 +640,11 @@ enum battery_type {
#define CONFIG_USBC_OCP
#endif
+#undef CONFIG_USB_PD_CONSOLE_CMD
+#ifdef CONFIG_PLATFORM_EC_USB_PD_CONSOLE_CMD
+#define CONFIG_USB_PD_CONSOLE_CMD
+#endif
+
#undef CONFIG_USB_PD_HOST_CMD
#ifdef CONFIG_PLATFORM_EC_USB_PD_HOST_CMD
#define CONFIG_USB_PD_HOST_CMD