]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-at91/leds.c
[ARM] 5267/1: [AT91] Name conflict in mach-at91/leds.c
[linux-2.6-omap-h63xx.git] / arch / arm / mach-at91 / leds.c
index 9cdcda500fe8195324cfe86d4cc1670381142ac1..0415a839e1ad9319944a662b409799015f9fde3d 100644 (file)
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/platform_device.h>
 
-#include <asm/mach-types.h>
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
+#include <mach/board.h>
+#include <mach/gpio.h>
 
 
 /* ------------------------------------------------------------------------- */
 
 #if defined(CONFIG_NEW_LEDS)
 
-#include <linux/platform_device.h>
-
 /*
  * New cross-platform LED support.
  */
 
 static struct gpio_led_platform_data led_data;
 
-static struct platform_device at91_leds = {
+static struct platform_device at91_gpio_leds_device = {
        .name                   = "leds-gpio",
        .id                     = -1,
        .dev.platform_data      = &led_data,
@@ -48,7 +46,7 @@ void __init at91_gpio_leds(struct gpio_led *leds, int nr)
 
        led_data.leds = leds;
        led_data.num_leds = nr;
-       platform_device_register(&at91_leds);
+       platform_device_register(&at91_gpio_leds_device);
 }
 
 #else
@@ -56,6 +54,44 @@ void __init at91_gpio_leds(struct gpio_led *leds, int nr) {}
 #endif
 
 
+/* ------------------------------------------------------------------------- */
+
+#if defined (CONFIG_LEDS_ATMEL_PWM)
+
+/*
+ * PWM Leds
+ */
+
+static struct gpio_led_platform_data pwm_led_data;
+
+static struct platform_device at91_pwm_leds_device = {
+       .name                   = "leds-atmel-pwm",
+       .id                     = -1,
+       .dev.platform_data      = &pwm_led_data,
+};
+
+void __init at91_pwm_leds(struct gpio_led *leds, int nr)
+{
+       int i;
+       u32 pwm_mask = 0;
+
+       if (!nr)
+               return;
+
+       for (i = 0; i < nr; i++)
+               pwm_mask |= (1 << leds[i].gpio);
+
+       pwm_led_data.leds = leds;
+       pwm_led_data.num_leds = nr;
+
+       at91_add_device_pwm(pwm_mask);
+       platform_device_register(&at91_pwm_leds_device);
+}
+#else
+void __init at91_pwm_leds(struct gpio_led *leds, int nr){}
+#endif
+
+
 /* ------------------------------------------------------------------------- */
 
 #if defined(CONFIG_LEDS)