[PATCH 2/2] sunxi: video: Support DE_LOW and PIXDATA_NEGEDGE display flags

John Watts contact at jookia.org
Fri Jun 14 14:28:46 CEST 2024


Implement these by inverting the DE and PCLK polarities.

Signed-off-by: John Watts <contact at jookia.org>
---
 arch/arm/include/asm/arch-sunxi/lcdc.h | 2 ++
 drivers/video/sunxi/lcdc.c             | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/include/asm/arch-sunxi/lcdc.h b/arch/arm/include/asm/arch-sunxi/lcdc.h
index 90216bcfd5..580cd6af20 100644
--- a/arch/arm/include/asm/arch-sunxi/lcdc.h
+++ b/arch/arm/include/asm/arch-sunxi/lcdc.h
@@ -64,6 +64,8 @@ struct sunxi_lcdc_reg {
 #define SUNXI_LCDC_Y(y)				(((y) - 1) << 0)
 #define SUNXI_LCDC_TCON_VSYNC_MASK		(1 << 24)
 #define SUNXI_LCDC_TCON_HSYNC_MASK		(1 << 25)
+#define SUNXI_LCDC_TCON_PIXDATA_MASK		(1 << 26)
+#define SUNXI_LCDC_TCON_DE_MASK			(1 << 27)
 #define SUNXI_LCDC_CTRL_IO_MAP_MASK		(1 << 0)
 #define SUNXI_LCDC_CTRL_IO_MAP_TCON0		(0 << 0)
 #define SUNXI_LCDC_CTRL_IO_MAP_TCON1		(1 << 0)
diff --git a/drivers/video/sunxi/lcdc.c b/drivers/video/sunxi/lcdc.c
index 4fcea6050a..169da7654e 100644
--- a/drivers/video/sunxi/lcdc.c
+++ b/drivers/video/sunxi/lcdc.c
@@ -137,6 +137,10 @@ void lcdc_tcon0_mode_set(struct sunxi_lcdc_reg * const lcdc,
 		val |= SUNXI_LCDC_TCON_HSYNC_MASK;
 	if (mode->flags & DISPLAY_FLAGS_VSYNC_HIGH)
 		val |= SUNXI_LCDC_TCON_VSYNC_MASK;
+	if (mode->flags & DISPLAY_FLAGS_DE_LOW)
+		val |= SUNXI_LCDC_TCON_DE_MASK;
+	if (mode->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
+		val |= SUNXI_LCDC_TCON_PIXDATA_MASK;
 
 #ifdef CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH
 	if (for_ext_vga_dac)

-- 
2.45.2



More information about the U-Boot mailing list