[PATCH v3] leds: implement OpenFirmare GPIO LED driver

Trent Piepho tpiepho at freescale.com
Fri Jul 18 19:20:42 EST 2008


On Fri, 18 Jul 2008, Anton Vorontsov wrote:
> On Thu, Jul 17, 2008 at 01:18:18PM -0700, Trent Piepho wrote:
>> Basically what I did then in my patch then, refactor leds-gpio so most of
>> it is shared and there is a block of code that does platform binding and
>> another block that does of_platform binding.
>
> Ok. I must admit I'm quite burned out with OF gpio-leds. I was posting the
> bindings since April, probably four or five times. Last time a week ago,
> IIRC.
>
> During the months I received just a few replies, one from Grant ("Looks
> good to me."), few from Segher (with a lot of criticism, that I much
> appreciated and tried to fix all spotted issues), and one from Laurent
> (about active-low LEDs).

I'm sorry, I never saw those emails.  Were they all to linuxppc-dev?  I hate
reading that list, gmane, marc, and lkml.org don't archive it and
mail-archive.com isn't nearly as nice.

Is this the last version?
http://www.mail-archive.com/linuxppc-dev@ozlabs.org/msg18355.html

Why did you get rid of "linux,default-trigger" and the active-low property? 
I couldn't find any discussion about this.  When I first saw your current
patch I was going to add them, but I see you already had them and then
removed them.

I'd like to replace my "led-hack" stg patch with this, but I need
default-trigger to do that.  I don't need active-low or default-brightness,
but they seem like a good idea.  Actually, if you look closely at the patch
I posted, you'll see I had modified the existing leds-gpio driver to add a
default-brightness feature, though I don't need it anymore.  The requirement
changed from having an led on during kernel boot to having it flash.  I
have another hack for that, since there is no way to pass parameters to a
trigger.

>> leds {
>>  	compatible = "gpio-led";
>>  	led at 6 {
>>  		gpios = <&mpc8572 6 0>;
>>  		label = "red";
>>  	};
>>  	led at 7 {
>>  		gpios = <&mpc8572 7 0>;
>>  		label = "green";
>>  	};
>> };
>
> I like this. Or better what Grant suggested, i.e. move label to node
> name.

Ok, I used that.  It's like the new way partitions are defined in NOR flash
OF bindings.  My first example was more like the old way.  The led name can
come from a label property or if there is none then the node name is used. 
I don't think you can have colons or spaces in node names.  I don't have a
default trigger property, but I'd really like to have that.  I could add an
active low flag too.  Maybe compatible should be "gpio-leds", since you can
define more than one?

The patch is done and works for me.  One can select platform device and/or
of_platform device support via Kconfig.  I'll port it to the git kernel and
post it soon.



More information about the Linuxppc-dev mailing list