From: Svyatoslav Ryhel Date: Mon, 27 Mar 2023 08:11:47 +0000 (+0300) Subject: video: tegra-dc: pass DC regmap to internal devices X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=a8f4f9f8153ce885f4344961e49a4b3c1adb2414;p=u-boot.git video: tegra-dc: pass DC regmap to internal devices Internal video devices like DSI and HDMI controllers require sending commands into DC register field. To make this available, lets create platform data, which is restricted to pass DC regmap only to pre-defined devices. Tested-by: Andreas Westman Dorcsak # ASUS TF T30 Tested-by: Nicolas Chauvet # Paz00 Tested-by: Robert Eckelmann # ASUS TF101 T20 Tested-by: Svyatoslav Ryhel # HTC One X T30 Signed-off-by: Svyatoslav Ryhel --- diff --git a/arch/arm/include/asm/arch-tegra/dc.h b/arch/arm/include/asm/arch-tegra/dc.h index 6444af2993..7613d84f22 100644 --- a/arch/arm/include/asm/arch-tegra/dc.h +++ b/arch/arm/include/asm/arch-tegra/dc.h @@ -569,4 +569,12 @@ enum { #define DC_N_WINDOWS 5 #define DC_REG_SAVE_SPACE (DC_N_WINDOWS + 5) +#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 */ +}; + #endif /* __ASM_ARCH_TEGRA_DC_H */ diff --git a/drivers/video/tegra20/tegra-dc.c b/drivers/video/tegra20/tegra-dc.c index 00462fa188..f53ad46397 100644 --- a/drivers/video/tegra20/tegra-dc.c +++ b/drivers/video/tegra20/tegra-dc.c @@ -417,6 +417,14 @@ static int tegra_lcd_of_to_plat(struct udevice *dev) return ret; } + if (!strcmp(priv->panel->name, TEGRA_DSI_A) || + !strcmp(priv->panel->name, TEGRA_DSI_B)) { + struct tegra_dc_plat *dc_plat = dev_get_plat(priv->panel); + + dc_plat->dev = dev; + dc_plat->dc = priv->dc; + } + ret = panel_get_display_timing(priv->panel, &priv->timing); if (ret) { ret = fdtdec_decode_display_timing(blob, rgb, 0, &priv->timing);