summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-04 17:17:40 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-05 19:20:15 +0000
commitb066f62055ced4fb3665911c70219a4d219e8297 (patch)
treea1380caff6c47c32d6ac211323535246dd66898b
parent0292087945444032d67e5c23179e4f0a3e12b7fc (diff)
downloadchrome-ec-b066f62055ced4fb3665911c70219a4d219e8297.tar.gz
zephyr: Add support for Fast Role Swap trigger
Add support for these options so that Fast Role Swap can be enabled. BUG=b:175434113 BRANCH=none TEST=build zephyr with another CL and see that the code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I78b68108f9ab50afe137a5010d6024ca07d723f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677182 Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/Kconfig.usbc42
-rw-r--r--zephyr/shim/include/config_chip.h15
2 files changed, 57 insertions, 0 deletions
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc
index e5b6876b9f..7587514c04 100644
--- a/zephyr/Kconfig.usbc
+++ b/zephyr/Kconfig.usbc
@@ -297,6 +297,48 @@ config PLATFORM_EC_USB_PD_DUAL_ROLE
up its battery), or send out power to an attached device on the same
port.
+config PLATFORM_EC_USB_PD_FRS
+ bool "Support Fast Role Swap protocol"
+ help
+ Enables the protocol side of Fast Role Swap (FRS). This allows the
+ device to switch from a SNK to a SRC (or vice versa) based on
+ communication with the partner device.
+
+ For this to work the trigger must be implemented in either the
+ Type-C Port Controller (TCPC) or Power Path Controller (PPC).
+
+ FRS differs from the traditional power-role swap in that FRS
+ guarantees there is no interruption of power nor disruption of data
+ communication to any downstream devices (such as devices connected
+ to a USB-C hub or dock).
+
+if PLATFORM_EC_USB_PD_FRS
+
+choice "Trigger implementation"
+ prompt "Select where the trigger is implemented"
+ help
+ The Fast Role Swap (protocol requires that a trigger be implemented to
+ initiate the swap. Use this option to select which of the available
+ options should be used.
+
+config PLATFORM_EC_USB_PD_FRS_PPC
+ bool "PPC"
+ depends on PLATFORM_EC_USBC_PPC
+ help
+ Enable this if the Fast Role Swap trigger is implemented in the
+ Power Path Controller (PPC).
+
+config PLATFORM_EC_USB_PD_FRS_TCPC
+ bool "TCPC"
+ depends on PLATFORM_EC_USBC_TCPC
+ help
+ Enable this if the Fast Role Swap trigger is implemented in the
+ Type-C Port Controller (TCPC).
+
+endchoice # Trigger implementation
+
+endif # PLATFORM_EC_USB_PD_FRS
+
config PLATFORM_EC_USB_PD_DUAL_ROLE_AUTO_TOGGLE
bool "Board can use TCPC-controlled DRP toggle"
depends on PLATFORM_EC_USB_PD_DUAL_ROLE
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 231e5b9d38..299bef85ee 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -806,6 +806,21 @@ enum battery_type {
#define CONFIG_USB_PD_USB4
#endif
+#undef CONFIG_USB_PD_FRS
+#ifdef CONFIG_PLATFORM_EC_USB_PD_FRS
+#define CONFIG_USB_PD_FRS
+#endif
+
+#undef CONFIG_USB_PD_FRS_TCPC
+#ifdef CONFIG_PLATFORM_EC_USB_PD_FRS_TCPC
+#define CONFIG_USB_PD_FRS_TCPC
+#endif
+
+#undef CONFIG_USB_PD_FRS_PPC
+#ifdef CONFIG_PLATFORM_EC_USB_PD_FRS_PPC
+#define CONFIG_USB_PD_FRS_PPC
+#endif
+
#undef CONFIG_VSTORE
#undef VSTORE_SLOT_COUNT
#ifdef CONFIG_PLATFORM_EC_VSTORE