U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: Marek Vasut <marex@denx.de>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	u-boot@lists.denx.de,
	Philippe Reynes <philippe.reynes@softathome.com>,
	Doug Zobel <douglas.zobel@climate.com>,
	Tom Rini <trini@konsulko.com>, pavel Machek <pavel@denx.de>
Subject: Re: [PATCH 2/6] led-uclass: honour ->label field populated by driver's own .bind
Date: Thu, 16 Nov 2023 10:21:36 +0100	[thread overview]
Message-ID: <ZVXfIFMO/NqER06B@duo.ucw.cz> (raw)
In-Reply-To: <9a11d59b-0e41-4e26-b474-ad743725bfa5@denx.de>

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

Hi!

> > > > > > diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c
> > > > > > index 5a5d07b9a7..0232fa84de 100644
> > > > > > --- a/drivers/led/led-uclass.c
> > > > > > +++ b/drivers/led/led-uclass.c
> > > > > > @@ -71,7 +71,9 @@ static int led_post_bind(struct udevice *dev)
> > > > > >         struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
> > > > > >         const char *default_state;
> > > > > >     -    uc_plat->label = dev_read_string(dev, "label");
> > > > > > +    if (!uc_plat->label)
> > > > > > +        uc_plat->label = dev_read_string(dev, "label");
> > > > > > +
> > > > > 
> > > > > One thing I have to wonder about is, why does this controller have label
> > > > > property in the top-level node , what is that used for ?
> > > > > 
> > > > > (see Linux Documentation/devicetree/bindings/leds/leds-lp55xx.yaml)
> > > > > 
> > > > > Reviewed-by: Marek Vasut <marex@denx.de>
> > > > 
> > > > Reading the linux driver, it seems that the top-level label, if any, is
> > > > used as part of the naming for individual channels if they don't have
> > > > individual chan-name properties:
> > > > 
> > > > 
> > > >           if (pdata->led_config[chan].name) {
> > > >                   led->cdev.name = pdata->led_config[chan].name;
> > > >           } else {
> > > >                   snprintf(name, sizeof(name), "%s:channel%d",
> > > >                           pdata->label ? : chip->cl->name, chan);
> > > >                   led->cdev.name = name;
> > > >           }
> > > > 
> > > > but I think the rationale in d1188adb2dabc is a bit weak, since the only
> > > > example also does have individual chan-name properties.
> > > > 
> > > > [Complete aside: At first I thought it was related to the multi-color
> > > > LED work that has been ongoing for many many years (I think there was an
> > > > LWN article at some point), where this could be exposed as a single
> > > > multi-color LED, as opposed to the "traditional" three/four individual
> > > > LEDs. In the former case, there would only be one sysfs entry, but with
> > > > attributes exposing the multicolor functionality. I must admit I don't
> > > > know the status of that work, when something reaches v31,
> > > > http://archive.lwn.net:8080/linux-kernel/20200722071055.GA8984@amd/t/ ,
> > > > it's hard to know if it ever lands, or if pieces of it has landed.]
> > > 
> > > +CC Pavel
> 
> I think you want to coordinate the effort with Rasmus here .

This is u-boot, not Linux, right?

Anyway cc-ing linux-leds may be better than cc-ing me directly, but
don't expect much.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

  reply	other threads:[~2023-11-16 13:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19  9:58 [PATCH 0/6] some LED patches Rasmus Villemoes
2023-10-19  9:58 ` [PATCH 1/6] led-uclass: do not create fallback label for top-level node Rasmus Villemoes
2023-10-19 13:51   ` Marek Vasut
2023-10-23  8:28     ` Rasmus Villemoes
2023-10-23  9:01       ` Marek Vasut
2023-10-19  9:58 ` [PATCH 2/6] led-uclass: honour ->label field populated by driver's own .bind Rasmus Villemoes
2023-10-19 13:54   ` Marek Vasut
2023-10-23  8:51     ` Rasmus Villemoes
2023-10-23  9:03       ` Marek Vasut
2023-11-14 12:11         ` Christian Gmeiner
2023-11-15  5:37           ` Marek Vasut
2023-11-16  9:21             ` Pavel Machek [this message]
2023-10-23 10:43       ` Christian Gmeiner
2023-10-19  9:58 ` [PATCH 3/6] led: introduce led_bind_generic() Rasmus Villemoes
2023-10-19 13:56   ` Marek Vasut
2023-10-19  9:58 ` [PATCH 4/6] led: led_gpio: use led_bind_generic() helper Rasmus Villemoes
2023-10-19 13:56   ` Marek Vasut
2023-10-19  9:58 ` [PATCH 5/6] led: led_pwm: " Rasmus Villemoes
2023-10-19 13:57   ` Marek Vasut
2023-10-19  9:58 ` [PATCH 6/6] led: add TI LP5562 LED driver Rasmus Villemoes
2023-10-19 13:58   ` Marek Vasut
2023-10-23  9:11     ` Rasmus Villemoes
2023-10-23  9:39       ` Marek Vasut
2023-10-23 11:17         ` Rasmus Villemoes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZVXfIFMO/NqER06B@duo.ucw.cz \
    --to=pavel@denx.de \
    --cc=christian.gmeiner@gmail.com \
    --cc=douglas.zobel@climate.com \
    --cc=marex@denx.de \
    --cc=philippe.reynes@softathome.com \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox