Re: [PATCH v15 1/9] drm/bridge: Implement generic USB Type-C DP HPD bridge
From: Xu Yang <hidden>
Date: 2026-06-29 08:28:01
Also in:
dri-devel, linux-arm-kernel, linux-phy, linux-rockchip, linux-usb, lkml
On Mon, Jun 29, 2026 at 09:29:08AM +0800, Chaoyi Chen wrote:
Hello Xu Yang, On 6/26/2026 7:15 PM, Xu Yang wrote:quoted
On Wed, Mar 04, 2026 at 05:41:44PM +0800, Chaoyi Chen wrote:quoted
From: Chaoyi Chen <redacted> The HPD function of Type-C DP is implemented through drm_connector_oob_hotplug_event(). For embedded DP, it is required that the DRM connector fwnode corresponds to the Type-C port fwnode. To describe the relationship between the DP controller and the Type-C port device, we usually using drm_bridge to build a bridge chain. Now several USB-C controller drivers have already implemented the DP HPD bridge function provided by aux-hpd-bridge.c, it will build a DP HPD bridge on USB-C connector port device. But this requires the USB-C controller driver to manually register the HPD bridge. If the driver does not implement this feature, the bridge will not be create. So this patch implements a generic DP HPD bridge based on aux-hpd-bridge.c. It will monitor Type-C bus events, and when a Type-C port device containing the DP svid is registered, it will create an HPD bridge for it without the need for the USB-C controller driver to implement it. Signed-off-by: Chaoyi Chen <redacted> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> --- (no changes since v14) Changes in v13: - Only register drm dp hpd bridge for typec port altmode device. (no changes since v12) Changes in v11: - Switch to using typec bus notifiers. (no changes since v10) Changes in v9: - Remove the exposed DRM_AUX_HPD_BRIDGE option, and select DRM_AUX_HPD_TYPEC_BRIDGE when it is available. - Add more commit comment about problem background. Changes in v8: - Merge generic DP HPD bridge into one module. --- drivers/gpu/drm/bridge/Kconfig | 10 ++++ drivers/gpu/drm/bridge/Makefile | 1 + .../gpu/drm/bridge/aux-hpd-typec-dp-bridge.c | 49 +++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.cdiff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index a250afd8d662..559487aa09a9 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig@@ -30,6 +30,16 @@ config DRM_AUX_HPD_BRIDGE Simple bridge that terminates the bridge chain and provides HPD support. +if DRM_AUX_HPD_BRIDGE +config DRM_AUX_HPD_TYPEC_BRIDGE + tristate + depends on TYPEC || !TYPEC + default TYPEC + help + Simple bridge that terminates the bridge chain and provides HPD + support. It build bridge on each USB-C connector device node. +endif +Should CONFIG_TYPEC_DP_ALTMODE select this one? Otherwise, we need to do it manually. $ grep -nr --include=Kconfig "select DRM_AUX_HPD_BRIDGE" . ./drivers/soc/qcom/Kconfig:118: select DRM_AUX_HPD_BRIDGE ./drivers/usb/typec/ucsi/Kconfig:88: select DRM_AUX_HPD_BRIDGE if DRM_BRIDGE && OF ./drivers/usb/typec/ucsi/Kconfig:99: select DRM_AUX_HPD_BRIDGE if DRM_BRIDGE && OF ./drivers/usb/typec/tcpm/Kconfig:62: select DRM_AUX_HPD_BRIDGE if DRM_BRIDGE && OF ./drivers/usb/typec/tcpm/Kconfig:85: select DRM_AUX_HPD_BRIDGE if DRM_BRIDGE && OFThat's a fair point. But based on the previous discussion, Heikki point out that configurations in the TYPEC subsystem should not select configurations from DRM.
I have just reviewed your previous patchsets but I did't find such opinion from Heikki. Otherwise, why are tcpm.c/ucsi.c already allowed to add the above select condition in their configs? I think Heikki means that the DRM_AUX_HPD_BRIDGE shouldn't been selected at the top level of Type-C subsystem. Because not all Type-C devices support the DP function. As a generic Type-C DP HPD bridge, displayport.c will likely need to use it in the future. Therefore, allowing displayport.c to select DRM_AUX_HPD_BRIDGE makes sense. According to my testing, it's impossible to build this driver in unless TYPEC_FUSB302 or a relevant CONFIG is built in to select DRM_AUX_HPD_BRIDGE, or the defconfig is modified. Thanks, Xu Yang