Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60270C433FE for ; Tue, 22 Nov 2022 20:57:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 65070854C8; Tue, 22 Nov 2022 21:57:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=benettiengineering.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=aruba.it header.i=@aruba.it header.b="kXz2/7zV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F1E0F853CD; Tue, 22 Nov 2022 21:57:09 +0100 (CET) Received: from smtpcmd0986.aruba.it (smtpcmd0986.aruba.it [62.149.156.86]) by phobos.denx.de (Postfix) with ESMTP id A38C9854BE for ; Tue, 22 Nov 2022 21:57:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=benettiengineering.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=giulio.benetti@benettiengineering.com Received: from localhost.localdomain ([146.241.87.80]) by Aruba Outgoing Smtp with ESMTPSA id xaKGoMQgwnCOGxaKHoOGmK; Tue, 22 Nov 2022 21:57:05 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1669150625; bh=OxE54TEv0TgzC0pYNUDGb4tGKYqtJdVamfrcppQq7uE=; h=From:To:Subject:Date:MIME-Version; b=kXz2/7zVNeL6jc9EeiSEr77cXKeIdEzkZ4hfkeU9ESAFMvOoANKR64R3Y4v+Q21oz WHEZsrCHzEyZJZjNyhWY10mByRxqmed5DSjPDU9/0x1HgzyHy1byLvBP/jhUXhd4jr VjF9NXVDYs2/nPN2CHSNHVMzmx37P7ggckNgDLDcO9LUHOrmZM76k0jOQqXuv7yhrh Lm8t4usad6bQa9bwq3MPGjwFBNLa3yFWx3vyPQ4jmcW7gexYI87/SaAE+aWYYMahX0 F3v9kpfGjnCHl47eWJFtmXPxzKoeR4al7m7zkuOqQHLzO1MjkfkqoQc8EdxPMeZEjd q9z2kRyUzp6Fw== From: Giulio Benetti To: u-boot@lists.denx.de Cc: Jagan Teki , Andre Przywara , Anatolij Gustschin , Giulio Benetti Subject: [PATCH 2/2] sunxi: video: Add support for active low LCD power pin Date: Tue, 22 Nov 2022 21:57:03 +0100 Message-Id: <20221122205703.1084533-2-giulio.benetti@benettiengineering.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221122205703.1084533-1-giulio.benetti@benettiengineering.com> References: <20221122205703.1084533-1-giulio.benetti@benettiengineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfKqlG43ulezKV5A/DbPEgbNHUr0rp6SDMC39NLh/Wt+Om4UybqOVcrSk4pqZiGo6gt9ZIlzvv8W34ABHCvkn6GRBvTl+NUQjW6KHXSyWHkBqF7nJm3sq THG0XYvA6fVOCuOEo0pkwTDb8ZrSqsu/zdGtBXSUb+9JMkUUGnE9j4/9xbEQZY/7QhDUpU/7JgxeS4+3aG8UB1v6kll+Ur3phSxQehSNl3aYM+y5lqqIMCNS cZqugS8eAGAf4v2vzIs51777E+FCMlyS0Zcg4hnUw0Oa/KfEbywsWEDGN2/RxGhDsGDAWQxJbfIy/yo50OTRtQ17FPhpgwUveB4zPYpuzGxJCjD47VkX/0KK GB4qvhEC6jm7MFcTjAtUHyq2nh33Xg== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On some board gpio to power LCD can be active low, so let's add CONFIG_VIDEO_LCD_POWER_ACTIVE_LOW to allow this. Signed-off-by: Giulio Benetti --- arch/arm/mach-sunxi/Kconfig | 7 +++++++ drivers/video/sunxi/sunxi_display.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index dbe6005daa..a7375b53a6 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -867,6 +867,13 @@ config VIDEO_LCD_POWER Set the power enable pin for the LCD panel. This takes a string in the format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H. +config VIDEO_LCD_POWER_ACTIVE_LOW + bool "LCD panel power enable pin is inverted" + depends on VIDEO_SUNXI + default n + ---help--- + Set this if the lcd power pin is active low. + config VIDEO_LCD_RESET string "LCD panel reset pin" depends on VIDEO_SUNXI diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c index 2ee6212c58..12b542d65b 100644 --- a/drivers/video/sunxi/sunxi_display.c +++ b/drivers/video/sunxi/sunxi_display.c @@ -588,7 +588,11 @@ static void sunxi_lcdc_panel_enable(void) pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_POWER); if (pin >= 0) { gpio_request(pin, "lcd_power"); +#ifdef CONFIG_VIDEO_LCD_POWER_ACTIVE_LOW + gpio_direction_output(pin, 0); +#else gpio_direction_output(pin, 1); +#endif } if (reset_pin >= 0) -- 2.34.1