From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Ujfalusi Subject: Re: Re: Re: [PATCH v3 1/4] leds: leds-pwm: Convert to use devm_get_pwm Date: Tue, 11 Dec 2012 09:57:51 +0100 Message-ID: <1406670.ryvqfkiNXS@barack> References: <1355133637-2784-1-git-send-email-peter.ujfalusi@ti.com> <3193669.Hv54bBklsP@barack> <20121211083632.GC27084@avionic-0098.adnet.avionic-design.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2486505040375853936==" Return-path: In-Reply-To: <20121211083632.GC27084-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Thierry Reding Cc: linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Bryan Wu , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Richard Purdie , linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org --===============2486505040375853936== Content-Type: multipart/alternative; boundary="nextPart1493525.XFdZNMqJj5" Content-Transfer-Encoding: 7Bit --nextPart1493525.XFdZNMqJj5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="ISO-8859-1" 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 b= ut I > > > don't see where pwm_request() is called. > >=20 > > Oh, true. The fallback has been removed based on earlier comment fr= om > > Bryan > > Wu. I will correct the commit message. >=20 > I'm not so sure that's a good idea. After all there may still be user= s > who rely on the legacy behaviour. The only user of leds_pwm is arch/arm/mach-omap2/board-4430sdp.c. Even = that is=20 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=20 you have multiple PWM devices there is not way to guess the ID for the = PWM.=20 Using the pwm_get() along with pwm_lookup is the only way to get thing=20= working. For example with twl4030 we have 2 PWM chips, both provides 2 PWMs. The= ID=20 number of the PWMs will depend on the load order of the drivers. If the= y are=20 built in they are going to be in the same order most of the time, but i= f they=20 are modules they can be loaded in different order. I think we should not use fallback in leds-pwm to avoid new boards to u= se the=20 legacy API. -- P=E9ter --nextPart1493525.XFdZNMqJj5 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="ISO-8859-1"

On = Tuesday 11 December 2012 09:36:35 Thierry Reding wrote:

>= ; > > The commit message says that legacy mode is used as fallbac= k if

>= ; > > devm_get_pwm() (that should really be devm_pwm_get() btw) f= ails 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 user= s

>= ; who rely on the legacy behaviour.

 

The= only user of leds_pwm is arch/arm/mach-omap2/board-4430sdp.c. Even tha= t 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 g= et 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 th= ey 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 t= hink we should not use fallback in leds-pwm to avoid new boards to use = the legacy API.

 

--<= /p>

P=E9= ter

--nextPart1493525.XFdZNMqJj5-- --===============2486505040375853936== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org https://lists.ozlabs.org/listinfo/devicetree-discuss --===============2486505040375853936==--