[PATCH v3 08/11] video: tegra-dc: pass DC regmap to internal devices
Svyatoslav Ryhel
clamor95 at gmail.com
Mon Mar 27 10:11:47 CEST 2023
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 <hedmoo at yahoo.com> # ASUS TF T30
Tested-by: Nicolas Chauvet <kwizart at gmail.com> # Paz00
Tested-by: Robert Eckelmann <longnoserob at gmail.com> # ASUS TF101 T20
Tested-by: Svyatoslav Ryhel <clamor95 at gmail.com> # HTC One X T30
Signed-off-by: Svyatoslav Ryhel <clamor95 at gmail.com>
---
arch/arm/include/asm/arch-tegra/dc.h | 8 ++++++++
drivers/video/tegra20/tegra-dc.c | 8 ++++++++
2 files changed, 16 insertions(+)
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 at 54300000"
+#define TEGRA_DSI_B "dsi at 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);
--
2.37.2
More information about the U-Boot
mailing list