diff options
author | Simon Glass <sjg@chromium.org> | 2021-01-07 15:43:50 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-09 19:57:34 +0000 |
commit | 82e91312b0ceaff0ece097eda0ba376073011ff4 (patch) | |
tree | 3c4a122ac7b17e124097dfb5d191485159bf46bd | |
parent | 331561a0f81fa6def3a41d1ed6a90de59aa06984 (diff) | |
download | chrome-ec-82e91312b0ceaff0ece097eda0ba376073011ff4.tar.gz |
zephyr: Add Kconfig options for USB PD alt mode
Allow this feature to be enabled if selected by the board.
BUG=b:175434113
BRANCH=none
TEST=make BOARD=volteer -j30
With a zephyr-chrome CL, build volteer on zephyr
Change-Id: Ie8a3ccc8cf102e3d9313f7b47b39737119a37e2c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2617040
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r-- | zephyr/CMakeLists.txt | 3 | ||||
-rw-r--r-- | zephyr/Kconfig.usbc | 19 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 10 |
3 files changed, 32 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 8b0b0f9dbd..258baf4206 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -104,6 +104,9 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_POWER_DELIVERY "${PLATFORM_EC}/common/usbc/usb_sm.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_OCP "${PLATFORM_EC}/common/usbc_ocp.c") + +zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_ALT_MODE_DFP + "${PLATFORM_EC}/common/usb_pd_alt_mode_dfp.c") 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_HOST_CMD diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index 05340c4dcf..1aa8d7e53d 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -194,6 +194,25 @@ config PLATFORM_EC_CONFIG_USB_PD_REV30 This defaults to y because PD Rev3.0 is required for USB4 functionality. +config PLATFORM_EC_USB_PD_ALT_MODE + bool "USB Power Delivery alternate mode" + default y + help + Enable this to support USB PD alternate mode. This allows negotiation + of a different mode of operation to allow non-USB traffic to pass over + a USB Type-C link. This makes use of some or all of the USB 3.0 bus + differential pairs. If all are used for the alternate mode, then USB + transmission is not available at all while in this mode. + +config PLATFORM_EC_USB_PD_ALT_MODE_DFP + bool "Downward Facing Port support" + default y + help + Enable support for USB Power Delivery alternate mode of Downward + Facing Port. + + TODO: Add more help here + choice "VBUS detection method" prompt "Select the method to detect VBUS" diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index b5af436bc5..591e592397 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -422,4 +422,14 @@ enum battery_type { #endif /* CONFIG_PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG */ +#undef CONFIG_USB_PD_ALT_MODE +#ifdef CONFIG_PLATFORM_EC_USB_PD_ALT_MODE +#define CONFIG_USB_PD_ALT_MODE +#endif + +#undef CONFIG_USB_PD_ALT_MODE_DFP +#ifdef CONFIG_PLATFORM_EC_USB_PD_ALT_MODE_DFP +#define CONFIG_USB_PD_ALT_MODE_DFP +#endif + #endif /* __CROS_EC_CONFIG_CHIP_H */ |