linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
@ 2021-02-04 14:37 Sven Schuchmann
  2021-02-04 14:53 ` Pavel Machek
  0 siblings, 1 reply; 12+ messages in thread
From: Sven Schuchmann @ 2021-02-04 14:37 UTC (permalink / raw)
  Cc: Sven Schuchmann, Pavel Machek, Dan Murphy, linux-leds, linux-kernel

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(-)

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;
 };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-04 14:37 [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT Sven Schuchmann
@ 2021-02-04 14:53 ` Pavel Machek
  2021-02-05  9:59   ` AW: " Sven Schuchmann
  0 siblings, 1 reply; 12+ messages in thread
From: Pavel Machek @ 2021-02-04 14:53 UTC (permalink / raw)
  To: Sven Schuchmann; +Cc: Dan Murphy, linux-leds, linux-kernel

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

On Thu 2021-02-04 14:37:38, Sven Schuchmann wrote:
> 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.



> 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.
							Pavel

-- 
http://www.livejournal.com/~pavelmachek

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* AW: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-04 14:53 ` Pavel Machek
@ 2021-02-05  9:59   ` Sven Schuchmann
  2021-02-05 10:34     ` Pavel Machek
  0 siblings, 1 reply; 12+ messages in thread
From: Sven Schuchmann @ 2021-02-05  9:59 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Dan Murphy, linux-leds, linux-kernel

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?

Best Regards,

   Sven

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-05  9:59   ` AW: " Sven Schuchmann
@ 2021-02-05 10:34     ` Pavel Machek
  2021-02-05 11:21       ` AW: " Sven Schuchmann
  0 siblings, 1 reply; 12+ messages in thread
From: Pavel Machek @ 2021-02-05 10:34 UTC (permalink / raw)
  To: Sven Schuchmann; +Cc: Dan Murphy, linux-leds, linux-kernel

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

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
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* AW: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-05 10:34     ` Pavel Machek
@ 2021-02-05 11:21       ` Sven Schuchmann
  2021-02-19 11:16         ` Pavel Machek
  0 siblings, 1 reply; 12+ messages in thread
From: Sven Schuchmann @ 2021-02-05 11:21 UTC (permalink / raw)
  To: Pavel Machek, Dan Murphy; +Cc: linux-leds, linux-kernel

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.

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.

Best Regards,

   Sven
 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-05 11:21       ` AW: " Sven Schuchmann
@ 2021-02-19 11:16         ` Pavel Machek
  2021-02-19 11:38           ` AW: " Sven Schuchmann
  2021-02-19 14:18           ` Andy Shevchenko
  0 siblings, 2 replies; 12+ messages in thread
From: Pavel Machek @ 2021-02-19 11:16 UTC (permalink / raw)
  To: Sven Schuchmann; +Cc: Dan Murphy, linux-leds, linux-kernel

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

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

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* AW: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-19 11:16         ` Pavel Machek
@ 2021-02-19 11:38           ` Sven Schuchmann
  2021-02-19 13:55             ` Andy Shevchenko
  2021-02-19 14:18           ` Andy Shevchenko
  1 sibling, 1 reply; 12+ messages in thread
From: Sven Schuchmann @ 2021-02-19 11:38 UTC (permalink / raw)
  To: Pavel Machek, Andy Shevchenko; +Cc: Dan Murphy, linux-leds, linux-kernel

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-19 11:38           ` AW: " Sven Schuchmann
@ 2021-02-19 13:55             ` Andy Shevchenko
  2021-02-19 14:09               ` AW: " Sven Schuchmann
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2021-02-19 13:55 UTC (permalink / raw)
  To: Sven Schuchmann; +Cc: Pavel Machek, Dan Murphy, linux-leds, linux-kernel

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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* AW: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-19 13:55             ` Andy Shevchenko
@ 2021-02-19 14:09               ` Sven Schuchmann
  2021-02-19 14:50                 ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Sven Schuchmann @ 2021-02-19 14:09 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Pavel Machek, Dan Murphy, linux-leds, linux-kernel

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 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-19 11:16         ` Pavel Machek
  2021-02-19 11:38           ` AW: " Sven Schuchmann
@ 2021-02-19 14:18           ` Andy Shevchenko
  2021-02-19 18:07             ` Pavel Machek
  1 sibling, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2021-02-19 14:18 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Sven Schuchmann, Dan Murphy, linux-leds, linux-kernel

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-19 14:09               ` AW: " Sven Schuchmann
@ 2021-02-19 14:50                 ` Andy Shevchenko
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2021-02-19 14:50 UTC (permalink / raw)
  To: Sven Schuchmann, Linus Walleij
  Cc: Pavel Machek, Dan Murphy, linux-leds, linux-kernel

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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT
  2021-02-19 14:18           ` Andy Shevchenko
@ 2021-02-19 18:07             ` Pavel Machek
  0 siblings, 0 replies; 12+ messages in thread
From: Pavel Machek @ 2021-02-19 18:07 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Sven Schuchmann, Dan Murphy, linux-leds, linux-kernel

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

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

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-02-19 18:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 14:37 [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT Sven Schuchmann
2021-02-04 14:53 ` Pavel Machek
2021-02-05  9:59   ` AW: " Sven Schuchmann
2021-02-05 10:34     ` Pavel Machek
2021-02-05 11:21       ` AW: " Sven Schuchmann
2021-02-19 11:16         ` Pavel Machek
2021-02-19 11:38           ` AW: " Sven Schuchmann
2021-02-19 13:55             ` Andy Shevchenko
2021-02-19 14:09               ` AW: " Sven Schuchmann
2021-02-19 14:50                 ` Andy Shevchenko
2021-02-19 14:18           ` Andy Shevchenko
2021-02-19 18:07             ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).