diff mbox series

[v2,2/4] leds: lp50xx: add setting of default intensity from DT

Message ID 20210204143738.28036-1-schuchmann@schleissheimer.de
State New
Headers show
Series [v2,1/4] leds: lp50xx: add setting of default intensity from DT | expand

Commit Message

Sven Schuchmann Feb. 4, 2021, 2:37 p.m. UTC
In order to use a multicolor-led together with a trigger
the led needs to have an intensity set to see something.
The trigger changes the brightness of the led but if there
is no intensity we actually see nothing.

This patch adds the ability to set the default intensity
of each multi-led node so that it is turned on from DT.
If no intensity is given the led will be initialized
with full intensity.

Part 1 updates the documentation.
Part 2 removes an unused variable.
Part 3 sets the initial intensity to full.
Part 4 reads the default intensity from DT

changes in v1
 - fix dt_binding_check errors

changes in v2
 - sets default intensity to full
 - adds the property to the multi-led node

Signed-off-by: Sven Schuchmann <schuchmann@schleissheimer.de>
---
 drivers/leds/leds-lp50xx.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Pavel Machek Feb. 5, 2021, 10:34 a.m. UTC | #1
On Fri 2021-02-05 09:59:19, Sven Schuchmann wrote:
> Hello Pavel,
> 
> > > diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
> > > index f13117eed976..4b40bf66483c 100644
> > > --- a/drivers/leds/leds-lp50xx.c
> > > +++ b/drivers/leds/leds-lp50xx.c
> > > @@ -267,7 +267,6 @@ struct lp50xx_led {
> > >  	struct led_classdev_mc mc_cdev;
> > >  	struct lp50xx *priv;
> > >  	unsigned long bank_modules;
> > > -	int led_intensity[LP50XX_LEDS_PER_MODULE];
> > >  	u8 ctrl_bank_enabled;
> > >  	int led_number;
> > >  };
> > 
> > ? Does not make sense and changelog does not help.
> 
> This is an unused variable which is in the driver
> (same as the regulator). Should I provide a patch on its own for that
> or just describe in the changelog?

Lets do separate patch here. DT changes will need Ack from Rob, this
can go in directly.

Can you or Dan submit patch getting the regulator support to work? If
not, I guess we should remove the regulator support after all.

Best regards,
								Pavel
Pavel Machek Feb. 19, 2021, 11:16 a.m. UTC | #2
Hi!

> > > > ? Does not make sense and changelog does not help.

> > >

> > > This is an unused variable which is in the driver

> > > (same as the regulator). Should I provide a patch on its own for that

> > > or just describe in the changelog?

> > 

> > Lets do separate patch here. DT changes will need Ack from Rob, this

> > can go in directly.

> 

> Okay, I will submit a separate patch

> 

> > Can you or Dan submit patch getting the regulator support to work? If

> > not, I guess we should remove the regulator support after all.

> 

> To be true I am fairly new to the kernel and have no idea

> how to test this. So no, I don't want provide a patch (except

> for removing), sorry.


No problem. It seems Andy submitted series for this.

Best regards,
								Pavel

-- 
http://www.livejournal.com/~pavelmachek
Sven Schuchmann Feb. 19, 2021, 11:38 a.m. UTC | #3
Hello Pavel, hello Andy,

> -----Ursprüngliche Nachricht-----
> Von: Pavel Machek <pavel@ucw.cz>
> Gesendet: Freitag, 19. Februar 2021 12:17
> An: Sven Schuchmann <schuchmann@schleissheimer.de>
> Cc: Dan Murphy <dmurphy@ti.com>; linux-leds@vger.kernel.org; linux-kernel@vger.kernel.org
> Betreff: Re: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
> 
> > > Can you or Dan submit patch getting the regulator support to work? If
> > > not, I guess we should remove the regulator support after all.
> >
> > To be true I am fairly new to the kernel and have no idea
> > how to test this. So no, I don't want provide a patch (except
> > for removing), sorry.
> 
> No problem. It seems Andy submitted series for this.
> 

