aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 14:34:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 14:34:20 -0400
commit3ddab4788d4980b1b3dc324fdd105adab3812418 (patch)
tree91b25590723d2a81ecd4d42753412cb8c4897bf0 /arch/arm
parentd1e0fe252e1c410164127b3000613afeaf47e49f (diff)
parenta7cca8aec9d08231207503e4823e7b47bfa7e596 (diff)
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds: leds: Add mx31moboard MC13783 led support leds: Add mc13783 LED support leds: leds-ss4200: fix led_classdev_unregister twice in error handling leds: leds-lp3944: properly handle lp3944_configure fail in lp3944_probe leds: led-class: set permissions on max_brightness file to 0444 leds: leds-gpio: Change blink_set callback to be able to turn off blinking leds: Add LED driver for the Soekris net5501 board leds: 88pm860x - fix checking in probe function
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mx3/mach-mx31moboard.c45
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c22
2 files changed, 56 insertions, 11 deletions
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c
index 33a8d35498a..62b5e40165d 100644
--- a/arch/arm/mach-mx3/mach-mx31moboard.c
+++ b/arch/arm/mach-mx3/mach-mx31moboard.c
@@ -220,11 +220,54 @@ static struct mc13783_regulator_init_data moboard_regulators[] = {
220 }, 220 },
221}; 221};
222 222
223static struct mc13783_led_platform_data moboard_led[] = {
224 {
225 .id = MC13783_LED_R1,
226 .name = "coreboard-led-4:red",
227 .max_current = 2,
228 },
229 {
230 .id = MC13783_LED_G1,
231 .name = "coreboard-led-4:green",
232 .max_current = 2,
233 },
234 {
235 .id = MC13783_LED_B1,
236 .name = "coreboard-led-4:blue",
237 .max_current = 2,
238 },
239 {
240 .id = MC13783_LED_R2,
241 .name = "coreboard-led-5:red",
242 .max_current = 3,
243 },
244 {
245 .id = MC13783_LED_G2,
246 .name = "coreboard-led-5:green",
247 .max_current = 3,
248 },
249 {
250 .id = MC13783_LED_B2,
251 .name = "coreboard-led-5:blue",
252 .max_current = 3,
253 },
254};
255
256static struct mc13783_leds_platform_data moboard_leds = {
257 .num_leds = ARRAY_SIZE(moboard_led),
258 .led = moboard_led,
259 .flags = MC13783_LED_SLEWLIMTC,
260 .abmode = MC13783_LED_AB_DISABLED,
261 .tc1_period = MC13783_LED_PERIOD_10MS,
262 .tc2_period = MC13783_LED_PERIOD_10MS,
263};
264
223static struct mc13783_platform_data moboard_pmic = { 265static struct mc13783_platform_data moboard_pmic = {
224 .regulators = moboard_regulators, 266 .regulators = moboard_regulators,
225 .num_regulators = ARRAY_SIZE(moboard_regulators), 267 .num_regulators = ARRAY_SIZE(moboard_regulators),
268 .leds = &moboard_leds,
226 .flags = MC13783_USE_REGULATOR | MC13783_USE_RTC | 269 .flags = MC13783_USE_REGULATOR | MC13783_USE_RTC |
227 MC13783_USE_ADC, 270 MC13783_USE_ADC | MC13783_USE_LED,
228}; 271};
229 272
230static struct spi_board_info moboard_spi_board_info[] __initdata = { 273static struct spi_board_info moboard_spi_board_info[] __initdata = {
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 685f34a9634..fe0de1698ed 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -240,22 +240,23 @@ error_fail:
240 240
241#define ORION_BLINK_HALF_PERIOD 100 /* ms */ 241#define ORION_BLINK_HALF_PERIOD 100 /* ms */
242 242
243static int dns323_gpio_blink_set(unsigned gpio, 243static int dns323_gpio_blink_set(unsigned gpio, int state,
244 unsigned long *delay_on, unsigned long *delay_off) 244 unsigned long *delay_on, unsigned long *delay_off)
245{ 245{
246 static int value = 0;
247 246
248 if (!*delay_on && !*delay_off) 247 if (delay_on && delay_off && !*delay_on && !*delay_off)
249 *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD; 248 *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
250 249
251 if (ORION_BLINK_HALF_PERIOD == *delay_on 250 switch(state) {
252 && ORION_BLINK_HALF_PERIOD == *delay_off) { 251 case GPIO_LED_NO_BLINK_LOW:
253 value = !value; 252 case GPIO_LED_NO_BLINK_HIGH:
254 orion_gpio_set_blink(gpio, value); 253 orion_gpio_set_blink(gpio, 0);
255 return 0; 254 gpio_set_value(gpio, state);
255 break;
256 case GPIO_LED_BLINK:
257 orion_gpio_set_blink(gpio, 1);
256 } 258 }
257 259 return 0;
258 return -EINVAL;
259} 260}
260 261
261static struct gpio_led dns323_leds[] = { 262static struct gpio_led dns323_leds[] = {
@@ -263,6 +264,7 @@ static struct gpio_led dns323_leds[] = {
263 .name = "power:blue", 264 .name = "power:blue",
264 .gpio = DNS323_GPIO_LED_POWER2, 265 .gpio = DNS323_GPIO_LED_POWER2,
265 .default_trigger = "timer", 266 .default_trigger = "timer",
267 .active_low = 1,
266 }, { 268 }, {
267 .name = "right:amber", 269 .name = "right:amber",
268 .gpio = DNS323_GPIO_LED_RIGHT_AMBER, 270 .gpio = DNS323_GPIO_LED_RIGHT_AMBER,