public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: ldb: add support for an external bridge
@ 2025-10-28 12:12 Francesco Valla
  2025-10-28 12:27 ` Alexander Stein
  2025-10-29  3:41 ` Liu Ying
  0 siblings, 2 replies; 5+ messages in thread
From: Francesco Valla @ 2025-10-28 12:12 UTC (permalink / raw)
  To: Liu Ying, Marek Vasut, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann
  Cc: Alexander Stein, Fabian Pflug, dri-devel, imx, linux-kernel

One option for the LVDS port of the LDB is to be connected to an
additional bridge, such as a LVDS to HDMI converter. Add support for
such case, along with the direct connection to a panel.

Signed-off-by: Francesco Valla <francesco@valla.it>
---
I was trying to add display support for the i.MX93 FRDM on top of the
patch sent some time ago by Fabian Pflug [1], using some of the work
already done by Alexander Stein but not yet merged [2], but then I
noticed that the support for LVDS-HDMI converter bridges was missing
from the LDB driver already present for the i.MX93.

Not a fail of the driver itself, obviously, but I wonder if/how the
existing i.MX8MP setups (e.g.: [3]), which use the same driver, work
correclty. Unfortunately I don't have the i.MX8MP hardware to test them.

Anyhow, a patch for such setup is attached; it was tested on the i.MX93
FRDM using [1] and [2] plus some more devicetree modifications.

[1] https://lore.kernel.org/all/20251022-fpg-nxp-imx93-frdm-v3-1-03ec40a1ccc0@pengutronix.de
[2] https://lore.kernel.org/all/20250304154929.1785200-1-alexander.stein@ew.tq-group.com
[3] https://elixir.bootlin.com/linux/v6.17.5/source/arch/arm64/boot/dts/freescale/imx8mp-evk-lvds0-imx-dlvds-hdmi-channel0.dtso

Regards,
Francesco
---
 drivers/gpu/drm/bridge/fsl-ldb.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/bridge/fsl-ldb.c b/drivers/gpu/drm/bridge/fsl-ldb.c
index 5c3cf37200bcee1db285c97e2b463c9355ee6acb..fad436f2e0bfac8b42096a6fcd0022da0f35284e 100644
--- a/drivers/gpu/drm/bridge/fsl-ldb.c
+++ b/drivers/gpu/drm/bridge/fsl-ldb.c
@@ -294,7 +294,6 @@ static int fsl_ldb_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct device_node *panel_node;
 	struct device_node *remote1, *remote2;
-	struct drm_panel *panel;
 	struct fsl_ldb *fsl_ldb;
 	int dual_link;
 
@@ -335,15 +334,24 @@ static int fsl_ldb_probe(struct platform_device *pdev)
 		fsl_ldb_is_dual(fsl_ldb) ? "dual-link mode" :
 		fsl_ldb->ch0_enabled ? "channel 0" : "channel 1");
 
-	panel = of_drm_find_panel(panel_node);
-	of_node_put(panel_node);
-	if (IS_ERR(panel))
-		return PTR_ERR(panel);
-
-	fsl_ldb->panel_bridge = devm_drm_panel_bridge_add(dev, panel);
-	if (IS_ERR(fsl_ldb->panel_bridge))
-		return PTR_ERR(fsl_ldb->panel_bridge);
+	/* First try to get an additional bridge, if not found go for a panel */
+	fsl_ldb->panel_bridge = of_drm_find_bridge(panel_node);
+	if (fsl_ldb->panel_bridge) {
+		of_node_put(panel_node);
+	} else {
+		struct drm_panel *panel;
 
+		panel = of_drm_find_panel(panel_node);
+		of_node_put(panel_node);
+		if (IS_ERR(panel))
+			return dev_err_probe(dev, PTR_ERR(panel),
+					     "Failed to find panel");
+
+		fsl_ldb->panel_bridge = devm_drm_panel_bridge_add(dev, panel);
+		if (IS_ERR(fsl_ldb->panel_bridge))
+			return dev_err_probe(dev, PTR_ERR(fsl_ldb->panel_bridge),
+					     "Failed to add panel bridge");
+	}
 
 	if (fsl_ldb_is_dual(fsl_ldb)) {
 		struct device_node *port1, *port2;

---
base-commit: fd57572253bc356330dbe5b233c2e1d8426c66fd
change-id: 20251028-imx93_ldb_bridge-3c011e7856dc

Best regards,
-- 
Francesco Valla <francesco@valla.it>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-29 13:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-28 12:12 [PATCH] drm/bridge: ldb: add support for an external bridge Francesco Valla
2025-10-28 12:27 ` Alexander Stein
2025-10-28 16:01   ` Francesco Valla
2025-10-29  3:41 ` Liu Ying
2025-10-29 13:01   ` Francesco Valla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox