[PATCH v3] sunxi: remove usage of legacy LED API
Simon Glass
sjg at chromium.org
Tue Feb 3 22:31:10 CET 2026
On Thu, 29 Jan 2026 at 05:01, Quentin Schulz <foss+uboot at 0leil.net> wrote:
>
> From: Quentin Schulz <quentin.schulz at cherry.de>
>
> We are trying to get rid of the legacy LED API and PinePhone is one of
> the last ones requiring it.
>
> Unlike all other users of the legacy LED API, PinePhone is controlling
> the GPIO LED in SPL. Unfortunately, Sunxi doesn't enable DM support in
> SPL because of tight space constraints, so we cannot make use of the
> modern LED framework as that is based on DM_GPIO.
>
> Since PinePhone is the last user of this API, I'm moving the logic to
> Sunxi SPL code and will let this community decide how to handle this hot
> potato.
>
> The logic is extremely simplified as only one GPIO LED is currently
> controlled in SPL by PinePhone. No need for handling multiple LEDs or
> inverted polarity, let's keep it simple.
>
> This however allows us to use the modern LED framework once in U-Boot
> proper since this logic won't collide with the new framework.
>
> Since the only misc drivers that were compiled in SPL were guarded by
> CONFIG_LED_STATUS and CONFIG_LED_STATUS_GPIO, we can also disable
> CONFIG_SPL_DRIVERS_MISC (which does nothing anymore).
>
> This also saves some space for PinePhone in SPL and proper.
>
> Tested-by: Andre Przywara <andre.przywara at arm.com>
> Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
> ---
> Note that I do not own this device so I could only build test it.
>
> This is to continue the effort of getting rid of the legacy LED API.
> ---
> Changes in v3:
> - rebased on top of master,
> - Link to v2: https://patch.msgid.link/20251216-legacy-led-sunxi-v2-1-5739a5a524c9@cherry.de
>
> Changes in v2:
> - removed printf as suggested by Andre in v1,
> - removed check of return code of gpio_request() as it'll always be 0
> with the sunxi_gpio driver, we could technically even remove it as it
> does nothing but return 0, but it is "more correct" to have it,
> especially if Sunxi ever decides to move to DM_GPIO where you really
> need to request the gpio (and check the return value),
> - Link to v1: https://patch.msgid.link/20251120-legacy-led-sunxi-v1-1-c4c1422fd242@cherry.de
> ---
> arch/arm/mach-sunxi/Kconfig | 18 ++++++++++++++++++
> board/sunxi/board.c | 16 ++++++++++++----
> configs/pinephone_defconfig | 9 +++------
> 3 files changed, 33 insertions(+), 10 deletions(-)
Reviewed-by: Simon Glass <simon.glass at canonical.com>
yay
More information about the U-Boot
mailing list