public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: imx: pwm: Add support for MX53
@ 2011-08-23 16:26 Fabio Estevam
  2011-08-24  8:18 ` Sascha Hauer
  2011-08-24  8:25 ` Uwe Kleine-König
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2011-08-23 16:26 UTC (permalink / raw)
  To: linux-arm-kernel

Instead of adding the check for MX53 CPU type, use the negative logic and let 
PWM to be configured for MX53 as well.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 arch/arm/plat-mxc/pwm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c
index 761c3c9..42d74ea 100644
--- a/arch/arm/plat-mxc/pwm.c
+++ b/arch/arm/plat-mxc/pwm.c
@@ -57,7 +57,7 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
 	if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
 		return -EINVAL;
 
-	if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) {
+	if (!(cpu_is_mx1() || cpu_is_mx21())) {
 		unsigned long long c;
 		unsigned long period_cycles, duty_cycles, prescale;
 		u32 cr;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ARM: imx: pwm: Add support for MX53
  2011-08-23 16:26 [PATCH] ARM: imx: pwm: Add support for MX53 Fabio Estevam
@ 2011-08-24  8:18 ` Sascha Hauer
  2011-08-24  8:25 ` Uwe Kleine-König
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2011-08-24  8:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 23, 2011 at 01:26:38PM -0300, Fabio Estevam wrote:
> Instead of adding the check for MX53 CPU type, use the negative logic and let 
> PWM to be configured for MX53 as well.

Applied for next.

Sascha

> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  arch/arm/plat-mxc/pwm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c
> index 761c3c9..42d74ea 100644
> --- a/arch/arm/plat-mxc/pwm.c
> +++ b/arch/arm/plat-mxc/pwm.c
> @@ -57,7 +57,7 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
>  	if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
>  		return -EINVAL;
>  
> -	if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) {
> +	if (!(cpu_is_mx1() || cpu_is_mx21())) {
>  		unsigned long long c;
>  		unsigned long period_cycles, duty_cycles, prescale;
>  		u32 cr;
> -- 
> 1.7.1
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: imx: pwm: Add support for MX53
  2011-08-23 16:26 [PATCH] ARM: imx: pwm: Add support for MX53 Fabio Estevam
  2011-08-24  8:18 ` Sascha Hauer
@ 2011-08-24  8:25 ` Uwe Kleine-König
  2011-08-24  8:33   ` Lothar Waßmann
  1 sibling, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2011-08-24  8:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Fabio,

On Tue, Aug 23, 2011 at 01:26:38PM -0300, Fabio Estevam wrote:
> Instead of adding the check for MX53 CPU type, use the negative logic and let 
> PWM to be configured for MX53 as well.
I wonder why you prefer negative logic here. It might be shorter, but it
is also less robust. For example it seems to me you not only added
support for i.MX53 but also i.MX50.

The IMHO best solution would be to use device ids and get rid of
cpu_is_mx.. completely.

Best regards
Uwe
>  arch/arm/plat-mxc/pwm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c
> index 761c3c9..42d74ea 100644
> --- a/arch/arm/plat-mxc/pwm.c
> +++ b/arch/arm/plat-mxc/pwm.c
> @@ -57,7 +57,7 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
>  	if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
>  		return -EINVAL;
>  
> -	if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) {
> +	if (!(cpu_is_mx1() || cpu_is_mx21())) {
>  		unsigned long long c;
>  		unsigned long period_cycles, duty_cycles, prescale;
>  		u32 cr;

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: imx: pwm: Add support for MX53
  2011-08-24  8:25 ` Uwe Kleine-König
@ 2011-08-24  8:33   ` Lothar Waßmann
  0 siblings, 0 replies; 4+ messages in thread
From: Lothar Waßmann @ 2011-08-24  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

Uwe Kleine-K?nig writes:
> Hello Fabio,
> 
> On Tue, Aug 23, 2011 at 01:26:38PM -0300, Fabio Estevam wrote:
> > Instead of adding the check for MX53 CPU type, use the negative logic and let 
> > PWM to be configured for MX53 as well.
> I wonder why you prefer negative logic here. It might be shorter, but it
> is also less robust. For example it seems to me you not only added
> support for i.MX53 but also i.MX50.
> 
> The IMHO best solution would be to use device ids and get rid of
> cpu_is_mx.. completely.
> 
+1


Lothar Wa?mann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-24  8:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-23 16:26 [PATCH] ARM: imx: pwm: Add support for MX53 Fabio Estevam
2011-08-24  8:18 ` Sascha Hauer
2011-08-24  8:25 ` Uwe Kleine-König
2011-08-24  8:33   ` Lothar Waßmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox