From patchwork Tue Nov 22 20:57:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 1708023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aruba.it header.i=@aruba.it header.a=rsa-sha256 header.s=a1 header.b=kXz2/7zV; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NGxQv4nCRz23nt for ; Wed, 23 Nov 2022 07:57:27 +1100 (AEDT) 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) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 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 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)