Skip to contentSkip to conversation

ARM: imx: pwm: Add support for MX53

PATCH New Fabio Estevam 4 participants 4 messages Aug 23, 2011 – Aug 24, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: pwm: Add support for MX53

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

---
 arch/arm/plat-mxc/pwm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-mxc/pwm.c +1 -1
index 761c3c9..42d74ea 100644
@@ -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;
Signature · 1 line
1.7.1
maintainer
#1 lore raw

PATCH 1/1 ARM: imx: pwm: Add support for MX53

Quoted 2 lines · Fabio Estevam

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

Quoted 24 lines
---
 arch/arm/plat-mxc/pwm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-mxc/pwm.c +1 -1
index 761c3c9..42d74ea 100644
@@ -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;
Signature · 1 line
1.7.1
Signature · 4 lines
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 |
#2 lore raw

PATCH 1/1 ARM: imx: pwm: Add support for MX53

In reply to Fabio Estevam

Hello Fabio,

Quoted 2 lines · Fabio Estevam

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

Quoted 16 lines
 arch/arm/plat-mxc/pwm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-mxc/pwm.c +1 -1
index 761c3c9..42d74ea 100644
@@ -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;
Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#3 lore raw

PATCH 1/1 ARM: imx: pwm: Add support for MX53

Quoted 12 lines · Uwe Kleine-K?nig

Hello Fabio,

Quoted 2 lines · Fabio Estevam

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

Signature · 9 lines
___________________________________________________________

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
___________________________________________________________