Skip to contentSkip to conversation

video: tegra: dc: improve DC id detection

PATCH In review Svyatoslav Ryhel 2 participants 3 messages Jun 18, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover video: tegra: dc: improve DC id detection

Use dedicated property to detect DC rather then use device name.

Svyatoslav Ryhel (1):
video: tegra20: dc: use nvidia,head property to identify DC controller

 drivers/video/tegra20/tegra-dc.c | 6 ++----
 drivers/video/tegra20/tegra-dc.h | 4 +---
 2 files changed, 3 insertions(+), 7 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/1 video: tegra20: dc: use nvidia, head property to identify DC controller

Use existing nvidia,head device tree property to get DC controller id.

---
 drivers/video/tegra20/tegra-dc.c | 6 ++----
 drivers/video/tegra20/tegra-dc.h | 4 +---
 2 files changed, 3 insertions(+), 7 deletions(-)
drivers/video/tegra20/tegra-dc.c +2 -4
index d073da7d7d..accabbf4db 100644
@@ -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) {
drivers/video/tegra20/tegra-dc.h +1 -3
index 05042dab1c..7d0c189ec8 100644
@@ -14,15 +14,13 @@
 /* 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 */
 };
 
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH v1 1/1] video: tegra20: dc: use nvidia,head property to identify DC controller

Quoted 7 lines · Svyatoslav Ryhel

Use existing nvidia,head device tree property to get DC controller id.

---
 drivers/video/tegra20/tegra-dc.c | 6 ++----
 drivers/video/tegra20/tegra-dc.h | 4 +---
 2 files changed, 3 insertions(+), 7 deletions(-)