summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-22 15:50:45 +1300
committerCommit Bot <commit-bot@chromium.org>2021-03-24 03:31:14 +0000
commit9219c2cc000bb3322ba186bbe953d5282f6073d4 (patch)
tree795e03acc8cdfcf2a30e8b0b81715ff2c9f5fff2
parent487fcd06dddfce60f52647912469df02cb6245f2 (diff)
downloadchrome-ec-9219c2cc000bb3322ba186bbe953d5282f6073d4.tar.gz
zephyr: Add support for multiple Parade PS8xxx chips
Some designs use different chips. The driver supports them all but needs to know which one is on which port. Add support for this feature in Zephyr. BUG=b:183296099 BRANCH=none TEST=build zephyr for lazor Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I497da5e865e764d74242c00bf2fb0d309fae7061 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2777638
-rw-r--r--zephyr/Kconfig.usbc21
-rw-r--r--zephyr/shim/include/config_chip.h5
2 files changed, 26 insertions, 0 deletions
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc
index 3ee5a1eeb6..f37abad00d 100644
--- a/zephyr/Kconfig.usbc
+++ b/zephyr/Kconfig.usbc
@@ -866,6 +866,27 @@ config PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG
factory. Without this, multiple EC images would need to be installed
depending on the board.
+config PLATFORM_EC_USB_PD_TCPM_MULTI_PS8XXX
+ bool "Support multiple PS8xxx devices"
+ help
+ PS8XXX-series chips are all supported by a single driver. Enable
+ this If a board with the same EC firmware is expected to support
+ multiple products here. Then enable the required PS8xxx options
+ below.
+
+ In this case the board must provide a function to return the correct
+ product ID actually used by a particular board:
+
+ uint16_t board_get_ps8xxx_product_id(int port)
+
+ Supported return values are:
+
+ PS8705_PRODUCT_ID
+ PS8751_PRODUCT_ID
+ PS8755_PRODUCT_ID
+ PS8805_PRODUCT_ID
+ PS8815_PRODUCT_ID
+
config PLATFORM_EC_USB_PD_TCPM_PS8751
bool "Parade PS8751 USB-C Gen 2 Type-C Port Controller"
select PLATFORM_EC_USB_PD_TCPM_MUX
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 2e49326065..2601278141 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -806,6 +806,11 @@
#define CONFIG_USB_PD_TCPM_PS8815
#endif
+#undef CONFIG_USB_PD_TCPM_MULTI_PS8XXX
+#ifdef CONFIG_PLATFORM_EC_USB_PD_TCPM_MULTI_PS8XXX
+#define CONFIG_USB_PD_TCPM_MULTI_PS8XXX
+#endif
+
#undef CONFIG_USB_PD_TCPM_RT1715
#ifdef CONFIG_PLATFORM_EC_USB_PD_TCPM_RT1715
#define CONFIG_USB_PD_TCPM_RT1715