I'm having issues compiling a dts depending on the label format and I don't know if I am interpreting things wrong and the node label and led label property are different things.
It says in the linux documentation under leds:
label:
description:
The label for this LED. If omitted, the label is taken from the node name
(excluding the unit address). It has to uniquely identify a device, i.e.
no other LED class device can be assigned the same label. This property is
deprecated - use 'function' and 'color' properties instead.
function-enumerator has no effect when this property is present.
The bottom suggestion does not work it is the same format as my code,
I think the & is used as to reference to a node it is often used to point to an include to reference a section in a .dtsi file for example i is why it is used on the alias to reference the node.
I found from my playing around that an alias only likes the format below using the label as a reference I could not get it to notice the node::
I don't know if they refer to the label property of the node or the label within the node property's
But that's what I have that compiles and works but it says in the Linux docs it says it is depreciated; I tried the other way and it does not work I'm just a little confused they have called two things label.
I think they mean the property label= is depreciated and instead use function and color to describe the led.
led_system_red: red {
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_STATUS;
It seems the aliases does not follow the label = and from my testing it does not follow the node either but I'm not sure I'm interpreting things correct.
If I look into the document you've linked. I would say that the pointer "label" is deprecated? So why you want to use it then?
label:
description:
The label for this LED. If omitted, the label is taken from the node name
(excluding the unit address). It has to uniquely identify a device, i.e.
no other LED class device can be assigned the same label. This property
is deprecated - use 'function' and 'color' properties instead.
function-enumerator has no effect when this property is present.
Another example (without any use of "label"):
aliases {
led-boot = &pwr;
led-failsafe = &pwr;
};
...
leds {
compatible = "gpio-leds";
pwr: pwr {
color = <LED_COLOR_ID_ORANGE>;
function = LED_FUNCTION_POWER;
gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>;
};
lan {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_LAN;
gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>;
};
wlan2g {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WLAN;
function-enumerator = <0>;
gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy0radio";
};
wlan5g {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WLAN;
function-enumerator = <1>;
gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy1radio";
};
};
};
Y, and the error message you've posted is refering to a missing node or label. So either both is wrong or one of them is wrong. You said that label was a copy paste error. So the node is left.
When you use &<name-or-label> then that name or label needs to be defined elsewhere as it's (indeed) a reference.
So in the first example you have a label led_system_red so you can reference it.
In the second example you reference a label which doesn't exist, so it fails.
note that there is no point in having a label with the same value as the name. A label is specifically so you can use a different value then the name, usually something simpler.
yip it is just there is two labels a node label and a label property the alias only works with a node label or a node name, documentation is not the best, I have it working now adn have dropped the label property in favour of function and colour and it works as intended.