summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-06-04 16:01:55 -0600
committerCommit Bot <commit-bot@chromium.org>2021-06-11 21:28:00 +0000
commit4d72507fb50e3f423494374dd2ced5c713d9ae21 (patch)
treeb028ef7115b46ad4af5b8b8019925d5f88203021
parentd659ef75281526c7da5570d135de1a45856f0611 (diff)
downloadchrome-ec-4d72507fb50e3f423494374dd2ced5c713d9ae21.tar.gz
zephyr: Support DP hotplug detect with a GPIO
Add Kconfig support for USB_PD_DP_HPD_GPIO and the associated option so we can support this feature. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Iffee7fea469ac85fb9b41715fdd5bb767994584e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941883 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--zephyr/Kconfig.usbc20
-rw-r--r--zephyr/shim/include/config_chip.h10
2 files changed, 30 insertions, 0 deletions
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc
index 172fd5b697..1b4933c005 100644
--- a/zephyr/Kconfig.usbc
+++ b/zephyr/Kconfig.usbc
@@ -471,6 +471,26 @@ config PLATFORM_EC_USB_PD_USB32_DRD
other end so that it can potentially take advantage of the additional
features available.
+config PLATFORM_EC_USB_PD_DP_HPD_GPIO
+ bool "Hotplug Detect (HPD) is controlled by an EC GPIO"
+ help
+ Enable this if the EC must send the Hotplug Detect (HPD) signal to
+ the DisplayPort Graphics Processing Unit (GPU) via a GPIO. Otherwise
+ this is sent by the display device.
+
+config PLATFORM_EC_USB_PD_DP_HPD_GPIO_CUSTOM
+ bool "Custom handling of HPD GPIO"
+ depends on PLATFORM_EC_USB_PD_DP_HPD_GPIO
+ help
+ Enable this if the Hotplug Detect (HPD) GPIO level has to be handled
+ by custom functions. In this case your board must implement a
+ function to enable the feature for a port and another function to
+ check the current state:
+
+ void svdm_set_hpd_gpio(int port, int enable);
+
+ int svdm_get_hpd_gpio(int port);
+
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 13116516d6..a985882eb2 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -1610,4 +1610,14 @@
#define CONFIG_CONSOLE_CHANNEL
#endif
+#undef CONFIG_USB_PD_DP_HPD_GPIO
+#ifdef CONFIG_PLATFORM_EC_USB_PD_DP_HPD_GPIO
+#define CONFIG_USB_PD_DP_HPD_GPIO
+#endif
+
+#undef CONFIG_USB_PD_DP_HPD_GPIO_CUSTOM
+#ifdef CONFIG_PLATFORM_EC_USB_PD_DP_HPD_GPIO_CUSTOM
+#define CONFIG_USB_PD_DP_HPD_GPIO_CUSTOM
+#endif
+
#endif /* __CROS_EC_CONFIG_CHIP_H */