powerpc/4xx: Have Warp take advantage of GPIO LEDs default-state = keep

The GPIO LEDS driver now has a default state of "keep".  Update the Warp DTS
and platform file to take advantage of this new state.  This removes the
hardcoding of the two LEDs on the Warp.

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
This commit is contained in:
Sean MacLennan 2009-06-28 11:22:51 +00:00 committed by Josh Boyer
parent 7c3a742a86
commit ba703e1a7a
2 changed files with 6 additions and 13 deletions

View File

@ -261,10 +261,11 @@ power-leds {
compatible = "gpio-leds"; compatible = "gpio-leds";
green { green {
gpios = <&GPIO1 0 0>; gpios = <&GPIO1 0 0>;
default-state = "on"; default-state = "keep";
}; };
red { red {
gpios = <&GPIO1 1 0>; gpios = <&GPIO1 1 0>;
default-state = "keep";
}; };
}; };

View File

@ -64,8 +64,6 @@ define_machine(warp) {
}; };
static u32 post_info;
static int __init warp_post_info(void) static int __init warp_post_info(void)
{ {
struct device_node *np; struct device_node *np;
@ -87,10 +85,9 @@ static int __init warp_post_info(void)
iounmap(fpga); iounmap(fpga);
if (post1 || post2) { if (post1 || post2)
printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2); printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2);
post_info = 1; else
} else
printk(KERN_INFO "Warp POST OK\n"); printk(KERN_INFO "Warp POST OK\n");
return 0; return 0;
@ -179,15 +176,10 @@ static int pika_setup_leds(void)
} }
for_each_child_of_node(np, child) for_each_child_of_node(np, child)
if (strcmp(child->name, "green") == 0) { if (strcmp(child->name, "green") == 0)
green_led = of_get_gpio(child, 0); green_led = of_get_gpio(child, 0);
/* Turn back on the green LED */ else if (strcmp(child->name, "red") == 0)
gpio_set_value(green_led, 1);
} else if (strcmp(child->name, "red") == 0) {
red_led = of_get_gpio(child, 0); red_led = of_get_gpio(child, 0);
/* Set based on post */
gpio_set_value(red_led, post_info);
}
of_node_put(np); of_node_put(np);