[PATCH] leds: Add options to have GPIO LEDs start on or keep their state
Sean MacLennan
smaclennan at pikatech.com
Wed May 13 09:14:25 EST 2009
On Tue, 12 May 2009 15:33:12 -0700
Trent Piepho <xyzzy at speakeasy.org> wrote:
> + if (!strcmp(state, "keep")) {
> + led.default_state =
> LEDS_GPIO_DEFSTATE_KEEP;
> + } else if(!strcmp(state, "on")) {
> + led.default_state =
> LEDS_GPIO_DEFSTATE_ON;
> + } else {
> + led.default_state =
> LEDS_GPIO_DEFSTATE_OFF;
> + }
Just a nitpick, you don't need the {} braces here. Other than that:
Acked-by: Sean MacLennan <smaclennan at pikatech.com>
Tested-by: Sean MacLennan <smaclennan at pikatech.com>
Tested on a warp with the following:
power-leds {
compatible = "gpio-leds";
green {
gpios = <&GPIO1 0 0>;
default-state = "on";
};
red {
gpios = <&GPIO1 1 0>;
default-state = "keep";
};
};
I tested with both the red LED initially off and initially on as set in
u-boot.
Cheers,
Sean
More information about the Linuxppc-dev
mailing list