drm/bridge: fsl-ldb: support downstream bridges in addition to panels
Subsystems (3)
PATCH 1/1 drm/bridge: fsl-ldb: support downstream bridges in addition to panels
The fsl-ldb driver currently only supports connecting to a drm_panel via of_drm_find_panel(). This prevents it from working with downstream bridge chips such as the ITE IT6263 LVDS-to-HDMI converter.
Replace of_drm_find_panel() + devm_drm_panel_bridge_add() with devm_drm_of_get_bridge(), which handles both panels and bridges.
This fixes the LVDS-to-HDMI display output path on i.MX8MP EVK.
--- drivers/gpu/drm/bridge/fsl-ldb.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/gpu/drm/bridge/fsl-ldb.c +3 -12
@@ -292,9 +292,7 @@ static const struct drm_bridge_funcs funcs = {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;
@@ -322,25 +320,18 @@ static int fsl_ldb_probe(struct platform_device *pdev) remote2 =of_graph_get_remote_node (dev->of_node,2 ,0 ); fsl_ldb->ch0_enabled = (remote1 !=NULL ); fsl_ldb->ch1_enabled = (remote2 !=NULL ); - panel_node =of_node_get (remote1 ? remote1 : remote2);of_node_put (remote1);of_node_put (remote2); -if (!fsl_ldb->ch0_enabled && !fsl_ldb->ch1_enabled) { -of_node_put (panel_node); +if (!fsl_ldb->ch0_enabled && !fsl_ldb->ch1_enabled)return dev_err_probe (dev, -ENXIO ,"No panel node found" ); - }dev_dbg (dev,"Using %s\n" ,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); + fsl_ldb->panel_bridge =devm_drm_of_get_bridge (dev, dev->of_node, + fsl_ldb->ch0_enabled ?1 :2 ,0 );if (IS_ERR (fsl_ldb->panel_bridge))return PTR_ERR (fsl_ldb->panel_bridge);
Signature · 1 line
2.43.0
Hi Xiaolei,
Quoted 8 lines · Xiaolei Wang
The fsl-ldb driver currently only supports connecting to a
drm_panelviaof_drm_find_panel(). This prevents it from working with downstream bridge chips such as the ITE IT6263 LVDS-to-HDMI converter.Replace
of_drm_find_panel()+devm_drm_panel_bridge_add()withdevm_drm_of_get_bridge(), which handles both panels and bridges.This fixes the LVDS-to-HDMI display output path on i.MX8MP EVK.
There's already a patch sent out for this:
https://lore.kernel.org/all/[email protected]/
Quoted 52 lines
Signed-off-by Xiaolei Wang <[email protected]>--- drivers/gpu/drm/bridge/fsl-ldb.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)drivers/gpu/drm/bridge/fsl-ldb.c +3
-12@@ -292,9 +292,7 @@ static const struct drm_bridge_funcs funcs = {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;@@ -322,25 +320,18 @@ static int fsl_ldb_probe(struct platform_device *pdev) remote2 =of_graph_get_remote_node (dev->of_node,2 ,0 ); fsl_ldb->ch0_enabled = (remote1 !=NULL ); fsl_ldb->ch1_enabled = (remote2 !=NULL ); - panel_node =of_node_get (remote1 ? remote1 : remote2);of_node_put (remote1);of_node_put (remote2); -if (!fsl_ldb->ch0_enabled && !fsl_ldb->ch1_enabled) { -of_node_put (panel_node); +if (!fsl_ldb->ch0_enabled && !fsl_ldb->ch1_enabled)return dev_err_probe (dev, -ENXIO ,"No panel node found" ); - }dev_dbg (dev,"Using %s\n" ,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); + fsl_ldb->panel_bridge =devm_drm_of_get_bridge (dev, dev->of_node, + fsl_ldb->ch0_enabled ?1 :2 ,0 );if (IS_ERR (fsl_ldb->panel_bridge))return PTR_ERR (fsl_ldb->panel_bridge);Signature · 1 line
2.43.0
Signature · 2 lines
Thanks, Laurentiu