Re: [PATCH] dt-bindings: leds: Mark label property as deprecated

Pavel Machek
2022-12-02T09:25:54Z

[-- Attachment #1: Type: text/plain, Size: 1743 bytes --]

Hi!

> > > > So far, the documentation states that "label" is deprecated, and users
> > > > should replace it with "function" and "color".
> > >
> > > 'function' is what activity/operation the LED is associated with. It is
> > > a fixed set of strings which s/w may use. It is a replacement for
> > > 'linux,default-trigger'.
> > >
> > > 'label' is what is printed next to the LED for a human to read. 'label'
> > > can be anything and the OS shouldn't care what it is.
> >
> > Unfortunately, no.
>
> That's why I said 'shouldn't care', not 'doesn't care'.
>
> 'label' is also not just an LED property. It's used elsewhere, but
> unfortunately the LED subsystem makes more use of it than it perhaps
> should.
>
> > We use label as a path in /sys/class/leds.
>
> Yes, or node name if no label. That's still not really caring what the
> value of label is. At least the kernel doesn't. A well behaved
> userspace wouldn't either and doesn't for most classes.

A well behaved userspace needs that to tell what kind of LED it is. It
is important to tell keyboard backlight from HDD activity LED and from
fllash on back camera for example.

> > And it looks like integer
> > "function" is not really adequate for describing what LED does. There
> > are too many LEDs and not enough integers, and it is common to have
> > same function ("activity") on multiple devices ("wifi", "mmc", "eth").
>
> Whatever the problems are, 'label' is not the solution.
>
> There is a way to associate leds with devices. 'trigger-source'
> IIRC.

Neither is trigger-source a solution.

Can we have linux,sysfs-path or something?

Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]