diff options
author | Simon Glass <sjg@chromium.org> | 2021-01-14 13:22:24 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-16 03:18:09 +0000 |
commit | de33eefffa84eab32749964ae6c7d1a32e5bb519 (patch) | |
tree | 20c1cb21a751a7c41e5710f59e23c0691a2fbb6f | |
parent | a8d0e611119ec300cb3906812b7ef0449cb05fe9 (diff) | |
download | chrome-ec-de33eefffa84eab32749964ae6c7d1a32e5bb519.tar.gz |
zephyr: Allow enabling Try.SRC mode
Enable this option so that the device can charge other devices
attached to it.
BUG=b:175434113
BRANCH=none
TEST=make BOARD=volteer -j30
With a zephyr-chrome CL, build volteer on zephyr
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I94bf20d2f3e9a6a38e1096bbca6c293b377c52e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2631090
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | zephyr/Kconfig.usbc | 10 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index 8932e1460e..f00978d5e0 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -400,6 +400,16 @@ config PLATFORM_EC_USB_DRP_ACC_TRYSRC endchoice # USB-C device type +config PLATFORM_EC_USB_PD_TRY_SRC + bool "Enable Try.SRC mode" + depends on PLATFORM_EC_USB_DRP_ACC_TRYSRC + default y + help + This enables Try.SRC mode so that the board will try to be a source + for power if the other end offers both options. This can be useful + for laptops, for example, since when attaching to a cellphone we want + the laptop to charge the phone, not vice versa. + endif # PLATFORM_EC_USB_POWER_DELIVERY menuconfig PLATFORM_EC_USBC_PPC diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 3ef9f5bded..fb2ccfb84c 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -527,4 +527,9 @@ enum battery_type { #define CONFIG_USBC_VCONN_SWAP #endif /* CONFIG_PLATFORM_EC_USBC_VCONN */ +#undef CONFIG_USB_PD_TRY_SRC +#ifdef CONFIG_PLATFORM_EC_USB_PD_TRY_SRC +#define CONFIG_USB_PD_TRY_SRC +#endif + #endif /* __CROS_EC_CONFIG_CHIP_H */ |