]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[ARM] 4761/1: [AT91] Board-support for NEW_LEDs
authorAndrew Victor <linux@maxim.org.za>
Wed, 23 Jan 2008 08:32:17 +0000 (09:32 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 26 Jan 2008 15:00:32 +0000 (15:00 +0000)
Add NEW_LEDs support for the following boards:
 - Cogent CSB337
 - Atmel AT91RM9200-DK
 - Atmel AT91RM9200-EK
 - Atmel AT91SAM9263-EK

Mostly based on patch from David Brownell.

Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-at91/board-csb337.c
arch/arm/mach-at91/board-dk.c
arch/arm/mach-at91/board-ek.c
arch/arm/mach-at91/board-sam9263ek.c

index 51cb3c8cc601a347967e280ec50eaa26e5388e2d..0e2a11fc5bbd587315b0a6f0a78d8ee3ef31dc25 100644 (file)
@@ -215,6 +215,28 @@ static void __init csb300_add_device_buttons(void)
 static void __init csb300_add_device_buttons(void) {}
 #endif
 
+static struct gpio_led csb_leds[] = {
+       {       /* "led0", yellow */
+               .name                   = "led0",
+               .gpio                   = AT91_PIN_PB2,
+               .active_low             = 1,
+               .default_trigger        = "heartbeat",
+       },
+       {       /* "led1", green */
+               .name                   = "led1",
+               .gpio                   = AT91_PIN_PB1,
+               .active_low             = 1,
+               .default_trigger        = "mmc0",
+       },
+       {       /* "led2", yellow */
+               .name                   = "led2",
+               .gpio                   = AT91_PIN_PB0,
+               .active_low             = 1,
+               .default_trigger        = "ide-disk",
+       },
+};
+
+
 static void __init csb337_board_init(void)
 {
        /* Serial */
@@ -236,6 +258,8 @@ static void __init csb337_board_init(void)
        at91_add_device_mmc(0, &csb337_mmc_data);
        /* NOR flash */
        platform_device_register(&csb_flash);
+       /* LEDs */
+       at91_gpio_leds(csb_leds, ARRAY_SIZE(csb_leds));
        /* Switches on CSB300 */
        csb300_add_device_buttons();
 }
index 40c9e4331706b0a32cac592603bfba036ccefa88..0a897efeba8e5321dc8fdfec5da831aa7a554f73 100644 (file)
@@ -183,6 +183,14 @@ static struct platform_device dk_flash = {
        .num_resources  = 1,
 };
 
+static struct gpio_led dk_leds[] = {
+       {
+               .name                   = "led0",
+               .gpio                   = AT91_PIN_PB2,
+               .active_low             = 1,
+               .default_trigger        = "heartbeat",
+       }
+};
 
 static void __init dk_board_init(void)
 {
@@ -213,6 +221,8 @@ static void __init dk_board_init(void)
        at91_add_device_nand(&dk_nand_data);
        /* NOR Flash */
        platform_device_register(&dk_flash);
+       /* LEDs */
+       at91_gpio_leds(dk_leds, ARRAY_SIZE(dk_leds));
        /* VGA */
 //     dk_add_device_video();
 }
index 53a5ef9e72eeec7844007282896002f0e0f8552e..0574e50a30dd096bbb5f012ac522895518b8a880 100644 (file)
@@ -141,6 +141,25 @@ static struct platform_device ek_flash = {
        .num_resources  = 1,
 };
 
+static struct gpio_led ek_leds[] = {
+       {       /* "user led 1", DS2 */
+               .name                   = "green",
+               .gpio                   = AT91_PIN_PB0,
+               .active_low             = 1,
+               .default_trigger        = "mmc0",
+       },
+       {       /* "user led 2", DS4 */
+               .name                   = "yellow",
+               .gpio                   = AT91_PIN_PB1,
+               .active_low             = 1,
+               .default_trigger        = "heartbeat",
+       },
+       {       /* "user led 3", DS6 */
+               .name                   = "red",
+               .gpio                   = AT91_PIN_PB2,
+               .active_low             = 1,
+       }
+};
 
 static void __init ek_board_init(void)
 {
@@ -167,6 +186,8 @@ static void __init ek_board_init(void)
 #endif
        /* NOR Flash */
        platform_device_register(&ek_flash);
+       /* LEDs */
+       at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
        /* VGA */
 //     ek_add_device_video();
 }
index a9dd59543ec77099e8d9fde7ca99b0eaac0077cc..2df0ff25d147dc047556709e827afb3030d1dc8e 100644 (file)
@@ -272,6 +272,30 @@ static struct atmel_ac97_data ek_ac97_data = {
 };
 
 
+/*
+ * LEDs ... these could all be PWM-driven, for variable brightness
+ */
+static struct gpio_led ek_leds[] = {
+       {       /* "left" led, green, userled1, pwm1 */
+               .name                   = "ds1",
+               .gpio                   = AT91_PIN_PB8,
+               .active_low             = 1,
+               .default_trigger        = "mmc0",
+       },
+       {       /* "right" led, green, userled2, pwm2 */
+               .name                   = "ds2",
+               .gpio                   = AT91_PIN_PC29,
+               .active_low             = 1,
+               .default_trigger        = "nand-disk",
+       },
+       {       /* "power" led, yellow, pwm0 */
+               .name                   = "ds3",
+               .gpio                   = AT91_PIN_PB7,
+               .default_trigger        = "heartbeat",
+       },
+};
+
+
 static void __init ek_board_init(void)
 {
        /* Serial */
@@ -297,6 +321,8 @@ static void __init ek_board_init(void)
        at91_add_device_lcdc(&ek_lcdc_data);
        /* AC97 */
        at91_add_device_ac97(&ek_ac97_data);
+       /* LEDs */
+       at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
 }
 
 MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")