]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] 4973/1: Tosa: use leds-gpio driver.
authorDmitry Baryshkov <dbaryshkov@gmail.com>
Sat, 12 Apr 2008 19:17:02 +0000 (20:17 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 19 Apr 2008 10:29:08 +0000 (11:29 +0100)
Now as the scoop pins are covered by the generic gpio API,
we can use leds-gpio driver instead of special leds-tosa.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-pxa/tosa.c
include/asm-arm/arch-pxa/tosa.h

index 49b5b83c0e4c411bbbbd2a7be0d556d606e35825..af1cce31c746926be677537bab1865bc409ebcdd 100644 (file)
@@ -421,9 +421,30 @@ static struct platform_device tosa_gpio_keys_device = {
 /*
  * Tosa LEDs
  */
+struct gpio_led tosa_gpio_leds[] = {
+       {
+               .name                   = "tosa:amber:charge",
+               .default_trigger        = "main-battery-charging",
+               .gpio                   = TOSA_GPIO_CHRG_ERR_LED,
+       },
+       {
+               .name                   = "tosa:green:mail",
+               .default_trigger        = "nand-disk",
+               .gpio                   = TOSA_GPIO_NOTE_LED,
+       },
+};
+
+struct gpio_led_platform_data tosa_gpio_leds_platform_data = {
+       .leds           = tosa_gpio_leds,
+       .num_leds       = ARRAY_SIZE(tosa_gpio_leds),
+};
+
 static struct platform_device tosaled_device = {
-    .name   = "tosa-led",
-    .id     = -1,
+       .name   = "leds-gpio",
+       .id     = -1,
+       .dev    = {
+               .platform_data  = &tosa_gpio_leds_platform_data,
+       },
 };
 
 static struct platform_device *devices[] __initdata = {
index 130bc6025cf4d6a574e1f33fc186d13ac70c5605..8bc7cdd0f79ea89d62def760f4aaddde29f9b92d 100644 (file)
@@ -46,8 +46,8 @@
  */
 #define TOSA_SCOOP_JC_GPIO_BASE                (NR_BUILTIN_GPIO + 12)
 #define TOSA_SCOOP_JC_BT_LED           SCOOP_GPCR_PA11
-#define TOSA_SCOOP_JC_NOTE_LED         SCOOP_GPCR_PA12
-#define TOSA_SCOOP_JC_CHRG_ERR_LED     SCOOP_GPCR_PA13
+#define TOSA_GPIO_NOTE_LED             (TOSA_SCOOP_JC_GPIO_BASE + 1)
+#define TOSA_GPIO_CHRG_ERR_LED         (TOSA_SCOOP_JC_GPIO_BASE + 2)
 #define TOSA_GPIO_USB_PULLUP           (TOSA_SCOOP_JC_GPIO_BASE + 3)
 #define TOSA_SCOOP_JC_TC6393_SUSPEND   SCOOP_GPCR_PA15
 #define TOSA_SCOOP_JC_TC3693_L3V_ON    SCOOP_GPCR_PA16
@@ -56,8 +56,7 @@
 #define TOSA_SCOOP_JC_CARD_LIMIT_SEL   SCOOP_GPCR_PA19
 
 /* GPIO Direction   1 : output mode / 0:input mode */
-#define TOSA_SCOOP_JC_IO_DIR ( TOSA_SCOOP_JC_BT_LED | TOSA_SCOOP_JC_NOTE_LED | \
-               TOSA_SCOOP_JC_CHRG_ERR_LED | \
+#define TOSA_SCOOP_JC_IO_DIR ( TOSA_SCOOP_JC_BT_LED | \
                TOSA_SCOOP_JC_TC6393_SUSPEND | TOSA_SCOOP_JC_TC3693_L3V_ON | \
                TOSA_SCOOP_JC_WLAN_LED | TOSA_SCOOP_JC_CARD_LIMIT_SEL )