Skip to contentSkip to conversation

Are LED functions strings or uint32 in Documentation/devicetree/bindings/leds/common.yaml

DISCUSSION E Shattow 3 participants 4 messages Jul 16, 2025 LED

lore
Share & tools
lore

E Shattow

author
#0 lore raw

Hello,

Documentation/devicetree/bindings/leds/common.yaml [1] describes a uint32 but the $ref is for a string, for "function". What's going on there? Also what is the reasoning for that sort ordering [2] in the examples, are we saying that gpios is like a register and function or default-state is a kind of status?

1:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/leds/common.yaml

2:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/leds/leds-gpio.yaml

-E Shattow

#1 lore raw

Hi!

Quoted 9 lines

Documentation/devicetree/bindings/leds/common.yaml [1] describes a uint32 but the $ref is for a string, for "function". What's going on there? Also what is the reasoning for that sort ordering [2] in the examples, are we saying that gpios is like a register and function or default-state is a kind of status?

1:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/leds/common.yaml

You may want to cc devicetree people and linux-leds mailing list.

Take a look at include/dt-bindings/leds/common.h, LED_FUNCTION_PANIC (for example) is a string, so documentation looks consistent to me.

BR,
Pavel

Signature · 2 lines
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, and Musk!
author
#2 lore raw
Quoted 12 lines · Pavel Machek

Hi!

Quoted 9 lines

Documentation/devicetree/bindings/leds/common.yaml [1] describes a uint32 but the $ref is for a string, for "function". What's going on there? Also what is the reasoning for that sort ordering [2] in the examples, are we saying that gpios is like a register and function or default-state is a kind of status?

1:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/leds/common.yaml

Quoted 7 lines

You may want to cc devicetree people and linux-leds mailing list.

Take a look at include/dt-bindings/leds/common.h, LED_FUNCTION_PANIC (for example) is a string, so documentation looks consistent to me.

BR,
Pavel

Hi Pavel, thanks for the correction. That makes sense to me now, it is more of a function name than a function enum.

Question about the dts examples' sort ordering remains? I try to follow the devicetree code style document but I must get confused too easily :-)

Cheers,

-E

CC devicetree, linux-leds
#3 lore raw
In reply to E Shattow

Hello,

Quoted 4 lines · E Shattow

Hello,

Documentation/devicetree/bindings/leds/common.yaml [1] describes a uint32 but the $ref is for a string, for "function". What's going on

In which line function is described as uint32?

Quoted 13 lines

there? Also what is the reasoning for that sort ordering [2] in the examples, are we saying that gpios is like a register and function or default-state is a kind of status?

1:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/leds/common.yaml

2:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/leds/leds-gpio.yaml

-E Shattow

Signature · 2 lines
Best regards,
Jacek Anaszewski