From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from leonov.paulk.fr (leonov.paulk.fr [185.233.101.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74BDA30DEB2 for ; Tue, 28 Apr 2026 10:04:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.233.101.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777370675; cv=none; b=E1wDEJ0OUImTHU69mUQvKfy4D0nyBSGUihUuU/duW+gQT+16djeiPfqxu/Q5+5HK331iL/YzbT2yjBykm06/jNknynqhG1zd2aRlmzp9S1W6UlEJhtCUxldORs6OFj2jVzu8Ags80A+WyRIdlqcE4vuQhVj1lbaJtOZxq50tlbY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777370675; c=relaxed/simple; bh=OjaR3IIFv7ffVLzOXodVCIVkaI2QJ15psTtlOnQYaLg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Uwxoz716NLEea+E4abBim3TR8wTw7nDGj/9w4QyChDD5iX8nW9vP3bwdYB00nkqa2+sdqGlW4G3thiyRFdXCyjaYy0EapoIpjXXbuqPBcyL75gjoUsvmokpkX+pAZ7mPT7+T2lEYiTpXqf0uPAcL9FK4g6mUcPw5RX1Ta+oi9qk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sys-base.io; spf=pass smtp.mailfrom=sys-base.io; arc=none smtp.client-ip=185.233.101.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sys-base.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sys-base.io Received: from laika.paulk.fr (12.234.24.109.rev.sfr.net [109.24.234.12]) by leonov.paulk.fr (Postfix) with ESMTPS id CE0991F8005D for ; Tue, 28 Apr 2026 10:04:23 +0000 (UTC) Received: by laika.paulk.fr (Postfix, from userid 65534) id 1C1A3B40477; Tue, 28 Apr 2026 09:51:20 +0000 (UTC) X-Spam-Level: Received: from collins (unknown [192.168.1.1]) by laika.paulk.fr (Postfix) with ESMTPSA id 108BBB40465; Tue, 28 Apr 2026 09:51:19 +0000 (UTC) Date: Tue, 28 Apr 2026 11:51:17 +0200 From: Paul Kocialkowski To: Quentin Schulz Cc: Andre Przywara , u-boot@lists.denx.de, Tom Rini , Jernej Skrabec , linux-sunxi@lists.linux.dev Subject: Re: [PATCH 1/3] sunxi: spl: fix SPL_SUNXI_LED active low configuration Message-ID: References: <20260407223447.4956-1-andre.przywara@arm.com> <20260407223447.4956-2-andre.przywara@arm.com> <33493bbd-2364-4015-a3ab-858992800da9@arm.com> <8fd75285-39c3-4dfa-a163-41bc6628d995@cherry.de> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="M0nSqsiRV/4rKIHG" Content-Disposition: inline In-Reply-To: <8fd75285-39c3-4dfa-a163-41bc6628d995@cherry.de> --M0nSqsiRV/4rKIHG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Le Mon 27 Apr 26, 19:27, Quentin Schulz a =C3=A9crit : > Hi Andre, >=20 > On 4/27/26 3:07 PM, Andre Przywara wrote: > > Hi Quentin, Paul, > >=20 > > ah, it seems like LEDs are the "embedded bike shed", let me add my shade > > of blue ;-) > >=20 > > On 4/21/26 19:12, Quentin Schulz wrote: > > > Hi Paul, > > >=20 > > > On 4/9/26 5:56 PM, Paul Kocialkowski wrote: > > > > Hi, > > > >=20 > > > > On Wed 08 Apr 26, 00:34, Andre Przywara wrote: > > > > > The newly introduced Allwinner SPL LED "framework" defined a > > > > > SPL_SUNXI_LED_STATUS_STATE Kconfig symbol, that was supposed to d= enote > > > > > 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. > > > > >=20 > > > > > Filter the symbol through the IS_ENABLED() macro, which will > > > > > return 0 if > > > > > the symbol is not defined, which is the intended value here. > > > > >=20 > > > > > This fixes configuring LEDs with active-low polarity. > > > > >=20 > > > > > Signed-off-by: Andre Przywara > > > > > --- > > > > > =C2=A0 board/sunxi/board.c | 2 +- > > > > > =C2=A0 1 file changed, 1 insertion(+), 1 deletion(-) > > > > >=20 > > > > > 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) > > > > > =C2=A0 static void status_led_init(void) > > > > > =C2=A0 { > > > > > =C2=A0 #if CONFIG_IS_ENABLED(SUNXI_LED_STATUS) > > > > > -=C2=A0=C2=A0=C2=A0 unsigned int state =3D CONFIG_SPL_SUNXI_LED_S= TATUS_STATE; > > > > > +=C2=A0=C2=A0=C2=A0 unsigned int state =3D > > > > > IS_ENABLED(CONFIG_SPL_SUNXI_LED_STATUS_STATE); > > > >=20 > > > > Sorry I didn't react to the initial submission, but it feels like t= he > > > > CONFIG_SPL_SUNXI_LED_STATUS_STATE symbol really means > > > > active-high if enabled > > > > and active-low if disabled. The name would suggest that it's an > > > > int with a value > > > > of either 0 or 1 instead. > > > >=20 > > >=20 > > > Yeah, I lazily renamed the old CONFIG_LED_STATUS_STATE which used to > > > be an int range (0..2) and made it both specific for Allwinner as > > > well as changing it into a bool. > > >=20 > > > > I think it would be less confusing to call the symbol > > > > CONFIG_SPL_SUNXI_LED_STATUS_ACTIVE_LOW and reverse its meaning, > > > > so that we can > > > > spare defining it in most configs (that will be active-high). > > >=20 > > > You can also have > > > default y > > > in your symbol to not have to reverse the meaning. > >=20 > > So what about: > > config CONFIG_SPL_SUNXI_LED_STATUS_ACTIVE_HIGH > > =C2=A0=C2=A0=C2=A0=C2=A0default y > > then? Sounds good to me! > > > > Also the description currently mentions "initial state" which > > > > may be confusing > > > > as it could refer to the state inherited after reset (e.g. due > > > > to some pull > > > > resistor) or the state we do set in the SPL. > > > >=20 > > >=20 > > > It was the prompt for the now removed LED_STATUS_STATE. What are you > > > suggesting instead? > >=20 > > I came up with: > > Whether the GPIO of the status LED must be set high or low to turn the > > LED on. > > Thoughts? Looks good. > > >=20 > > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int gpio =3D CONFIG_SPL_S= UNXI_LED_STATUS_BIT; > > > >=20 > > > > And while at it I would rename this to something like: > > > > CONFIG_SPL_SUNXI_LED_STATUS_GPIO since it indicates the GPIO > > > > number, not a > > > > specific bit in a sunxi-specific kind of register. > > > >=20 > > >=20 > > > Also a remnant of LED_STATUS_BIT* symbols. Either work for me. > >=20 > > Yes, indeed CONFIG_LED_STATUS_GPIO makes much more sense. > >=20 >=20 > CONFIG_SPL_SUNXI_LED_STATUS_GPIO I'm assuming? >=20 > > Let me know what you think. > >=20 >=20 > Ack to all but I also don't care too much about Allwinner. @Paul? Yes Andre's proposal sounds fine, I'm all for it. Thanks for looking at this. Paul --=20 Paul Kocialkowski, Independent contractor - sys-base - https://www.sys-base.io/ Free software developer - https://www.paulk.fr/ Expert in multimedia, graphics and embedded hardware support with Linux. --M0nSqsiRV/4rKIHG Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEAbcMXZQMtj1fphLChP3B6o/ulQwFAmnwgxQACgkQhP3B6o/u lQynTQ//c2H3B8AQrI1ibCD/5n8S0I56hITpO8xSxB9HOLqtpY0wY0R6ZhX3RFQK l2AmOhYhx+tjun7yeEDgQXTPERjBHdx7ZKgmewJTvcFyZbmdsHLE9jfl0Jvn8G+t aaYbjZ7jZZHx7usIld6gA79li89sWunb8oSuFrYn8ps8/boGeiFQowoV9aPxIYWs uraiOa9kyOTNEUBaXoFjoWh0IGRTdpPLRg/QmpzCq5rHwaFLKT5SXOLto9w4OA+E vxPxpIXsprzzeJtwu2x/6HJLV5enGO8T05cLQ2EbNvHTvOr/U/Xin/umQ2A/4LIa tSPlw1NSJfgfYFhly2DLwjplBW6n2uHSxd5bcwmiMr6ycaeEvPpfoxkiJxvReVwk +v2lMO3cUgYs6ZCLff9hsHKJwdG9MuM+GghjMGq6EZ5wuNNE1nk19/0nsipaHUg5 ORL1CHWkuKmc2lebHbFYmp/4ZGlSjVlr4Sw9kHKr4g7r3J2rz4qruG5deGwtHpfL 9eJFgpxRxGPg8nV6IEX4PhV/QDaF2qnq5lBWrY/wKXsGuJ/eipocyAMH2PWYWXgl pxBOZVFptbgYo07OrKfEr7IZMY0c8jwy+yfmuCbGWYcuMcWXTscioEaAz4uIsOUE dAaWRMVpp9Zd4q2RmcLi67aimw7O33FQOyMg8jAUP2AmocsdZtw= =T4IS -----END PGP SIGNATURE----- --M0nSqsiRV/4rKIHG--