75 lines
2.8 KiB
Diff
75 lines
2.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jernej Skrabec <[email protected]>
|
|
Date: Tue, 30 Sep 2025 18:57:00 +0200
|
|
Subject: drm/sun4i: Add H616 TCON TV support
|
|
|
|
It needs additional quirk to enable HDMI pads.
|
|
|
|
Signed-off-by: Jernej Skrabec <[email protected]>
|
|
---
|
|
drivers/gpu/drm/sun4i/sun4i_tcon.c | 13 ++++++++++
|
|
drivers/gpu/drm/sun4i/sun4i_tcon.h | 2 ++
|
|
2 files changed, 15 insertions(+)
|
|
|
|
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
|
|
index 111111111111..222222222222 100644
|
|
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
|
|
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
|
|
@@ -1286,6 +1286,11 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
|
|
tcon->id);
|
|
}
|
|
|
|
+ if (tcon->quirks->hdmi_pad)
|
|
+ regmap_update_bits(tcon->regs, SUN4I_TCON_GCTL_REG,
|
|
+ SUN4I_TCON_GCTL_PAD_SEL,
|
|
+ SUN4I_TCON_GCTL_PAD_SEL);
|
|
+
|
|
list_add_tail(&tcon->list, &drv->tcon_list);
|
|
|
|
return 0;
|
|
@@ -1544,6 +1549,13 @@ static const struct sun4i_tcon_quirks sun20i_d1_lcd_quirks = {
|
|
.set_mux = sun8i_r40_tcon_tv_set_mux,
|
|
};
|
|
|
|
+static const struct sun4i_tcon_quirks sun50i_h616_tv_quirks = {
|
|
+ .has_channel_1 = true,
|
|
+ .polarity_in_ch0 = true,
|
|
+ .hdmi_pad = true,
|
|
+ .set_mux = sun8i_r40_tcon_tv_set_mux,
|
|
+};
|
|
+
|
|
/* sun4i_drv uses this list to check if a device node is a TCON */
|
|
const struct of_device_id sun4i_tcon_of_table[] = {
|
|
{ .compatible = "allwinner,sun4i-a10-tcon", .data = &sun4i_a10_quirks },
|
|
@@ -1563,6 +1575,7 @@ const struct of_device_id sun4i_tcon_of_table[] = {
|
|
{ .compatible = "allwinner,sun9i-a80-tcon-tv", .data = &sun9i_a80_tcon_tv_quirks },
|
|
{ .compatible = "allwinner,sun20i-d1-tcon-lcd", .data = &sun20i_d1_lcd_quirks },
|
|
{ .compatible = "allwinner,sun20i-d1-tcon-tv", .data = &sun8i_r40_tv_quirks },
|
|
+ { .compatible = "allwinner,sun50i-h616-tcon-tv", .data = &sun50i_h616_tv_quirks },
|
|
{ }
|
|
};
|
|
MODULE_DEVICE_TABLE(of, sun4i_tcon_of_table);
|
|
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h
|
|
index 111111111111..222222222222 100644
|
|
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.h
|
|
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h
|
|
@@ -19,6 +19,7 @@
|
|
|
|
#define SUN4I_TCON_GCTL_REG 0x0
|
|
#define SUN4I_TCON_GCTL_TCON_ENABLE BIT(31)
|
|
+#define SUN4I_TCON_GCTL_PAD_SEL BIT(1)
|
|
#define SUN4I_TCON_GCTL_IOMAP_MASK BIT(0)
|
|
#define SUN4I_TCON_GCTL_IOMAP_TCON1 (1 << 0)
|
|
#define SUN4I_TCON_GCTL_IOMAP_TCON0 (0 << 0)
|
|
@@ -243,6 +244,7 @@ struct sun4i_tcon_quirks {
|
|
bool needs_edp_reset; /* a80 edp reset needed for tcon0 access */
|
|
bool supports_lvds; /* Does the TCON support an LVDS output? */
|
|
bool polarity_in_ch0; /* some tcon1 channels have polarity bits in tcon0 pol register */
|
|
+ bool hdmi_pad; /* h616 has to enable pad for HDMI */
|
|
u8 dclk_min_div; /* minimum divider for TCON0 DCLK */
|
|
|
|
/* callback to handle tcon muxing options */
|
|
--
|
|
Armbian
|
|
|