2 * LED driver for Atmel AT91-based boards.
4 * Copyright (C) SAN People (Pty) Ltd
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/gpio.h>
13 #include <linux/kernel.h>
14 #include <linux/module.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
22 /* ------------------------------------------------------------------------- */
24 #if defined(CONFIG_NEW_LEDS)
27 * New cross-platform LED support.
30 static struct gpio_led_platform_data led_data;
32 static struct platform_device at91_gpio_leds_device = {
35 .dev.platform_data = &led_data,
38 void __init at91_gpio_leds(struct gpio_led *leds, int nr)
45 for (i = 0; i < nr; i++)
46 at91_set_gpio_output(leds[i].gpio, leds[i].active_low);
49 led_data.num_leds = nr;
50 platform_device_register(&at91_gpio_leds_device);
54 void __init at91_gpio_leds(struct gpio_led *leds, int nr) {}
58 /* ------------------------------------------------------------------------- */
60 #if defined (CONFIG_LEDS_ATMEL_PWM)
66 static struct gpio_led_platform_data pwm_led_data;
68 static struct platform_device at91_pwm_leds_device = {
69 .name = "leds-atmel-pwm",
71 .dev.platform_data = &pwm_led_data,
74 void __init at91_pwm_leds(struct gpio_led *leds, int nr)
82 for (i = 0; i < nr; i++)
83 pwm_mask |= (1 << leds[i].gpio);
85 pwm_led_data.leds = leds;
86 pwm_led_data.num_leds = nr;
88 at91_add_device_pwm(pwm_mask);
89 platform_device_register(&at91_pwm_leds_device);
92 void __init at91_pwm_leds(struct gpio_led *leds, int nr){}