From patchwork Sat Oct 6 10:07:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 979928 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=paulk.fr Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42S2Rh1QsVz9s55 for ; Sat, 6 Oct 2018 20:09:51 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A865EC21E77; Sat, 6 Oct 2018 10:09:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=KHOP_BIG_TO_CC autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 57214C21E6A; Sat, 6 Oct 2018 10:09:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 87395C21E07; Sat, 6 Oct 2018 10:09:22 +0000 (UTC) Received: from leonov.paulk.fr (leonov.paulk.fr [185.233.101.22]) by lists.denx.de (Postfix) with ESMTPS id EE060C21BE5 for ; Sat, 6 Oct 2018 10:09:09 +0000 (UTC) Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 5CB40BFDEA for ; Sat, 6 Oct 2018 12:09:09 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id 98178C0F92; Sat, 6 Oct 2018 12:09:08 +0200 (CEST) Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id 1D2B4C1052; Sat, 6 Oct 2018 12:07:39 +0200 (CEST) From: Paul Kocialkowski To: u-boot@lists.denx.de Date: Sat, 6 Oct 2018 12:07:16 +0200 Message-Id: <20181006100718.3482-2-contact@paulk.fr> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181006100718.3482-1-contact@paulk.fr> References: <20181006100718.3482-1-contact@paulk.fr> MIME-Version: 1.0 Cc: Mark Van den Borre , Maxime Ripard , Aleksei Mamlin , linux-sunxi@googlegroups.com, Stefan Mavrodiev , Hans de Goede , Priit Laes , Icenowy Zheng , Stefan Roese , Jagan Teki , Luc Verhaegen , Gerry Demaret Subject: [U-Boot] [PATCH 2/4] sunxi: display: Add support for panels with an active-low DE signal X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- 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,