[U-Boot] [PATCH 2/4] sunxi: display: Add support for panels with an active-low DE signal

Paul Kocialkowski contact at paulk.fr
Sat Oct 6 10:07:16 UTC 2018


This introduces a Kconfig option for indicating that the panel requires
the data enable (DE) signal driven low. The associated display flag is
set when converting the mode to display timings. It is later used for
setting the relevant bit in the TCON configuration registers.

This new option is kept separate from the VIDEO_LCD_MODE string because
the string format is expected to be kept in sync with the Linux
framebuffer definitions, that do not include this indication.

Signed-off-by: Paul Kocialkowski <contact at paulk.fr>
---
 arch/arm/include/asm/arch-sunxi/lcdc.h | 1 +
 arch/arm/mach-sunxi/Kconfig            | 8 ++++++++
 drivers/video/sunxi/lcdc.c             | 2 ++
 drivers/video/sunxi/sunxi_display.c    | 4 ++++
 4 files changed, 15 insertions(+)

diff --git a/arch/arm/include/asm/arch-sunxi/lcdc.h b/arch/arm/include/asm/arch-sunxi/lcdc.h
index 90216bcfd5..3ce450636a 100644
--- a/arch/arm/include/asm/arch-sunxi/lcdc.h
+++ b/arch/arm/include/asm/arch-sunxi/lcdc.h
@@ -64,6 +64,7 @@ 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_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/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index b868f0e350..a9fe3e4ab5 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -771,6 +771,14 @@ config VIDEO_LCD_DCLK_PHASE
 	---help---
 	Select LCD panel display clock phase shift, range 0-3.
 
+config VIDEO_LCD_DE_LOW
+	bool "LCD panel active-low data enable signal"
+	depends on VIDEO_SUNXI
+	default n
+	---help---
+	Make the data enable signal active-low when driving the LCD panel.
+	This should only be enabled if the panel actually needs it.
+
 config VIDEO_LCD_POWER
 	string "LCD panel power enable pin"
 	depends on VIDEO_SUNXI
diff --git a/drivers/video/sunxi/lcdc.c b/drivers/video/sunxi/lcdc.c
index ef851070b2..abcef81a45 100644
--- a/drivers/video/sunxi/lcdc.c
+++ b/drivers/video/sunxi/lcdc.c
@@ -135,6 +135,8 @@ 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;
 
 #ifdef CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH
 	if (for_ext_vga_dac)
diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c
index 5c8f88c42f..4baefee070 100644
--- a/drivers/video/sunxi/sunxi_display.c
+++ b/drivers/video/sunxi/sunxi_display.c
@@ -637,6 +637,10 @@ static void sunxi_ctfb_mode_to_display_timing(const struct ctfb_res_modes *mode,
 		timing->flags |= DISPLAY_FLAGS_VSYNC_LOW;
 	if (mode->vmode == FB_VMODE_INTERLACED)
 		timing->flags |= DISPLAY_FLAGS_INTERLACED;
+
+#ifdef CONFIG_VIDEO_LCD_DE_LOW
+	timing->flags |= DISPLAY_FLAGS_DE_LOW;
+#endif
 }
 
 static void sunxi_lcdc_tcon0_mode_set(const struct ctfb_res_modes *mode,
-- 
2.19.0



More information about the U-Boot mailing list