]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: tegra20: dc: use nvidia,head property to identify DC controller
authorSvyatoslav Ryhel <clamor95@gmail.com>
Tue, 14 May 2024 06:05:00 +0000 (09:05 +0300)
committerSvyatoslav Ryhel <clamor95@gmail.com>
Fri, 5 Jul 2024 06:01:37 +0000 (09:01 +0300)
Use existing nvidia,head device tree property to get DC controller id.

Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
drivers/video/tegra20/tegra-dc.c
drivers/video/tegra20/tegra-dc.h

index d073da7d7d43c6f324f18c3ac8bae3bddd7e67ce..accabbf4dbb71d75e3936d7e3f4bf3d3d9847c66 100644 (file)
@@ -49,7 +49,7 @@ struct tegra_lcd_priv {
        int dc_clk[2];                  /* Contains clk and its parent */
        ulong scdiv;                    /* Clock divider used by disp_clk_ctrl */
        bool rotation;                  /* 180 degree panel turn */
-       bool pipe;                      /* DC controller: 0 for A, 1 for B */
+       int pipe;                       /* DC controller: 0 for A, 1 for B */
 };
 
 enum {
@@ -461,9 +461,7 @@ static int tegra_lcd_of_to_plat(struct udevice *dev)
        }
 
        priv->rotation = dev_read_bool(dev, "nvidia,180-rotation");
-
-       if (!strcmp(dev->name, TEGRA_DC_B))
-               priv->pipe = 1;
+       priv->pipe = dev_read_u32_default(dev, "nvidia,head", 0);
 
        rgb = fdt_subnode_offset(blob, node, "rgb");
        if (rgb < 0) {
index 05042dab1c6c908fbd91cd7833da543012c5a4aa..7d0c189ec80225013b154a613d4ea2b1a55abf1a 100644 (file)
 /* arch-tegra/dc exists only because T124 uses it */
 #include <asm/arch-tegra/dc.h>
 
-#define TEGRA_DC_A             "dc@54200000"
-#define TEGRA_DC_B             "dc@54240000"
 #define TEGRA_DSI_A            "dsi@54300000"
 #define TEGRA_DSI_B            "dsi@54400000"
 
 struct tegra_dc_plat {
        struct udevice *dev;            /* Display controller device */
        struct dc_ctlr *dc;             /* Display controller regmap */
-       bool pipe;                      /* DC number: 0 for A, 1 for B */
+       int pipe;                       /* DC number: 0 for A, 1 for B */
        ulong scdiv;                    /* Shift clock divider */
 };