diff options
| author | Svyatoslav Ryhel <[email protected]> | 2025-02-15 19:48:44 +0200 |
|---|---|---|
| committer | Svyatoslav Ryhel <[email protected]> | 2025-03-13 19:13:17 +0200 |
| commit | 052c2630e50a01529eb0c0143555712d8b9eff08 (patch) | |
| tree | 5721e01c324d9c27effb8a510e4d001a22c50696 | |
| parent | 811a85af8efd7c7b46ecde708c8177abde4f68f1 (diff) | |
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 <[email protected]>
| -rw-r--r-- | drivers/video/tegra20/tegra-dc.c | 13 |
1 files changed, 13 insertions, 0 deletions
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 <cpu_func.h> #include <clk.h> #include <dm.h> +#include <dm/ofnode_graph.h> #include <fdtdec.h> #include <log.h> #include <panel.h> @@ -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; |
