Please pull linux-2.6-mpc52xx.git

Grant Likely grant.likely at secretlab.ca
Wed Mar 26 05:49:04 EST 2008


On Tue, Mar 25, 2008 at 10:50 AM, Bartlomiej Sieka <tur at semihalf.com> wrote:
> Grant Likely wrote:
>  > On Tue, Mar 18, 2008 at 10:41 AM, Richard Purdie <rpurdie at rpsys.net> wrote:
>  >>  On Tue, 2008-03-18 at 08:47 -0600, Grant Likely wrote:
>  >>  I don't mind having a specific driver but I don't know anything about
>  >>  the hardware its creating the interface for so I need the community's
>  >>  help with that part. There is drivers/leds/leds-gpio.c if that would
>  >>  work better.
>  >
>  > Yes, I think that would be the right approach.  We would need to add
>  > the binding code to translate from the OF device tree to the leds-gpio
>  > driver.
>
>  I think that leds-gpio.c is a good solution for long-term. Note however,
>  that having the LED-to-GPIO pin mapping defined in the OF device
>  tree is problematic for targets that don't use a device tree, and for a
>  generic driver like leds-gpio.c some other mechanisms should probably be
>  used.

Something to consider:  The device tree is all about describing
hardware and binding it to the driver.  Nothing more.  So; there will
always be glue code to extract the config from the tree and tell the
leds-gpio driver about it (the binding); but once that is done the
driver isn't any different.  I've got several drivers with both
platform bus and of_platform bus bindings where most of the driver is
shared.  Only the bit of code that extracts the configuration from
either pdata or the device tree is bus specific.

>
>  Going back to LEDs on Motion-PRO, using leds-gpio.c for this target
>  won't be achieved quickly. leds-gpio.c uses generic GPIO access
>  routines, which are not implemented for powerpc in general, and MPC5200
>  in particular. One would have to add support for MPC5200 to GPIO LIB
>  API, and implement the above mentioned LED-to-GPIO pin mapping in
>  leds-gpio.c, and then convert Motion-PRO.
>
>  Since both you and Richard don't have objections against a specific
>  driver, and switching Motion-PRO to a generic approach requires quite a
>  bit of work -- then how about we provide a patch that addresses
>  Richard's comments, and have the Motion-PRO LED support merged upstream
>  as a specific driver?

Yes, I'm totally cool with that.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list