pandora: add leds_pwm platform data
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 27 Jun 2010 18:36:11 +0000 (21:36 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 14 Jan 2012 22:16:34 +0000 (00:16 +0200)
arch/arm/mach-omap2/board-omap3pandora.c

index a0f9688..110514a 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
 #include <linux/leds.h>
+#include <linux/leds_pwm.h>
 #include <linux/input.h>
 #include <linux/input/matrix_keypad.h>
 #include <linux/gpio.h>
@@ -122,6 +123,33 @@ static struct platform_device pandora_leds_gpio = {
        },
 };
 
+static struct led_pwm pandora_pwm_leds[] = {
+       {
+               .name                   = "pandora::keypad_bl",
+               .pwm_id                 = 0, /* LEDA */
+       }, {
+               .name                   = "pandora::power",
+               .pwm_id                 = 1, /* LEDB */
+       }, {
+               .name                   = "pandora::charger",
+               .default_trigger        = "bq27500-0-charging",
+               .pwm_id                 = 3, /* PWM1 */
+       }
+};
+
+static struct led_pwm_platform_data pandora_pwm_led_data = {
+       .leds           = pandora_pwm_leds,
+       .num_leds       = ARRAY_SIZE(pandora_pwm_leds),
+};
+
+static struct platform_device pandora_leds_pwm = {
+       .name   = "leds-twl4030-pwm",
+       .id     = -1,
+       .dev    = {
+               .platform_data  = &pandora_pwm_led_data,
+       },
+};
+
 static struct platform_device pandora_bl = {
        .name   = "twl4030-pwm0-bl",
        .id     = -1,
@@ -588,6 +616,7 @@ fail:
 
 static struct platform_device *omap3pandora_devices[] __initdata = {
        &pandora_leds_gpio,
+       &pandora_leds_pwm,
        &pandora_bl,
        &pandora_keys_gpio,
        &pandora_vwlan_device,