[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190908080305.GC25459@amd>
Date: Sun, 8 Sep 2019 10:03:05 +0200
From: Pavel Machek <pavel@....cz>
To: Jacek Anaszewski <jacek.anaszewski@...il.com>
Cc: Tony Lindgren <tony@...mide.com>,
kernel list <linux-kernel@...r.kernel.org>, sre@...nel.org,
nekit1000@...il.com, mpartap@....net, merlijn@...zup.org,
Dan Murphy <dmurphy@...com>, linux-leds@...r.kernel.org
Subject: Re: [FYI] lm3532: right registration to work with LED-backlight
On Wed 2019-08-28 22:32:57, Jacek Anaszewski wrote:
> On 8/28/19 10:53 AM, Pavel Machek wrote:
> > Hi!
> >
> > Eventually, these will be needed.
> >
> > Best regards,
> > Pavel
> >
> > commit 38d956977a7d6cbdc811676f9b4033da7487e045
> > Author: Pavel <pavel@....cz>
> > Date: Wed Aug 7 12:43:52 2019 +0200
> >
> > d4: lm3532 needs to use right register function for backlight to work.
> >
> > diff --git a/drivers/leds/leds-lm3532.c b/drivers/leds/leds-lm3532.c
> > index 365a22a5..f98e657 100644
> > --- a/drivers/leds/leds-lm3532.c
> > +++ b/drivers/leds/leds-lm3532.c
> > @@ -629,7 +629,7 @@ static int lm3532_parse_node(struct lm3532_data *priv)
> >
> > lm3532_init_registers(led);
> >
> > - ret = devm_led_classdev_register(priv->dev, &led->led_dev);
> > + ret = devm_of_led_classdev_register(priv->dev, to_of_node(child), &led->led_dev);
>
> We no longer have devm_of_led_classdev_register(). You must use
> devm_led_classdev_register_ext().
Something like this (untested)?
Pavel
diff --git a/drivers/leds/leds-lm3532.c b/drivers/leds/leds-lm3532.c
index 62ace66..6340d5b 100644
--- a/drivers/leds/leds-lm3532.c
+++ b/drivers/leds/leds-lm3532.c
@@ -577,6 +577,11 @@ static int lm3532_parse_node(struct lm3532_data *priv)
priv->runtime_ramp_down = lm3532_get_ramp_index(ramp_time);
device_for_each_child_node(priv->dev, child) {
+ struct led_init_data idata = {
+ .fwnode = child,
+ .default_label = "backlight",
+ };
+
led = &priv->leds[i];
ret = fwnode_property_read_u32(child, "reg", &control_bank);
@@ -648,7 +653,7 @@ static int lm3532_parse_node(struct lm3532_data *priv)
led->led_dev.name = led->label;
led->led_dev.brightness_set_blocking = lm3532_brightness_set;
- ret = devm_led_classdev_register(priv->dev, &led->led_dev);
+ ret = devm_led_classdev_register_ext(priv->dev, &led->led_dev, &idata);
if (ret) {
dev_err(&priv->client->dev, "led register err: %d\n",
ret);
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists