From: Svyatoslav Ryhel Date: Sat, 15 Feb 2025 17:48:44 +0000 (+0200) Subject: video: tegra20: dc: convert to use of_graph X-Git-Tag: v2025.07-rc1~18^2~12^2~43 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=052c2630e50a01529eb0c0143555712d8b9eff08;p=pandora-u-boot.git video: tegra20: dc: convert to use of_graph Use OF graph as a main bridge/panel source, preserving backwards compatibility with phandle implementation. Signed-off-by: Svyatoslav Ryhel --- diff --git a/drivers/video/tegra20/tegra-dc.c b/drivers/video/tegra20/tegra-dc.c index 6b8275ef9fa..775043bb1fe 100644 --- a/drivers/video/tegra20/tegra-dc.c +++ b/drivers/video/tegra20/tegra-dc.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -443,6 +444,18 @@ static int tegra_lcd_configure_rgb(struct udevice *dev, ofnode rgb) ofnode remote; int ret; + /* DC can have only 1 port */ + remote = ofnode_graph_get_remote_node(rgb, -1, -1); + + ret = uclass_get_device_by_ofnode(UCLASS_PANEL, remote, &priv->panel); + if (!ret) + return 0; + + ret = uclass_get_device_by_ofnode(UCLASS_VIDEO_BRIDGE, remote, &priv->bridge); + if (!ret) + return 0; + + /* Try legacy method if graph did not work */ remote = ofnode_parse_phandle(rgb, "nvidia,panel", 0); if (!ofnode_valid(remote)) return -EINVAL;