To me it seems that patches from Andy don't make
the regulator work. Maybe I am wrong?

I am very busy right now but hopefully I will find some more
time next week to submit some new patches. On my list so far
for the lp50xx:
* Remove unused variable https://www.spinics.net/lists/linux-leds/msg17654.html
* Enable-GPIO not working (used before init, reset/enable order wrong)
* Add default setting from DT https://www.spinics.net/lists/linux-leds/msg17596.html
* Fix regulator https://www.spinics.net/lists/linux-leds/msg17631.html

Best Regards,

   Sven
Andy Shevchenko Feb. 19, 2021, 1:55 p.m. UTC | #4
On Fri, Feb 19, 2021 at 11:38:09AM +0000, Sven Schuchmann wrote:
> Hello Pavel, hello Andy,

> 

> > -----Ursprüngliche Nachricht-----

> > Von: Pavel Machek <pavel@ucw.cz>

> > Gesendet: Freitag, 19. Februar 2021 12:17

> > An: Sven Schuchmann <schuchmann@schleissheimer.de>

> > Cc: Dan Murphy <dmurphy@ti.com>; linux-leds@vger.kernel.org; linux-kernel@vger.kernel.org

> > Betreff: Re: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT

> > 

> > > > Can you or Dan submit patch getting the regulator support to work? If

> > > > not, I guess we should remove the regulator support after all.

> > >

> > > To be true I am fairly new to the kernel and have no idea

> > > how to test this. So no, I don't want provide a patch (except

> > > for removing), sorry.

> > 

> > No problem. It seems Andy submitted series for this.

> > 

> 

> To me it seems that patches from Andy don't make

> the regulator work. Maybe I am wrong?


I;m not sure I understand this correctly. Do you mean that my patches broke
something? Which one explicitly and what is broken?

> I am very busy right now but hopefully I will find some more

> time next week to submit some new patches. On my list so far

> for the lp50xx:

> * Remove unused variable https://www.spinics.net/lists/linux-leds/msg17654.html

> * Enable-GPIO not working (used before init, reset/enable order wrong)

> * Add default setting from DT https://www.spinics.net/lists/linux-leds/msg17596.html

> * Fix regulator https://www.spinics.net/lists/linux-leds/msg17631.html


-- 
With Best Regards,
Andy Shevchenko
Sven Schuchmann Feb. 19, 2021, 2:09 p.m. UTC | #5
Hello Andy,

> Von: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Gesendet: Freitag, 19. Februar 2021 14:56
> An: Sven Schuchmann <schuchmann@schleissheimer.de>
> Cc: Pavel Machek <pavel@ucw.cz>; Dan Murphy <dmurphy@ti.com>; linux-leds@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Betreff: Re: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
> 
> > > > > Can you or Dan submit patch getting the regulator support to work? If
> > > > > not, I guess we should remove the regulator support after all.
> > > >
> > > > To be true I am fairly new to the kernel and have no idea
> > > > how to test this. So no, I don't want provide a patch (except
> > > > for removing), sorry.
> > >
> > > No problem. It seems Andy submitted series for this.
> > >
> >
> > To me it seems that patches from Andy don't make
> > the regulator work. Maybe I am wrong?
> 
> I;m not sure I understand this correctly. Do you mean that my patches broke
> something? Which one explicitly and what is broken?

No, your patches do not break something (as far as I can see).
Pavel asked for a patch to fix the regulator. The regulator
at this time is only initialized but never used in the lp50xx.
I told him (see above) that I cannot provide a patch which
fixes this. He answered that you fixed this in your series,
but to me it doesn't seem so.
or did you fix the regulator usage in your patch series?

Best Regards,

   Sven
Andy Shevchenko Feb. 19, 2021, 2:18 p.m. UTC | #6
On Fri, Feb 19, 2021 at 1:19 PM Pavel Machek <pavel@ucw.cz> wrote:
> > > > > ? Does not make sense and changelog does not help.

> > > >

> > > > This is an unused variable which is in the driver

> > > > (same as the regulator). Should I provide a patch on its own for that

