1 diff -urN linux-2.6.22.1.old/arch/arm/mach-at91/Makefile linux-2.6.22.1/arch/arm/mach-at91/Makefile
2 --- linux-2.6.22.1.old/arch/arm/mach-at91/Makefile 2007-07-29 06:46:13.000000000 +0200
3 +++ linux-2.6.22.1/arch/arm/mach-at91/Makefile 2007-07-29 06:54:19.000000000 +0200
5 led-$(CONFIG_MACH_CSB637) += leds.o
6 led-$(CONFIG_MACH_KB9200) += leds.o
7 led-$(CONFIG_MACH_KAFA) += leds.o
8 -led-$(CONFIG_MACH_VLINK) += leds.o
9 +led-$(CONFIG_MACH_VLINK) += vlink_leds.o
10 obj-$(CONFIG_LEDS) += $(led-y)
13 diff -urN linux-2.6.22.1.old/arch/arm/mach-at91/vlink_leds.c linux-2.6.22.1/arch/arm/mach-at91/vlink_leds.c
14 --- linux-2.6.22.1.old/arch/arm/mach-at91/vlink_leds.c 1970-01-01 01:00:00.000000000 +0100
15 +++ linux-2.6.22.1/arch/arm/mach-at91/vlink_leds.c 2007-07-29 06:54:58.000000000 +0200
18 + * LED driver for Atmel AT91-based boards.
20 + * Copyright (C) SAN People (Pty) Ltd
21 + * Modified for FDL VersaLink Copyright (C) Guthrie Consulting
23 + * This program is free software; you can redistribute it and/or
24 + * modify it under the terms of the GNU General Public License
25 + * as published by the Free Software Foundation; either version
26 + * 2 of the License, or (at your option) any later version.
29 +#include <linux/kernel.h>
30 +#include <linux/module.h>
31 +#include <linux/init.h>
33 +#include <asm/mach-types.h>
34 +#include <asm/leds.h>
35 +#include <asm/arch/board.h>
36 +#include <asm/arch/gpio.h>
39 +static inline void at91_led_on(unsigned int led)
41 + at91_set_gpio_value(led, 0);
44 +static inline void at91_led_off(unsigned int led)
46 + at91_set_gpio_value(led, 1);
49 +static inline void at91_led_toggle(unsigned int led)
51 + unsigned long is_off = at91_get_gpio_value(led);
54 + at91_led_off(at91_leds_cpu);
57 + at91_led_on(at91_leds_cpu);
64 + * Handle LED events.
68 + * VersaLink has a single bi-coloured LED which changes colour when the
69 + * polarity is reversed
71 +static void at91_leds_event(led_event_t evt)
73 + unsigned long flags;
75 + local_irq_save(flags);
78 + case led_start: /* System startup */
79 + at91_led_toggle(at91_leds_timer);
82 + case led_stop: /* System stop / suspend */
83 + at91_led_toggle(at91_leds_timer);
86 +#ifdef CONFIG_LEDS_TIMER
87 + case led_timer: /* Every 50 timer ticks */
88 + at91_led_toggle(at91_leds_timer);
92 +#ifdef CONFIG_LEDS_CPU
93 + case led_idle_start: /* Entering idle state */
94 + at91_led_toggle(at91_leds_timer);
97 + case led_idle_end: /* Exit idle state */
98 + at91_led_toggle(at91_leds_timer);
106 + local_irq_restore(flags);
110 +static int __init leds_init(void)
112 + if (!at91_leds_timer || !at91_leds_cpu)
115 + leds_event = at91_leds_event;
117 + leds_event(led_start);
121 +__initcall(leds_init);