Skip to contentSkip to conversation

drm/bridge: tc358767: Handle bridge past DPI output

PATCH Applied Marek Vasut 2 participants 2 messages Jul 24, 2022 – Aug 29, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: tc358767: Handle bridge past DPI output

Currently the driver only handles panel directly connected to the DPI output. Handle the case where a bridge is connected past DPI output of this bridge. This could be e.g. DPI to LVDS encoder chip.

Cc Jonas Karlman <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>
---
 drivers/gpu/drm/bridge/tc358767.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/bridge/tc358767.c +8 -7
index f8c1cd711753b..814ab206fe7ef 100644
@@ -1926,22 +1926,23 @@ static int tc_mipi_dsi_host_attach(struct tc_data *tc)
 static int tc_probe_dpi_bridge_endpoint(struct tc_data *tc)
 {
 	struct device *dev = tc->dev;
+	struct drm_bridge *bridge;
 	struct drm_panel *panel;
 	int ret;
 
 	/* port@1 is the DPI input/output port */
-	ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, NULL);
+	ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, &bridge);
 	if (ret && ret != -ENODEV)
 		return ret;
 
 	if (panel) {
-		struct drm_bridge *panel_bridge;
-
-		panel_bridge = devm_drm_panel_bridge_add(dev, panel);
-		if (IS_ERR(panel_bridge))
-			return PTR_ERR(panel_bridge);
+		bridge = devm_drm_panel_bridge_add(dev, panel);
+		if (IS_ERR(bridge))
+			return PTR_ERR(bridge);
+	}
 
-		tc->panel_bridge = panel_bridge;
+	if (bridge) {
+		tc->panel_bridge = bridge;
 		tc->bridge.type = DRM_MODE_CONNECTOR_DPI;
 		tc->bridge.funcs = &tc_dpi_bridge_funcs;
 
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1 Applied
#1 lore raw

Hi Marek,

Quoted 53 lines · Marek Vasut

Currently the driver only handles panel directly connected to the DPI output. Handle the case where a bridge is connected past DPI output of this bridge. This could be e.g. DPI to LVDS encoder chip.

Cc Jonas Karlman <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>
---
 drivers/gpu/drm/bridge/tc358767.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/bridge/tc358767.c +8 -8
index f8c1cd711753b..814ab206fe7ef 100644
@@ -1926,22 +1926,23 @@ static int tc_mipi_dsi_host_attach(struct tc_data *tc)
 static int tc_probe_dpi_bridge_endpoint(struct tc_data *tc)
 {
        struct device *dev = tc->dev;
+       struct drm_bridge *bridge;
        struct drm_panel *panel;
        int ret;
 
        /* port@1 is the DPI input/output port */
-       ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, NULL);
+       ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, &bridge);
        if (ret && ret != -ENODEV)
                return ret;
 
        if (panel) {
-               struct drm_bridge *panel_bridge;
-
-               panel_bridge = devm_drm_panel_bridge_add(dev, panel);
-               if (IS_ERR(panel_bridge))
-                       return PTR_ERR(panel_bridge);
+               bridge = devm_drm_panel_bridge_add(dev, panel);
+               if (IS_ERR(bridge))
+                       return PTR_ERR(bridge);
+       }
 
-               tc->panel_bridge = panel_bridge;
+       if (bridge) {
+               tc->panel_bridge = bridge;
                tc->bridge.type = DRM_MODE_CONNECTOR_DPI;
                tc->bridge.funcs = &tc_dpi_bridge_funcs;
 
--
Quoted 1 line

2.35.1

Applied to drm-misc-next.