From dc2427ab20d71258c21379ebc575f05ac9d10141 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Wed, 8 Apr 2026 00:34:45 +0200 Subject: sunxi: spl: fix SPL_SUNXI_LED active low configuration 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 Reviewed-by: Paul Kocialkowski Closes: https://lore.kernel.org/u-boot/adfMQBPdntWy1KIq@shepard/ Acked-by: Quentin Schulz --- board/sunxi/board.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'board') 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); -- cgit v1.2.3