diff mbox

RX-51: Add missing max_current to rx51_lp5523_led_config

Message ID 1379541145-25934-1-git-send-email-pali.rohar@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Pali Rohár Sept. 18, 2013, 9:52 p.m. UTC
Without max_current data in board file lp5523 driver does not change current.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/mach-omap2/board-rx51-peripherals.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Tony Lindgren Sept. 18, 2013, 10:26 p.m. UTC | #1
* Pali Rohár <pali.rohar@gmail.com> [130918 15:02]:
> Without max_current data in board file lp5523 driver does not change current.

Hmm is this a regression or are there other reasons to merge
this during the -rc cycle?

Regards,

Tony
 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
>  arch/arm/mach-omap2/board-rx51-peripherals.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
> index 9326890..d0f857c 100644
> --- a/arch/arm/mach-omap2/board-rx51-peripherals.c
> +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
> @@ -180,38 +180,47 @@ static struct lp55xx_led_config rx51_lp5523_led_config[] = {
>  		.name		= "lp5523:kb1",
>  		.chan_nr	= 0,
>  		.led_current	= 50,
> +		.max_current	= 255,
>  	}, {
>  		.name		= "lp5523:kb2",
>  		.chan_nr	= 1,
>  		.led_current	= 50,
> +		.max_current	= 255,
>  	}, {
>  		.name		= "lp5523:kb3",
>  		.chan_nr	= 2,
>  		.led_current	= 50,
> +		.max_current	= 255,
>  	}, {
>  		.name		= "lp5523:kb4",
>  		.chan_nr	= 3,
>  		.led_current	= 50,
> +		.max_current	= 255,
>  	}, {
>  		.name		= "lp5523:b",
>  		.chan_nr	= 4,
>  		.led_current	= 50,
> +		.max_current	= 255,
>  	}, {
>  		.name		= "lp5523:g",
>  		.chan_nr	= 5,
>  		.led_current	= 50,
> +		.max_current	= 255,
>  	}, {
>  		.name		= "lp5523:r",
>  		.chan_nr	= 6,
>  		.led_current	= 50,
> +		.max_current	= 255,
>  	}, {
>  		.name		= "lp5523:kb5",
>  		.chan_nr	= 7,
>  		.led_current	= 50,
> +		.max_current	= 255,
>  	}, {
>  		.name		= "lp5523:kb6",
>  		.chan_nr	= 8,
>  		.led_current	= 50,
> +		.max_current	= 255,
>  	}
>  };
>  
> -- 
> 1.7.10.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pali Rohár Sept. 19, 2013, 9:01 p.m. UTC | #2
On Thursday 19 September 2013 00:26:43 Tony Lindgren wrote:
> * Pali Rohár <pali.rohar@gmail.com> [130918 15:02]:
> > Without max_current data in board file lp5523 driver does
> > not change current.
> 
> Hmm is this a regression or are there other reasons to merge
> this during the -rc cycle?
> 

I think this is regression, drivers/leds/leds-lp55xx-common.c 
code refuse to change led_current sysfs attribute if value is 
higher than max_current specified in board file. And because in 
board file max_current is not specified it is by default zero as 
global variable. So changing led_current is not possible because 
any positive value is more than zero. First I saw this behaviour 
in 3.10, but I forgot to send this patch.

