Skip to contentSkip to conversation

arm: mach-kirkwood: Make the red led available on the eSATA SheevaPlug

PATCH Sean Young 3 participants 4 messages Apr 16, 2011 – Apr 18, 2011

Subsystems (2)
lore
Share & tools
lore

Sean Young

author
#0 lore raw

After this patch:

7780c80 arm: mach-kirkwood: add led in sheevaplug-setup.c

On a eSATA SheevaPlug, neither the red nor the green led can be controlled, since probing fails with:

[    6.188278] leds-gpio: probe of leds-gpio failed with error -22
arch/arm/mach-kirkwood/sheevaplug-setup.c +1 -0
index 17de0bf..92db979 100644
@@ -94,6 +94,7 @@ static unsigned int sheevaplug_mpp_config[] __initdata = {
 static unsigned int sheeva_esata_mpp_config[] __initdata = {
 	MPP29_GPIO,	/* USB Power Enable */
 	MPP44_GPIO,	/* SD Write Protect */
+	MPP46_GPIO,	/* LED Red */
 	MPP47_GPIO,	/* SD Card Detect */
 	MPP49_GPIO,	/* LED Green */
 	0
#1 lore raw
Quoted 17 lines · Sean Young

After this patch:

7780c80 arm: mach-kirkwood: add led in sheevaplug-setup.c

On a eSATA SheevaPlug, neither the red nor the green led can be controlled, since probing fails with:

[    6.188278] leds-gpio: probe of leds-gpio failed with error -22
arch/arm/mach-kirkwood/sheevaplug-setup.c +0 -0
index 17de0bf..92db979 100644

arch/arm/mach-kirkwood/sheevaplug-setup.c static unsigned int sheevaplug_mpp_config[] __initdata = { · line 100

Quoted 7 lines
arch/arm/mach-kirkwood/sheevaplug-setup.c +1 -0
@@ -94,6 +94,7 @@ static unsigned int sheevaplug_mpp_config[] __initdata = {
  static unsigned int sheeva_esata_mpp_config[] __initdata = {
  	MPP29_GPIO,	/* USB Power Enable */
  	MPP44_GPIO,	/* SD Write Protect */
+	MPP46_GPIO,	/* LED Red */
  	MPP47_GPIO,	/* SD Card Detect */
  	MPP49_GPIO,	/* LED Green */
  	0

I think my original patch had some changes to gpio_led sheevaplug_led_pins as well. It definitely works on my standard sheeva plug. In fact I have three controllable leds at 46, 48 & 49. GPIO 45 is also an led, but is also grounded so is permanently on. This is something like the patch I am using with plugbox

arch/arm/mach-kirkwood/sheevaplug-setup.c +16 -2
index d2eec35..e14893b 100644
@@ -58,7 +58,19 @@
 
 static struct gpio_led sheevaplug_led_pins[] = {
    {
-       .name           = "plug:green:health",
+       .name           = "status:red:misc",
+       .default_trigger    = "none",
+       .gpio           = 46,
+       .active_low     = 1,
+   },
+   {
+       .name           = "status:green:health",
+       .default_trigger    = "none",
+       .gpio           = 48,
+       .active_low     = 1,
+   },
+   {
+       .name           = "status:blue:health",
        .default_trigger    = "default-on",
        .gpio           = 49,
        .active_low     = 1,
@@ -80,7 +92,9 @@
 
 static unsigned int sheevaplug_mpp_config[] __initdata = {
    MPP29_GPIO, /* USB Power Enable */
-   MPP49_GPIO, /* LED */
+   MPP46_GPIO, /* LED Red Misc */
+   MPP48_GPIO, /* LED Green Health */
+   MPP49_GPIO, /* LED Blue Health */
    0
 };
 
Signature · 1 line
Robin Becker
author
#2 lore raw
Quoted 12 lines · Robin Becker
Quoted 11 lines · Sean Young

After this patch:

7780c80 arm: mach-kirkwood: add led in sheevaplug-setup.c

On a eSATA SheevaPlug, neither the red nor the green led can be controlled, since probing fails with:

[    6.188278] leds-gpio: probe of leds-gpio failed with error -22
Quoted 16 lines

arch/arm/mach-kirkwood/sheevaplug-setup.c static unsigned int sheevaplug_mpp_config[] __initdata = { · line 100

Quoted 13 lines
arch/arm/mach-kirkwood/sheevaplug-setup.c +1 -0
index 17de0bf..92db979 100644
@@ -94,6 +94,7 @@ static unsigned int sheevaplug_mpp_config[] __initdata = {
 static unsigned int sheeva_esata_mpp_config[] __initdata = {
 	MPP29_GPIO,	/* USB Power Enable */
 	MPP44_GPIO,	/* SD Write Protect */
+	MPP46_GPIO,	/* LED Red */
 	MPP47_GPIO,	/* SD Card Detect */
 	MPP49_GPIO,	/* LED Green */
 	0

I think my original patch had some changes to gpio_led sheevaplug_led_pins as well.

Yes, which causes breakage on my eSATA SheevaPlug without my patch above, since the corresponding GPIO pins aren't enabled.

Quoted 31 lines

It definitely works on my standard
sheeva plug. In fact I have three controllable leds at 46, 48 & 49. GPIO 45 is also an led, but is also grounded so is permanently on. This is something like the patch I am using with plugbox

arch/arm/mach-kirkwood/sheevaplug-setup.c +13 -1
index d2eec35..e14893b 100644
@@ -58,7 +58,19 @@
 
 static struct gpio_led sheevaplug_led_pins[] = {
    {
-       .name           = "plug:green:health",
+       .name           = "status:red:misc",
+       .default_trigger    = "none",
+       .gpio           = 46,
+       .active_low     = 1,
+   },
+   {
+       .name           = "status:green:health",
+       .default_trigger    = "none",
+       .gpio           = 48,
+       .active_low     = 1,
+   },
+   {
+       .name           = "status:blue:health",
        .default_trigger    = "default-on",
        .gpio           = 49,
        .active_low     = 1,

arch/arm/mach-kirkwood/sheevaplug-setup.c line 100

Quoted 10 lines
arch/arm/mach-kirkwood/sheevaplug-setup.c +3 -1
@@ -80,7 +92,9 @@
 
 static unsigned int sheevaplug_mpp_config[] __initdata = {
    MPP29_GPIO, /* USB Power Enable */
-   MPP49_GPIO, /* LED */
+   MPP46_GPIO, /* LED Red Misc */
+   MPP48_GPIO, /* LED Green Health */
+   MPP49_GPIO, /* LED Blue Health */
    0
 };
 

First of all, your mail client has replaced tabs with spaces, causing the patch to be garbage.

Again you're not enabling the GPIO pins on the eSATA SheevaPlug for the leds you're adding. For the eSATA SheevaPlug sheeva_esata_mpp_config[] is used, not sheevaplug_mpp_config[], causing this patch and 2.6.39-rc? to break on the eSATA SheevaPlug.

Sean

#3 lore raw
Quoted 12 lines · Sean Young
Quoted 11 lines · Robin Becker
Quoted 10 lines · Sean Young

After this patch:

7780c80 arm: mach-kirkwood: add led in sheevaplug-setup.c

On a eSATA SheevaPlug, neither the red nor the green led can be controlled, since probing fails with:

[    6.188278] leds-gpio: probe of leds-gpio failed with error -22

[...]

Quoted 5 lines
Quoted 2 lines

I think my original patch had some changes to gpio_led sheevaplug_led_pins as well.

Yes, which causes breakage on my eSATA SheevaPlug without my patch above, since the corresponding GPIO pins aren't enabled.

I didn't closely follow the matter, so could both of you resolve possible issues and resent me the appropriate patch with Acked-by tags please?

Nicolas