public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Paul Kocialkowski <contact@paulk.fr>,
	linux-sunxi@lists.linux.dev
Subject: [PATCH 1/3] sunxi: spl: fix SPL_SUNXI_LED active low configuration
Date: Wed,  8 Apr 2026 00:34:45 +0200	[thread overview]
Message-ID: <20260407223447.4956-2-andre.przywara@arm.com> (raw)
In-Reply-To: <20260407223447.4956-1-andre.przywara@arm.com>

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.

This fixes configuring LEDs with active-low polarity.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 board/sunxi/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index d7722d1858a..80dcae9c1a4 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -563,7 +563,7 @@ 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 state = IS_ENABLED(CONFIG_SPL_SUNXI_LED_STATUS_STATE);
 	unsigned int gpio = CONFIG_SPL_SUNXI_LED_STATUS_BIT;
 
 	gpio_request(gpio, "gpio_led");
-- 
2.46.4


  reply	other threads:[~2026-04-07 22:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 22:34 [PATCH 0/3] sunxi: Fix and extend SPL power LED support Andre Przywara
2026-04-07 22:34 ` Andre Przywara [this message]
2026-04-08  8:27   ` [PATCH 1/3] sunxi: spl: fix SPL_SUNXI_LED active low configuration Quentin Schulz
2026-04-09 15:56   ` Paul Kocialkowski
2026-04-07 22:34 ` [PATCH 2/3] sunxi: configs: enable power LEDs on 32-bit boards Andre Przywara
2026-04-07 22:34 ` [PATCH 3/3] sunxi: configs: enable power LEDs on 64-bit boards Andre Przywara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260407223447.4956-2-andre.przywara@arm.com \
    --to=andre.przywara@arm.com \
    --cc=contact@paulk.fr \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=quentin.schulz@cherry.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox