On Thu, 29 Jan 2026 at 05:01, Quentin Schulz <[email protected]> wrote:
>
> From: Quentin Schulz <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: Quentin Schulz <[email protected]>
> ---
> 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/[email protected]
>
> 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/[email protected]
> ---
>  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 <[email protected]>

yay

Reply via email to