From 8b81257ffd943e6ad301b647ef31338df13433b5 Mon Sep 17 00:00:00 2001 From: Keith Short Date: Fri, 9 Jul 2021 14:40:04 -0600 Subject: zephyr: add support for CONFIG_USBC_PPC_SYV682X_SMART_DISCHARGE Add Kconfig option to enable the CONFIG_USBC_PPC_SYV682X_SMART_DISCHARGE option on the SYV682x PPC. BUG=b:193195946 BRANCH=none TEST=zmake testall TEST=make buildall Signed-off-by: Keith Short Change-Id: I5530951f75e2d4b64756858b9799c7978be44ba3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3015868 Reviewed-by: Denis Brockus Reviewed-by: Yuval Peress --- zephyr/Kconfig.usbc | 16 ++++++++++++---- zephyr/shim/include/config_chip.h | 5 +++++ 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'zephyr') diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index b2d48396fc..e40eba1140 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -809,10 +809,18 @@ config PLATFORM_EC_USBC_PPC_SYV682C config PLATFORM_EC_USBC_PPC_SYV682X_NO_CC bool "SYV682X does not pass through CC" help - Enable this if a SYV682X does not pass through CC. - There is a 3.6V limit on the HOST_CC signals, so the TCPC - should not source 5V VCONN. This config determines if - sourcing VCONN should be enabled by default. + Enable this if a SYV682X does not pass through CC. + There is a 3.6V limit on the HOST_CC signals, so the TCPC + should not source 5V VCONN. This config determines if + sourcing VCONN should be enabled by default. + +config PLATFORM_EC_USBC_PPC_SYV682X_SMART_DISCHARGE + bool "Enable smart discharge on the SYV682X PPC" + help + Enable the smart discharge feature on VBUS provided by the SYV682x + PPC. This should be enabled for revision C and above of the SYV682X. + Earlier revisions of the chip block I2C transactions during smart + discharge, causing USB PD compliance issues. config PLATFORM_EC_USBC_PPC_DEDICATED_INT bool "Power Power Controller has a dedicated interrupt pin" diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index d1c8672092..89f2ad4d52 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -974,6 +974,11 @@ #define CONFIG_USBC_PPC_SYV682X_NO_CC #endif +#undef CONFIG_USBC_PPC_SYV682X_SMART_DISCHARGE +#ifdef CONFIG_PLATFORM_EC_USBC_PPC_SYV682X_SMART_DISCHARGE +#define CONFIG_USBC_PPC_SYV682X_SMART_DISCHARGE +#endif + #undef CONFIG_USB_PD_TCPC_RUNTIME_CONFIG #undef CONFIG_USB_MUX_RUNTIME_CONFIG #ifdef CONFIG_PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG -- cgit v1.2.1