1 Index: linux-2.6.22.19/arch/arm/mach-at91/Makefile
2 ===================================================================
3 --- linux-2.6.22.19.orig/arch/arm/mach-at91/Makefile
4 +++ linux-2.6.22.19/arch/arm/mach-at91/Makefile
5 @@ -53,7 +53,7 @@ led-$(CONFIG_MACH_CSB337) += leds.o
6 led-$(CONFIG_MACH_CSB637) += leds.o
7 led-$(CONFIG_MACH_KB9200) += leds.o
8 led-$(CONFIG_MACH_KAFA) += leds.o
9 -led-$(CONFIG_MACH_VLINK) += leds.o
10 +led-$(CONFIG_MACH_VLINK) += vlink_leds.o
11 obj-$(CONFIG_LEDS) += $(led-y)
14 Index: linux-2.6.22.19/arch/arm/mach-at91/vlink_leds.c
15 ===================================================================
17 +++ linux-2.6.22.19/arch/arm/mach-at91/vlink_leds.c
20 + * LED driver for Atmel AT91-based boards.
22 + * Copyright (C) SAN People (Pty) Ltd
23 + * Modified for FDL VersaLink Copyright (C) Guthrie Consulting
25 + * This program is free software; you can redistribute it and/or
26 + * modify it under the terms of the GNU General Public License
27 + * as published by the Free Software Foundation; either version
28 + * 2 of the License, or (at your option) any later version.
31 +#include <linux/kernel.h>
32 +#include <linux/module.h>
33 +#include <linux/init.h>
35 +#include <asm/mach-types.h>
36 +#include <asm/leds.h>
37 +#include <asm/arch/board.h>
38 +#include <asm/arch/gpio.h>
41 +static inline void at91_led_on(unsigned int led)
43 + at91_set_gpio_value(led, 0);
46 +static inline void at91_led_off(unsigned int led)
48 + at91_set_gpio_value(led, 1);
51 +static inline void at91_led_toggle(unsigned int led)
53 + unsigned long is_off = at91_get_gpio_value(led);
56 + at91_led_off(at91_leds_cpu);
59 + at91_led_on(at91_leds_cpu);
66 + * Handle LED events.
70 + * VersaLink has a single bi-coloured LED which changes colour when the
71 + * polarity is reversed
73 +static void at91_leds_event(led_event_t evt)
75 + unsigned long flags;
77 + local_irq_save(flags);
80 + case led_start: /* System startup */
81 + at91_led_toggle(at91_leds_timer);
84 + case led_stop: /* System stop / suspend */
85 + at91_led_toggle(at91_leds_timer);
88 +#ifdef CONFIG_LEDS_TIMER
89 + case led_timer: /* Every 50 timer ticks */
90 + at91_led_toggle(at91_leds_timer);
94 +#ifdef CONFIG_LEDS_CPU
95 + case led_idle_start: /* Entering idle state */
96 + at91_led_toggle(at91_leds_timer);
99 + case led_idle_end: /* Exit idle state */
100 + at91_led_toggle(at91_leds_timer);
108 + local_irq_restore(flags);
112 +static int __init leds_init(void)
114 + if (!at91_leds_timer || !at91_leds_cpu)
117 + leds_event = at91_leds_event;
119 + leds_event(led_start);
123 +__initcall(leds_init);