{"id":2230112,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2230112/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260429092828.3076719-2-andre.przywara@arm.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.1/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260429092828.3076719-2-andre.przywara@arm.com>","date":"2026-04-29T09:28:26","name":"[v2,1/3] sunxi: spl: fix SPL_SUNXI_LED active low configuration","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"c51469cb23383fc48dd3a4ebd7335c6d8e7e522f","submitter":{"id":61837,"url":"http://patchwork.ozlabs.org/api/1.1/people/61837/?format=json","name":"Andre Przywara","email":"andre.przywara@arm.com"},"delegate":{"id":114289,"url":"http://patchwork.ozlabs.org/api/1.1/users/114289/?format=json","username":"apritzel","first_name":"Andre","last_name":"Przywara","email":"andre.przywara@arm.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260429092828.3076719-2-andre.przywara@arm.com/mbox/","series":[{"id":502022,"url":"http://patchwork.ozlabs.org/api/1.1/series/502022/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=502022","date":"2026-04-29T09:28:25","name":"Funxi: Fix and extend SPL power LED support","version":2,"mbox":"http://patchwork.ozlabs.org/series/502022/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2230112/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2230112/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256\n header.s=foss header.b=hnMWm+S+;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=fail (p=none dis=none) header.from=arm.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=arm.com header.i=@arm.com header.b=\"hnMWm+S+\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=arm.com","phobos.denx.de;\n spf=pass smtp.mailfrom=andre.przywara@arm.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5Bnp0Dgvz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 19:29:02 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id BA1F884715;\n\tWed, 29 Apr 2026 11:28:46 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id E1C9C84840; Wed, 29 Apr 2026 11:28:44 +0200 (CEST)","from foss.arm.com (foss.arm.com [217.140.110.172])\n by phobos.denx.de (Postfix) with ESMTP id 415E384847\n for <u-boot@lists.denx.de>; Wed, 29 Apr 2026 11:28:40 +0200 (CEST)","from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1B7562A68;\n Wed, 29 Apr 2026 02:28:34 -0700 (PDT)","from e142021.munich.arm.com (e142021.arm.com [10.41.150.154])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3E5983F62B;\n Wed, 29 Apr 2026 02:28:38 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;\n t=1777454919; bh=RSXuzQ4mLtHUsBQXZ1AIixpv5FpaRIoOOXa3iB3UXw8=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=hnMWm+S+jKzniqpFloHnoR+loXjv4D21xRAnxk3wiwtEJGjtg3M4bLba+KfjZzMCp\n 9uOTSYSGOl5x5Ongzb4BtKcMHKO0wxJIq1zSV1I3USOZsYEyHY5tjjyykFANdGU1ff\n fp73QGr/LuKSNghtm8GugsUrkXjFxcqZxkJvPdrw=","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>,\n Jernej Skrabec <jernej.skrabec@gmail.com>,\n Paul Kocialkowski <paulk@sys-base.io>, 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>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"The newly introduced Allwinner SPL LED \"framework\" defined a\nSPL_SUNXI_LED_STATUS_STATE Kconfig symbol, that was supposed to denote\nthe active-low vs. active-high polarity of the LED. However this is\na bool symbol, so it will simply vanish if not defined, and we cannot use\nit directly inside a C statement.\n\nFilter the symbol through the IS_ENABLED() macro, which will return 0 if\nthe symbol is not defined, which is the intended value here.\n\nSince the STATUS_STATE name is a bit confusing, rename it to ACTIVE_HIGH\non the way, because that is its real meaning. Also the LED_STATUS_BIT\nname for the GPIO number is similarly a remnant of the old status LED\ncode, so rename it to LED_STATUS_GPIO as well.\n\nThis fixes configuring LEDs with active-low polarity.\n\nFixes: 256557dd9aae (\"sunxi: remove usage of legacy LED API\")\nSigned-off-by: Andre Przywara <andre.przywara@arm.com>\n---\n arch/arm/mach-sunxi/Kconfig | 10 ++++++----\n board/sunxi/board.c         |  4 ++--\n configs/pinephone_defconfig |  3 +--\n 3 files changed, 9 insertions(+), 8 deletions(-)","diff":"diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig\nindex 89f0e77bcdb..07d7ea2b7ad 100644\n--- a/arch/arm/mach-sunxi/Kconfig\n+++ b/arch/arm/mach-sunxi/Kconfig\n@@ -1245,15 +1245,17 @@ config SPL_SUNXI_LED_STATUS\n \n if SPL_SUNXI_LED_STATUS\n \n-config SPL_SUNXI_LED_STATUS_BIT\n+config SPL_SUNXI_LED_STATUS_GPIO\n \tint \"GPIO number for GPIO status LED\"\n \thelp\n \t  GPIO number for the GPIO controlling the GPIO status LED in SPL.\n \n-config SPL_SUNXI_LED_STATUS_STATE\n-\tbool \"GPIO status LED initial state is on\"\n+config SPL_SUNXI_LED_STATUS_ACTIVE_HIGH\n+\tbool \"GPIO status LED is active high\"\n+\tdefault y\n \thelp\n-\t  Whether the initial state of the status LED in SPL must be on or off.\n+\t  Whether the GPIO of the status LED must be set high or low to turn\n+\t  the LED on.\n \n endif # SPL_SUNXI_LED_STATUS\n \ndiff --git a/board/sunxi/board.c b/board/sunxi/board.c\nindex d7722d1858a..3d1afec7c66 100644\n--- a/board/sunxi/board.c\n+++ b/board/sunxi/board.c\n@@ -563,8 +563,8 @@ static void sunxi_spl_store_dram_size(phys_addr_t dram_size)\n static void status_led_init(void)\n {\n #if CONFIG_IS_ENABLED(SUNXI_LED_STATUS)\n-\tunsigned int state = CONFIG_SPL_SUNXI_LED_STATUS_STATE;\n-\tunsigned int gpio = CONFIG_SPL_SUNXI_LED_STATUS_BIT;\n+\tunsigned int state = IS_ENABLED(CONFIG_SPL_SUNXI_LED_STATUS_ACTIVE_HIGH);\n+\tunsigned int gpio = CONFIG_SPL_SUNXI_LED_STATUS_GPIO;\n \n \tgpio_request(gpio, \"gpio_led\");\n \tgpio_direction_output(gpio, state);\ndiff --git a/configs/pinephone_defconfig b/configs/pinephone_defconfig\nindex ed7dbc1852b..3a4f4ec51cf 100644\n--- a/configs/pinephone_defconfig\n+++ b/configs/pinephone_defconfig\n@@ -9,8 +9,7 @@ CONFIG_DRAM_ZQ=3881949\n CONFIG_MMC_SUNXI_SLOT_EXTRA=2\n CONFIG_PINEPHONE_DT_SELECTION=y\n CONFIG_SPL_SUNXI_LED_STATUS=y\n-CONFIG_SPL_SUNXI_LED_STATUS_BIT=114\n-CONFIG_SPL_SUNXI_LED_STATUS_STATE=y\n+CONFIG_SPL_SUNXI_LED_STATUS_GPIO=114\n # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set\n CONFIG_CMD_PSTORE=y\n CONFIG_CMD_PSTORE_MEM_ADDR=0x61000000\n","prefixes":["v2","1/3"]}