From patchwork Wed Apr 29 09:28:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 2064 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 95A3A1C00D1 for ; Wed, 29 Apr 2026 11:28:50 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=arm.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-22991-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-22991-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id A532F300938D for ; Wed, 29 Apr 2026 09:28:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A02E3BF66C; Wed, 29 Apr 2026 09:28:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="hnMWm+S+" X-Original-To: linux-sunxi@lists.linux.dev Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE7FD191F91 for ; Wed, 29 Apr 2026 09:28:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777454923; cv=none; b=acLe0LAt5Sl0fF9Vh9g0tJLK4W5+0fHKyPnN9dQtbiceMXJS3InWgR0yTwGQD4wFM9emzDmzeiVzCYlqQalOqhzUhtNB7X0KNjY5+nClWD7o32ndaby1Dl7BtgmRvsOOfx1aDD1dcfzld15pYGQC3hsR/GkiZaenZnIeVaOPygw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777454923; c=relaxed/simple; bh=RSXuzQ4mLtHUsBQXZ1AIixpv5FpaRIoOOXa3iB3UXw8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CTN+0pYYqWN7wbEetpvyHCaUxmNcfiCRVlGkFLhNFM9HoifHl3ICiUsz6D6tjzireMuXv2J3fuGxNsP+Hvx94hHRnBol59wHnVAnl4DxGaszko6YmfGlnoCJ1lYaGMcg6iVfv+FIh4W4hi+HGNE1uVGtltoOAsHiv1MTMJ0x/WM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=hnMWm+S+; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1B7562A68; Wed, 29 Apr 2026 02:28:34 -0700 (PDT) Received: from e142021.munich.arm.com (e142021.arm.com [10.41.150.154]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3E5983F62B; Wed, 29 Apr 2026 02:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1777454919; bh=RSXuzQ4mLtHUsBQXZ1AIixpv5FpaRIoOOXa3iB3UXw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hnMWm+S+jKzniqpFloHnoR+loXjv4D21xRAnxk3wiwtEJGjtg3M4bLba+KfjZzMCp 9uOTSYSGOl5x5Ongzb4BtKcMHKO0wxJIq1zSV1I3USOZsYEyHY5tjjyykFANdGU1ff fp73QGr/LuKSNghtm8GugsUrkXjFxcqZxkJvPdrw= From: Andre Przywara To: u-boot@lists.denx.de Cc: Tom Rini , Quentin Schulz , Jernej Skrabec , Paul Kocialkowski , linux-sunxi@lists.linux.dev Subject: [PATCH v2 1/3] sunxi: spl: fix SPL_SUNXI_LED active low configuration Date: Wed, 29 Apr 2026 11:28:26 +0200 Message-ID: <20260429092828.3076719-2-andre.przywara@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429092828.3076719-1-andre.przywara@arm.com> References: <20260429092828.3076719-1-andre.przywara@arm.com> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.84 / 15.00]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; FROM_HAS_DN(0.00)[]; PRECEDENCE_BULK(0.00)[]; TAGGED_RCPT(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo,arm.com:email,arm.com:dkim]; FORGED_SENDER_MAILLIST(0.00)[]; FREEMAIL_CC(0.00)[konsulko.com,cherry.de,gmail.com,sys-base.io,lists.linux.dev]; R_DKIM_ALLOW(0.00)[arm.com:s=foss]; FROM_NEQ_ENVFROM(0.00)[andre.przywara@arm.com,linux-sunxi@lists.linux.dev]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[arm.com:+]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.90.174.1:received]; TO_DN_SOME(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; DMARC_POLICY_ALLOW(0.00)[arm.com,none]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-22991-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; RCVD_TLS_LAST(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[104.64.211.4:from] X-Rspamd-Queue-Id: 95A3A1C00D1 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The newly introduced Allwinner SPL LED "framework" defined a SPL_SUNXI_LED_STATUS_STATE Kconfig symbol, that was supposed to denote the active-low vs. active-high polarity of the LED. However this is a bool symbol, so it will simply vanish if not defined, and we cannot use it directly inside a C statement. Filter the symbol through the IS_ENABLED() macro, which will return 0 if the symbol is not defined, which is the intended value here. Since the STATUS_STATE name is a bit confusing, rename it to ACTIVE_HIGH on the way, because that is its real meaning. Also the LED_STATUS_BIT name for the GPIO number is similarly a remnant of the old status LED code, so rename it to LED_STATUS_GPIO as well. This fixes configuring LEDs with active-low polarity. Fixes: 256557dd9aae ("sunxi: remove usage of legacy LED API") Signed-off-by: Andre Przywara Reported-by: Paul Kocialkowski Acked-by: Quentin Schulz Reviewed-by: Paul Kocialkowski --- arch/arm/mach-sunxi/Kconfig | 10 ++++++---- board/sunxi/board.c | 4 ++-- configs/pinephone_defconfig | 3 +-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 89f0e77bcdb..07d7ea2b7ad 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -1245,15 +1245,17 @@ config SPL_SUNXI_LED_STATUS if SPL_SUNXI_LED_STATUS -config SPL_SUNXI_LED_STATUS_BIT +config SPL_SUNXI_LED_STATUS_GPIO int "GPIO number for GPIO status LED" help GPIO number for the GPIO controlling the GPIO status LED in SPL. -config SPL_SUNXI_LED_STATUS_STATE - bool "GPIO status LED initial state is on" +config SPL_SUNXI_LED_STATUS_ACTIVE_HIGH + bool "GPIO status LED is active high" + default y help - Whether the initial state of the status LED in SPL must be on or off. + Whether the GPIO of the status LED must be set high or low to turn + the LED on. endif # SPL_SUNXI_LED_STATUS diff --git a/board/sunxi/board.c b/board/sunxi/board.c index d7722d1858a..3d1afec7c66 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -563,8 +563,8 @@ static void sunxi_spl_store_dram_size(phys_addr_t dram_size) static void status_led_init(void) { #if CONFIG_IS_ENABLED(SUNXI_LED_STATUS) - unsigned int state = CONFIG_SPL_SUNXI_LED_STATUS_STATE; - unsigned int gpio = CONFIG_SPL_SUNXI_LED_STATUS_BIT; + unsigned int state = IS_ENABLED(CONFIG_SPL_SUNXI_LED_STATUS_ACTIVE_HIGH); + unsigned int gpio = CONFIG_SPL_SUNXI_LED_STATUS_GPIO; gpio_request(gpio, "gpio_led"); gpio_direction_output(gpio, state); diff --git a/configs/pinephone_defconfig b/configs/pinephone_defconfig index ed7dbc1852b..3a4f4ec51cf 100644 --- a/configs/pinephone_defconfig +++ b/configs/pinephone_defconfig @@ -9,8 +9,7 @@ CONFIG_DRAM_ZQ=3881949 CONFIG_MMC_SUNXI_SLOT_EXTRA=2 CONFIG_PINEPHONE_DT_SELECTION=y CONFIG_SPL_SUNXI_LED_STATUS=y -CONFIG_SPL_SUNXI_LED_STATUS_BIT=114 -CONFIG_SPL_SUNXI_LED_STATUS_STATE=y +CONFIG_SPL_SUNXI_LED_STATUS_GPIO=114 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_CMD_PSTORE=y CONFIG_CMD_PSTORE_MEM_ADDR=0x61000000