linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ep93xx: register the pwm devices on the edb93xx dev boards
@ 2010-01-05 22:08 H Hartley Sweeten
  2010-01-11  1:09 ` Ryan Mallon
  0 siblings, 1 reply; 5+ messages in thread
From: H Hartley Sweeten @ 2010-01-05 22:08 UTC (permalink / raw)
  To: linux-arm-kernel

ep93xx: register the pwm devices on the edb93xx dev boards

Add the platform init code to register the pwm devices that exist
on the various edb93xx development boards.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <ryan@bluewatersys.com>

---

diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index a4a7be3..cee7e91 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -118,12 +118,33 @@ static void __init edb93xx_register_i2c(void)
 	}
 }
 
+
+/*************************************************************************
+ * EDB93xx pwm
+ *************************************************************************/
+static void __init edb93xx_register_pwm(void)
+{
+	if (machine_is_edb9301() ||
+	    machine_is_edb9302() || machine_is_edb9302a()) {
+		/* EP9301 and EP9302 only have pwm.1 (EGPIO14) */
+		ep93xx_register_pwm(0, 1);
+	} if (machine_is_edb9307() || machine_is_edb9307a()) {
+		/* EP9307 only has pwm.0 (PWMOUT) */
+		ep93xx_register_pwm(1, 0);
+	} else {
+		/* EP9312 and EP9315 have both */
+		ep93xx_register_pwm(1, 1);
+	}
+}
+
+
 static void __init edb93xx_init_machine(void)
 {
 	ep93xx_init_devices();
 	edb93xx_register_flash();
 	ep93xx_register_eth(&edb93xx_eth_data, 1);
 	edb93xx_register_i2c();
+	edb93xx_register_pwm();
 }
 
 

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

* [PATCH] ep93xx: register the pwm devices on the edb93xx dev boards
  2010-01-05 22:08 [PATCH] ep93xx: register the pwm devices on the edb93xx dev boards H Hartley Sweeten
@ 2010-01-11  1:09 ` Ryan Mallon
  2010-01-11 18:09   ` H Hartley Sweeten
  2010-01-11 18:13   ` H Hartley Sweeten
  0 siblings, 2 replies; 5+ messages in thread
From: Ryan Mallon @ 2010-01-11  1:09 UTC (permalink / raw)
  To: linux-arm-kernel

H Hartley Sweeten wrote:
> ep93xx: register the pwm devices on the edb93xx dev boards
> 
> Add the platform init code to register the pwm devices that exist
> on the various edb93xx development boards.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Ryan Mallon <ryan@bluewatersys.com>
> 
> ---
> 
> diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
> index a4a7be3..cee7e91 100644
> --- a/arch/arm/mach-ep93xx/edb93xx.c
> +++ b/arch/arm/mach-ep93xx/edb93xx.c
> @@ -118,12 +118,33 @@ static void __init edb93xx_register_i2c(void)
>  	}
>  }
>  
> +
> +/*************************************************************************
> + * EDB93xx pwm
> + *************************************************************************/
> +static void __init edb93xx_register_pwm(void)
> +{
> +	if (machine_is_edb9301() ||
> +	    machine_is_edb9302() || machine_is_edb9302a()) {
> +		/* EP9301 and EP9302 only have pwm.1 (EGPIO14) */
> +		ep93xx_register_pwm(0, 1);
> +	} if (machine_is_edb9307() || machine_is_edb9307a()) {

else if? Otherwise the else clause below will also occur on 9301, 9302
and 9302a and try to register the pwm's twice.

> +		/* EP9307 only has pwm.0 (PWMOUT) */
> +		ep93xx_register_pwm(1, 0);
> +	} else {
> +		/* EP9312 and EP9315 have both */
> +		ep93xx_register_pwm(1, 1);
> +	}
> +}

~Ryan

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934

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

