diff options
author | Andrew Victor <linux@maxim.org.za> | 2008-09-21 16:31:16 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-21 17:58:38 -0400 |
commit | a7307bf22557e1e029df0ea6f2a2973de4d9c135 (patch) | |
tree | c1db7709cc089b3494ed6a0e97ca0dd5dbeece88 /arch/arm/mach-at91/board-sam9263ek.c | |
parent | bb1ad68b96a68e577a87ad62fe1aa26d052a52b5 (diff) |
[ARM] 5259/2: [AT91] PWM LEDs on AT91SAM9263-EK
Use the PWM controller and leds-atmel-pwm.c driver to drive a LED on
the Atmel AT91SAM9263-EK board.
Signed-off-by: Sedji Gaouaou <sedji.gaouaou@atmel.com>
Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91/board-sam9263ek.c')
-rw-r--r-- | arch/arm/mach-at91/board-sam9263ek.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index ad71f4a71451..2924b6884fe2 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/fb.h> | 30 | #include <linux/fb.h> |
31 | #include <linux/gpio_keys.h> | 31 | #include <linux/gpio_keys.h> |
32 | #include <linux/input.h> | 32 | #include <linux/input.h> |
33 | #include <linux/leds.h> | ||
33 | 34 | ||
34 | #include <video/atmel_lcdc.h> | 35 | #include <video/atmel_lcdc.h> |
35 | 36 | ||
@@ -339,25 +340,32 @@ static struct atmel_ac97_data ek_ac97_data = { | |||
339 | * LEDs ... these could all be PWM-driven, for variable brightness | 340 | * LEDs ... these could all be PWM-driven, for variable brightness |
340 | */ | 341 | */ |
341 | static struct gpio_led ek_leds[] = { | 342 | static struct gpio_led ek_leds[] = { |
342 | { /* "left" led, green, userled1, pwm1 */ | 343 | { /* "right" led, green, userled2 (could be driven by pwm2) */ |
343 | .name = "ds1", | ||
344 | .gpio = AT91_PIN_PB8, | ||
345 | .active_low = 1, | ||
346 | .default_trigger = "mmc0", | ||
347 | }, | ||
348 | { /* "right" led, green, userled2, pwm2 */ | ||
349 | .name = "ds2", | 344 | .name = "ds2", |
350 | .gpio = AT91_PIN_PC29, | 345 | .gpio = AT91_PIN_PC29, |
351 | .active_low = 1, | 346 | .active_low = 1, |
352 | .default_trigger = "nand-disk", | 347 | .default_trigger = "nand-disk", |
353 | }, | 348 | }, |
354 | { /* "power" led, yellow, pwm0 */ | 349 | { /* "power" led, yellow (could be driven by pwm0) */ |
355 | .name = "ds3", | 350 | .name = "ds3", |
356 | .gpio = AT91_PIN_PB7, | 351 | .gpio = AT91_PIN_PB7, |
357 | .default_trigger = "heartbeat", | 352 | .default_trigger = "heartbeat", |
358 | } | 353 | } |
359 | }; | 354 | }; |
360 | 355 | ||
356 | /* | ||
357 | * PWM Leds | ||
358 | */ | ||
359 | static struct gpio_led ek_pwm_led[] = { | ||
360 | /* For now only DS1 is PWM-driven (by pwm1) */ | ||
361 | { | ||
362 | .name = "ds1", | ||
363 | .gpio = 1, /* is PWM channel number */ | ||
364 | .active_low = 1, | ||
365 | .default_trigger = "none", | ||
366 | } | ||
367 | }; | ||
368 | |||
361 | 369 | ||
362 | static void __init ek_board_init(void) | 370 | static void __init ek_board_init(void) |
363 | { | 371 | { |
@@ -388,6 +396,7 @@ static void __init ek_board_init(void) | |||
388 | at91_add_device_ac97(&ek_ac97_data); | 396 | at91_add_device_ac97(&ek_ac97_data); |
389 | /* LEDs */ | 397 | /* LEDs */ |
390 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | 398 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); |
399 | at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led)); | ||
391 | } | 400 | } |
392 | 401 | ||
393 | MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") | 402 | MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") |