> Regards,
> 
> Tony
> 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > ---
> > 
> >  arch/arm/mach-omap2/board-rx51-peripherals.c |    9
> >  +++++++++ 1 file changed, 9 insertions(+)
> > 
> > diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c
> > b/arch/arm/mach-omap2/board-rx51-peripherals.c index
> > 9326890..d0f857c 100644
> > --- a/arch/arm/mach-omap2/board-rx51-peripherals.c
> > +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
> > @@ -180,38 +180,47 @@ static struct lp55xx_led_config
> > rx51_lp5523_led_config[] = {
> > 
> >  		.name		= "lp5523:kb1",
> >  		.chan_nr	= 0,
> >  		.led_current	= 50,
> > 
> > +		.max_current	= 255,
> > 
> >  	}, {
> >  	
> >  		.name		= "lp5523:kb2",
> >  		.chan_nr	= 1,
> >  		.led_current	= 50,
> > 
> > +		.max_current	= 255,
> > 
> >  	}, {
> >  	
> >  		.name		= "lp5523:kb3",
> >  		.chan_nr	= 2,
> >  		.led_current	= 50,
> > 
> > +		.max_current	= 255,
> > 
> >  	}, {
> >  	
> >  		.name		= "lp5523:kb4",
> >  		.chan_nr	= 3,
> >  		.led_current	= 50,
> > 
> > +		.max_current	= 255,
> > 
> >  	}, {
> >  	
> >  		.name		= "lp5523:b",
> >  		.chan_nr	= 4,
> >  		.led_current	= 50,
> > 
> > +		.max_current	= 255,
> > 
> >  	}, {
> >  	
> >  		.name		= "lp5523:g",
> >  		.chan_nr	= 5,
> >  		.led_current	= 50,
> > 
> > +		.max_current	= 255,
> > 
> >  	}, {
> >  	
> >  		.name		= "lp5523:r",
> >  		.chan_nr	= 6,
> >  		.led_current	= 50,
> > 
> > +		.max_current	= 255,
> > 
> >  	}, {
> >  	
> >  		.name		= "lp5523:kb5",
> >  		.chan_nr	= 7,
> >  		.led_current	= 50,
> > 
> > +		.max_current	= 255,
> > 
> >  	}, {
> >  	
> >  		.name		= "lp5523:kb6",
> >  		.chan_nr	= 8,
> >  		.led_current	= 50,
> > 
> > +		.max_current	= 255,
> > 
> >  	}
> >  
> >  };
Tony Lindgren Sept. 19, 2013, 9:29 p.m. UTC | #3
* Pali Rohár <pali.rohar@gmail.com> [130919 14:10]:
> On Thursday 19 September 2013 00:26:43 Tony Lindgren wrote:
> > * Pali Rohár <pali.rohar@gmail.com> [130918 15:02]:
> > > Without max_current data in board file lp5523 driver does
> > > not change current.
> > 
> > Hmm is this a regression or are there other reasons to merge
> > this during the -rc cycle?
> > 
> 
> I think this is regression, drivers/leds/leds-lp55xx-common.c 
> code refuse to change led_current sysfs attribute if value is 
> higher than max_current specified in board file. And because in 
> board file max_current is not specified it is by default zero as 
> global variable. So changing led_current is not possible because 
> any positive value is more than zero. First I saw this behaviour 
> in 3.10, but I forgot to send this patch.

OK thanks, can you please update the patch description with
that so I can merge it for the -rc cycle? Ideally of course
with the breaking commit too.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 9326890..d0f857c 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -180,38 +180,47 @@  static struct lp55xx_led_config rx51_lp5523_led_config[] = {
 		.name		= "lp5523:kb1",
 		.chan_nr	= 0,
 		.led_current	= 50,
+		.max_current	= 255,
 	}, {
 		.name		= "lp5523:kb2",
 		.chan_nr	= 1,
 		.led_current	= 50,
+		.max_current	= 255,
 	}, {
 		.name		= "lp5523:kb3",
 		.chan_nr	= 2,
 		.led_current	= 50,
+		.max_current	= 255,
 	}, {
 		.name		= "lp5523:kb4",
 		.chan_nr	= 3,
 		.led_current	= 50,
+		.max_current	= 255,
 	}, {
 		.name		= "lp5523:b",
 		.chan_nr	= 4,
 		.led_current	= 50,
+		.max_current	= 255,
 	}, {
 		.name		= "lp5523:g",
 		.chan_nr	= 5,
 		.led_current	= 50,
+		.max_current	= 255,
 	}, {
 		.name		= "lp5523:r",
 		.chan_nr	= 6,
 		.led_current	= 50,
+		.max_current	= 255,
 	}, {
 		.name		= "lp5523:kb5",
 		.chan_nr	= 7,
 		.led_current	= 50,
+		.max_current	= 255,
 	}, {
 		.name		= "lp5523:kb6",
 		.chan_nr	= 8,
 		.led_current	= 50,
+		.max_current	= 255,
 	}
 };