[PATCH v3 1/4] leds: leds-pwm: Convert to use devm_get_pwm

Peter Ujfalusi peter.ujfalusi at ti.com
Tue Dec 11 19:57:51 EST 2012


On Tuesday 11 December 2012 09:36:35 Thierry Reding wrote:
> > > The commit message says that legacy mode is used as fallback if
> > > devm_get_pwm() (that should really be devm_pwm_get() btw) fails but I
> > > don't see where pwm_request() is called.
> > 
> > Oh, true. The fallback has been removed based on earlier comment from
> > Bryan
> > Wu. I will correct the commit message.
> 
> I'm not so sure that's a good idea. After all there may still be users
> who rely on the legacy behaviour.

The only user of leds_pwm is arch/arm/mach-omap2/board-4430sdp.c. Even that is 
not working because it uses wrong ID number to request the pwm.
The legacy request type needs the id number of the PWM it want to use. But if 
you have multiple PWM devices there is not way to guess the ID for the PWM. 
Using the pwm_get() along with pwm_lookup is the only way to get thing 
working.
For example with twl4030 we have 2 PWM chips, both provides 2 PWMs. The ID 
number of the PWMs will depend on the load order of the drivers. If they are 
built in they are going to be in the same order most of the time, but if they 
are modules they can be loaded in different order.

I think we should not use fallback in leds-pwm to avoid new boards to use the 
legacy API.

--
Péter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20121211/a75baaeb/attachment-0001.html>


More information about the devicetree-discuss mailing list