Skip to contentSkip to conversation

RX-51: Add missing max_current to rx51_lp5523_led_config

PATCH Superseded Pali Rohár 3 participants 8 messages Sep 18, 2013 – Oct 8, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RX-51: Add missing max_current to rx51_lp5523_led_config

Without max_current data in board file lp5523 driver does not change current.

---
 arch/arm/mach-omap2/board-rx51-peripherals.c |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/mach-omap2/board-rx51-peripherals.c +9 -0
index 9326890..d0f857c 100644
@@ -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,
 	}
 };
 
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw
Quoted 1 line · Pali Rohár

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

Quoted 60 lines
---
 arch/arm/mach-omap2/board-rx51-peripherals.c |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/mach-omap2/board-rx51-peripherals.c +9 -0
index 9326890..d0f857c 100644
@@ -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,
 	}
 };
 
Signature · 1 line
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 7 lines · On Thursday 19 September 2013 00:26:43 Tony Lindgren wrote:
Quoted 2 lines · Pali Rohár

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.

Quoted 91 lines

Regards,

Tony

Quoted 87 lines

---

 arch/arm/mach-omap2/board-rx51-peripherals.c |    9

+++++++++ 1 file changed, 9 insertions(+)

(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-rx51-peripherals.c index 9326890..d0f857c 100644

arch/arm/mach-omap2/board-rx51-peripherals.c +9 -0
@@ -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,
 
 	}
 
 };
Signature · 2 lines
Pali Rohár
[email protected]
maintainer
#3 lore raw
Quoted 9 lines · Pali Rohár
Quoted 7 lines · On Thursday 19 September 2013 00:26:43 Tony Lindgren wrote:
Quoted 2 lines · Pali Rohár

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?

Quoted 7 lines

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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 18 lines · On Thursday 19 September 2013 23:29:22 Tony Lindgren wrote:
Quoted 8 lines · Pali Rohár
Quoted 6 lines · On Thursday 19 September 2013 00:26:43 Tony Lindgren wrote:
Quoted 2 lines · Pali Rohár

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?

Quoted 8 lines

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.

Quoted 7 lines

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

I do not know which commit broke it. There was some change in lp driver which caused that driver not worked with testing applications. Now it should be fixed. So I resending my patch with updated description.

RX-51: Add missing max_current to rx51_lp5523_led_config

File drivers/leds/leds-lp55xx-common.c refuse to change led_current sysfs attribute if value is higher than max_current specified in board file. By default global C variables are zero, so changing always failed. This patch adding missing max_current and setting it to max value 255.

---
 arch/arm/mach-omap2/board-rx51-peripherals.c |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/mach-omap2/board-rx51-peripherals.c +9 -0
index 9326890..d0f857c 100644
@@ -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,
 	}
 };
 
Signature · 5 lines
1.7.10.4

-- 
Pali Rohár
[email protected]
#5 lore raw

PATCH v2 1/1 RX-51: Add missing max_current to rx51_lp5523_led_config

Hi Tony,

here is new version (v2) of patch which adding max_current values to rx51 board data. According to joerg safe value for max_current is 100 (10 mA).

RX-51: Add missing max_current to rx51_lp5523_led_config

File drivers/leds/leds-lp55xx-common.c refuse to change led_current sysfs attribute if value is higher than max_current specified in board file. By default global C variables are zero, so changing always failed. This patch adding missing max_current and setting it to max safe value 100 (10 mA).

---
 arch/arm/mach-omap2/board-rx51-peripherals.c |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/mach-omap2/board-rx51-peripherals.c +9 -0
index c3270c0..f6fe388 100644
@@ -167,38 +167,47 @@ static struct lp55xx_led_config rx51_lp5523_led_config[] = {
 		.name		= "lp5523:kb1",
 		.chan_nr	= 0,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:kb2",
 		.chan_nr	= 1,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:kb3",
 		.chan_nr	= 2,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:kb4",
 		.chan_nr	= 3,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:b",
 		.chan_nr	= 4,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:g",
 		.chan_nr	= 5,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:r",
 		.chan_nr	= 6,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:kb5",
 		.chan_nr	= 7,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:kb6",
 		.chan_nr	= 8,
 		.led_current	= 50,
+		.max_current	= 100,
 	}
 };
 
Signature · 5 lines
1.7.10.4

-- 
Pali Rohár
[email protected]
#6 lore raw
Quoted 60 lines · On Mon 23 September 2013 14:50:12 Pali Rohár wrote:

Hi Tony,

here is new version (v2) of patch which adding max_current values to rx51 board data. According to joerg safe value for max_current is 100 (10 mA).

RX-51: Add missing max_current to rx51_lp5523_led_config

File drivers/leds/leds-lp55xx-common.c refuse to change led_current sysfs attribute if value is higher than max_current specified in board file. By default global C variables are zero, so changing always failed. This patch adding missing max_current and setting it to max safe value 100 (10 mA).

---
 arch/arm/mach-omap2/board-rx51-peripherals.c |    9 +++++++++
 1 file changed, 9 insertions(+)
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-rx51-peripherals.c index c3270c0..f6fe388 100644

arch/arm/mach-omap2/board-rx51-peripherals.c +7 -0
@@ -167,38 +167,47 @@ static struct lp55xx_led_config
 rx51_lp5523_led_config[] = { .name		= "lp5523:kb1",
 		.chan_nr	= 0,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:kb2",
 		.chan_nr	= 1,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:kb3",
 		.chan_nr	= 2,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:kb4",
 		.chan_nr	= 3,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:b",
 		.chan_nr	= 4,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:g",
 		.chan_nr	= 5,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:r",
 		.chan_nr	= 6,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:kb5",

arch/arm/mach-omap2/board-rx51-peripherals.c static struct lp55xx_led_config · line 212

Quoted 10 lines
arch/arm/mach-omap2/board-rx51-peripherals.c +2 -0
 		.chan_nr	= 7,
 		.led_current	= 50,
+		.max_current	= 100,
 	}, {
 		.name		= "lp5523:kb6",
 		.chan_nr	= 8,
 		.led_current	= 50,
+		.max_current	= 100,
 	}
 };

Reviewed and found logically and technically correct
Signed-off-by: Joerg Reisenweber <joerg AT openmoko DOT org>

/jOERG

Signature · 8 lines
()  ascii ribbon campaign - against html e-mail     
/\  www.asciiribbon.org   - against proprietary attachments
(alas the above page got scrapped due to resignation(!!), so here some 
supplementary links:)
http://www.georgedillon.com/web/html_email_is_evil.shtml          
http://www.nonhtmlmail.org/campaign.html
http://www.georgedillon.com/web/html_email_is_evil_still.shtml    
http://www.gerstbach.at/2004/ascii/ (German)
maintainer
#7 lore raw
Quoted 13 lines · joerg Reisenweber
Quoted 12 lines · On Mon 23 September 2013 14:50:12 Pali Rohár wrote:

Hi Tony,

here is new version (v2) of patch which adding max_current values to rx51 board data. According to joerg safe value for max_current is 100 (10 mA).

RX-51: Add missing max_current to rx51_lp5523_led_config

File drivers/leds/leds-lp55xx-common.c refuse to change led_current sysfs attribute if value is higher than max_current specified in board file. By default global C variables are zero, so changing always failed. This patch adding missing max_current and setting it to max safe value 100 (10 mA).

...

Quoted 2 lines

Reviewed and found logically and technically correct
Signed-off-by: Joerg Reisenweber <joerg AT openmoko DOT org>

Thanks, I'll apply this into omap-for-v3.12/fixes as it's a regression.

Regards,

Tony