[PATCH v1 4/4] drm/rockchip: dw_hdmi: Support to find the next bridge

From: Damon Ding

Date: Fri Apr 03 2026 - 03:03:25 EST


If there is a remote node connected to the HDMI output (port@1), the
&dw_hdmi_plat_data.output_port should be set to 1. This patch allows
Rockchip dw-hdmi to support the hdmi-connector and the next bridge.

Signed-off-by: Damon Ding <damon.ding@xxxxxxxxxxxxxx>
---
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index b5cfcb936078..014ac09fd733 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -544,6 +544,8 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
struct drm_encoder *encoder;
struct rockchip_hdmi *hdmi;
struct drm_connector *connector;
+ struct device_node *remote;
+ struct drm_bridge *next_bridge;
int ret;

if (!pdev->dev.of_node)
@@ -610,6 +612,18 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,

platform_set_drvdata(pdev, hdmi);

+ remote = of_graph_get_remote_node(hdmi->dev->of_node, 1, -1);
+ if (remote) {
+ of_node_put(remote);
+
+ ret = drm_of_find_panel_or_bridge(hdmi->dev->of_node, 1, 0,
+ NULL, &next_bridge);
+ if (ret && ret != -ENODEV)
+ goto err_cleanup_encoder;
+
+ plat_data->output_port = 1;
+ }
+
hdmi->hdmi = dw_hdmi_bind(pdev, encoder, plat_data, DRM_BRIDGE_ATTACH_NO_CONNECTOR);

/*
--
2.34.1