]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: tegra-dc: pass DC regmap to internal devices
authorSvyatoslav Ryhel <clamor95@gmail.com>
Mon, 27 Mar 2023 08:11:47 +0000 (11:11 +0300)
committerAnatolij Gustschin <agust@denx.de>
Fri, 7 Apr 2023 17:47:52 +0000 (19:47 +0200)
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@yahoo.com> # ASUS TF T30
Tested-by: Nicolas Chauvet <kwizart@gmail.com> # Paz00
Tested-by: Robert Eckelmann <longnoserob@gmail.com> # ASUS TF101 T20
Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # HTC One X T30
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
arch/arm/include/asm/arch-tegra/dc.h
drivers/video/tegra20/tegra-dc.c

index 6444af2993a033de27285102bc66be9b3b551a39..7613d84f221fd9e626fff598541fc63f0b4dd22a 100644 (file)
@@ -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 */
index 00462fa188c2e77a153f58dfe14acd9a5ad365e6..f53ad46397022c685abcc22c161405d20b50bbfd 100644 (file)
@@ -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);