led: add function naming option from linux
authorHeiko Schocher <hs@denx.de>
Tue, 28 Jan 2025 13:52:46 +0000 (14:52 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 7 Feb 2025 16:53:39 +0000 (10:53 -0600)
commit592b6f394aeb2c9eec47a70b7b1fc0e5108cfa90
tree08df741b2dec69ef6133f73117715b6bb87c5833
parent167bc2cd69f50a5fad6f4f95c5c4d969ea0d80c1
led: add function naming option from linux

in linux we have the option to create the name of a led
optionally through the following properties:

- function
- color
- function-enumerator

This patch adds support for parsing this properties if there
is no label property.

The led name is created in led_post_bind() and we need some
storage place for it. Currently this patch prevents to use
malloc() instead it stores the name in new member :

        char name[LED_MAX_NAME_SIZE];

of struct led_uc_plat. While at it append led tests for the
new feature.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/sandbox/dts/test.dts
drivers/led/led-uclass.c
include/led.h
test/dm/led.c
test/dm/ofnode.c