* [PATCH] ep93xx: register the pwm devices on the edb93xx dev boards
  2010-01-11  1:09 ` Ryan Mallon
@ 2010-01-11 18:09   ` H Hartley Sweeten
  2010-01-11 18:13   ` H Hartley Sweeten
  1 sibling, 0 replies; 5+ messages in thread
From: H Hartley Sweeten @ 2010-01-11 18:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday, January 10, 2010 6:10 PM, Ryan Mallon wrote:
> H Hartley Sweeten wrote:
>> ep93xx: register the pwm devices on the edb93xx dev boards
>> 
>> Add the platform init code to register the pwm devices that exist
>> on the various edb93xx development boards.
>> 
>> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>> Cc: Ryan Mallon <ryan@bluewatersys.com>
>> 
>> ---
>> 
>> diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
>> index a4a7be3..cee7e91 100644
>> --- a/arch/arm/mach-ep93xx/edb93xx.c
>> +++ b/arch/arm/mach-ep93xx/edb93xx.c
>> @@ -118,12 +118,33 @@ static void __init edb93xx_register_i2c(void)
>>  	}
>>  }
>>  
>> +
>> +/*************************************************************************
>> + * EDB93xx pwm
>> + *************************************************************************/
>> +static void __init edb93xx_register_pwm(void)
>> +{
>> +	if (machine_is_edb9301() ||
>> +	    machine_is_edb9302() || machine_is_edb9302a()) {
>> +		/* EP9301 and EP9302 only have pwm.1 (EGPIO14) */
>> +		ep93xx_register_pwm(0, 1);
>> +	} if (machine_is_edb9307() || machine_is_edb9307a()) {
>
> else if? Otherwise the else clause below will also occur on 9301, 9302
> and 9302a and try to register the pwm's twice.

Yah, I'm an idiot... Updated patch coming.

Thanks,
Hartley

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

* [PATCH] ep93xx: register the pwm devices on the edb93xx dev boards
  2010-01-11  1:09 ` Ryan Mallon
  2010-01-11 18:09   ` H Hartley Sweeten
@ 2010-01-11 18:13   ` H Hartley Sweeten
  2010-01-11 19:42     ` Ryan Mallon
  1 sibling, 1 reply; 5+ messages in thread
From: H Hartley Sweeten @ 2010-01-11 18:13 UTC (permalink / raw)
  To: linux-arm-kernel

ep93xx: register the pwm devices on the edb93xx dev boards

Add the platform init code to register the pwm devices that exist
on the various edb93xx development boards.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <ryan@bluewatersys.com>

---

V2 - fix 'if/else if' typo spotted by Ryan Mallon.

diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index a4a7be3..d22d67a 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -118,12 +118,33 @@ static void __init edb93xx_register_i2c(void)
 	}
 }
 
+
+/*************************************************************************
+ * EDB93xx pwm
+ *************************************************************************/
+static void __init edb93xx_register_pwm(void)
+{
+	if (machine_is_edb9301() ||
+	    machine_is_edb9302() || machine_is_edb9302a()) {
+		/* EP9301 and EP9302 only have pwm.1 (EGPIO14) */
+		ep93xx_register_pwm(0, 1);
+	} else if (machine_is_edb9307() || machine_is_edb9307a()) {
+		/* EP9307 only has pwm.0 (PWMOUT) */
+		ep93xx_register_pwm(1, 0);
+	} else {
+		/* EP9312 and EP9315 have both */
+		ep93xx_register_pwm(1, 1);
+	}
+}
+
+
 static void __init edb93xx_init_machine(void)
 {
 	ep93xx_init_devices();
 	edb93xx_register_flash();
 	ep93xx_register_eth(&edb93xx_eth_data, 1);
 	edb93xx_register_i2c();
+	edb93xx_register_pwm();
 }
 
 

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

* [PATCH] ep93xx: register the pwm devices on the edb93xx dev boards
  2010-01-11 18:13   ` H Hartley Sweeten
@ 2010-01-11 19:42     ` Ryan Mallon
  0 siblings, 0 replies; 5+ messages in thread
From: Ryan Mallon @ 2010-01-11 19:42 UTC (permalink / raw)
  To: linux-arm-kernel

H Hartley Sweeten wrote:
> ep93xx: register the pwm devices on the edb93xx dev boards
> 
> Add the platform init code to register the pwm devices that exist
> on the various edb93xx development boards.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Ryan Mallon <ryan@bluewatersys.com>
> 
> ---
> 
> V2 - fix 'if/else if' typo spotted by Ryan Mallon.
> 
> diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
> index a4a7be3..d22d67a 100644
> --- a/arch/arm/mach-ep93xx/edb93xx.c
> +++ b/arch/arm/mach-ep93xx/edb93xx.c
> @@ -118,12 +118,33 @@ static void __init edb93xx_register_i2c(void)
>  	}
>  }
>  
> +
> +/*************************************************************************
> + * EDB93xx pwm
> + *************************************************************************/
> +static void __init edb93xx_register_pwm(void)
> +{
> +	if (machine_is_edb9301() ||
> +	    machine_is_edb9302() || machine_is_edb9302a()) {
> +		/* EP9301 and EP9302 only have pwm.1 (EGPIO14) */
> +		ep93xx_register_pwm(0, 1);
> +	} else if (machine_is_edb9307() || machine_is_edb9307a()) {
> +		/* EP9307 only has pwm.0 (PWMOUT) */
> +		ep93xx_register_pwm(1, 0);
> +	} else {
> +		/* EP9312 and EP9315 have both */
> +		ep93xx_register_pwm(1, 1);
> +	}
> +}
> +
> +
>  static void __init edb93xx_init_machine(void)
>  {
>  	ep93xx_init_devices();
>  	edb93xx_register_flash();
>  	ep93xx_register_eth(&edb93xx_eth_data, 1);
>  	edb93xx_register_i2c();
> +	edb93xx_register_pwm();
>  }
>  
>  

Looks good.

Acked-by: Ryan Mallon <ryan@bluewatersys.com>

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934

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

end of thread, other threads:[~2010-01-11 19:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-05 22:08 [PATCH] ep93xx: register the pwm devices on the edb93xx dev boards H Hartley Sweeten
2010-01-11  1:09 ` Ryan Mallon
2010-01-11 18:09   ` H Hartley Sweeten
2010-01-11 18:13   ` H Hartley Sweeten
2010-01-11 19:42     ` Ryan Mallon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).