From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from yow.seanm.ca (toronto-hs-216-138-233-67.s-ip.magma.ca [216.138.233.67]) by ozlabs.org (Postfix) with SMTP id AFF4DDDFAD for ; Wed, 13 May 2009 09:14:29 +1000 (EST) Date: Tue, 12 May 2009 19:14:25 -0400 From: Sean MacLennan To: Trent Piepho Subject: Re: [PATCH] leds: Add options to have GPIO LEDs start on or keep their state Message-ID: <20090512191425.7b8c53df@lappy.seanm.ca> In-Reply-To: <1242167592-14649-1-git-send-email-xyzzy@speakeasy.org> References: <1242167592-14649-1-git-send-email-xyzzy@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Cc: linuxppc-dev , Richard Purdie , Trent Piepho List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 12 May 2009 15:33:12 -0700 Trent Piepho 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 Tested-by: Sean MacLennan 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