> > > > or just describe in the changelog?

> > >

> > > Lets do separate patch here. DT changes will need Ack from Rob, this

> > > can go in directly.

> >

> > Okay, I will submit a separate patch

> >

> > > Can you or Dan submit patch getting the regulator support to work? If

> > > not, I guess we should remove the regulator support after all.

> >

> > To be true I am fairly new to the kernel and have no idea

> > how to test this. So no, I don't want provide a patch (except

> > for removing), sorry.

>

> No problem. It seems Andy submitted series for this.


Ah, now I understand what you, Sven, meant.
I didn't touch regulator code, so it left the same, but making it work
probably needs just enabling during ->probe().

-- 
With Best Regards,
Andy Shevchenko
Andy Shevchenko Feb. 19, 2021, 2:50 p.m. UTC | #7
On Fri, Feb 19, 2021 at 02:09:03PM +0000, Sven Schuchmann wrote:
> > Von: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> > Gesendet: Freitag, 19. Februar 2021 14:56


> > > > > > Can you or Dan submit patch getting the regulator support to work? If

> > > > > > not, I guess we should remove the regulator support after all.

> > > > >

> > > > > To be true I am fairly new to the kernel and have no idea

> > > > > how to test this. So no, I don't want provide a patch (except

> > > > > for removing), sorry.

> > > >

> > > > No problem. It seems Andy submitted series for this.

> > > >

> > >

> > > To me it seems that patches from Andy don't make

> > > the regulator work. Maybe I am wrong?

> > 

> > I;m not sure I understand this correctly. Do you mean that my patches broke

> > something? Which one explicitly and what is broken?

> 

> No, your patches do not break something (as far as I can see).

> Pavel asked for a patch to fix the regulator. The regulator

> at this time is only initialized but never used in the lp50xx.

> I told him (see above) that I cannot provide a patch which

> fixes this. He answered that you fixed this in your series,

> but to me it doesn't seem so.

> or did you fix the regulator usage in your patch series?


No, I haven't touched regulator and I see now what is there.
One may add some code, I know Linus did it in many places, maybe he can help to
have done this properly?


-- 
With Best Regards,
Andy Shevchenko
Pavel Machek Feb. 19, 2021, 6:07 p.m. UTC | #8
On Fri 2021-02-19 16:18:38, Andy Shevchenko wrote:
> On Fri, Feb 19, 2021 at 1:19 PM Pavel Machek <pavel@ucw.cz> wrote:

> > > > > > ? Does not make sense and changelog does not help.

> > > > >

> > > > > This is an unused variable which is in the driver

> > > > > (same as the regulator). Should I provide a patch on its own for that

> > > > > or just describe in the changelog?

> > > >

> > > > Lets do separate patch here. DT changes will need Ack from Rob, this

> > > > can go in directly.

> > >

> > > Okay, I will submit a separate patch

> > >

> > > > Can you or Dan submit patch getting the regulator support to work? If

> > > > not, I guess we should remove the regulator support after all.

> > >

> > > To be true I am fairly new to the kernel and have no idea

> > > how to test this. So no, I don't want provide a patch (except

> > > for removing), sorry.

> >

> > No problem. It seems Andy submitted series for this.

> 

> Ah, now I understand what you, Sven, meant.

> I didn't touch regulator code, so it left the same, but making it work

> probably needs just enabling during ->probe().


Yep, sorry, I was confused.

Anyway, I'd rather seen patch fixing the regulator code than removing
it completely.

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek
diff mbox series

Patch

diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
index f13117eed976..4b40bf66483c 100644
--- a/drivers/leds/leds-lp50xx.c
+++ b/drivers/leds/leds-lp50xx.c
@@ -267,7 +267,6 @@  struct lp50xx_led {
 	struct led_classdev_mc mc_cdev;
 	struct lp50xx *priv;
 	unsigned long bank_modules;
-	int led_intensity[LP50XX_LEDS_PER_MODULE];
 	u8 ctrl_bank_enabled;
 	int led_number;
 };