ARM: 5878/1: ep93xx: register the pwm devices on the edb93xx dev boards
authorHartley Sweeten <hartleys@visionengravers.com>
Mon, 11 Jan 2010 20:38:00 +0000 (21:38 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 12 Jan 2010 12:38:33 +0000 (12:38 +0000)
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>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-ep93xx/edb93xx.c

index a4a7be3080002cb2c1577eeb2cb1cfb40ec4b68c..d22d67ac8b9938cd444fa6d212cf0acdaa8beba8 100644 (file)
@@ -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();
 }