1 diff -urN linux-2.6.25.10.old/arch/arm/mach-at91/at91rm9200_devices.c linux-2.6.25.10/arch/arm/mach-at91/at91rm9200_devices.c
2 --- linux-2.6.25.10.old/arch/arm/mach-at91/at91rm9200_devices.c 2008-07-06 09:01:53.000000000 +0200
3 +++ linux-2.6.25.10/arch/arm/mach-at91/at91rm9200_devices.c 2008-07-06 09:47:54.000000000 +0200
5 static void __init at91_add_device_watchdog(void) {}
8 +/* --------------------------------------------------------------------
10 + * -------------------------------------------------------------------- */
12 +#if defined(CONFIG_LEDS)
16 +void __init at91_init_leds(u8 cpu_led, u8 timer_led)
18 + /* Enable GPIO to access the LEDs */
19 + at91_set_gpio_output(cpu_led, 1);
20 + at91_set_gpio_output(timer_led, 1);
22 + at91_leds_cpu = cpu_led;
23 + at91_leds_timer = timer_led;
26 +void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
29 /* --------------------------------------------------------------------
30 * SSC -- Synchronous Serial Controller
31 diff -urN linux-2.6.25.10.old/arch/arm/mach-at91/Makefile linux-2.6.25.10/arch/arm/mach-at91/Makefile
32 --- linux-2.6.25.10.old/arch/arm/mach-at91/Makefile 2008-07-06 09:01:54.000000000 +0200
33 +++ linux-2.6.25.10/arch/arm/mach-at91/Makefile 2008-07-06 09:45:08.000000000 +0200
35 obj-$(CONFIG_MACH_AT91EB01) += board-eb01.o
39 +ifeq ($(CONFIG_MACH_VLINK),y)
40 +led-$(CONFIG_MACH_VLINK) += vlink_leds.o
45 obj-$(CONFIG_FB_S1D13XXX) += ics1523.o
48 diff -urN linux-2.6.25.10.old/arch/arm/mach-at91/vlink_leds.c linux-2.6.25.10/arch/arm/mach-at91/vlink_leds.c
49 --- linux-2.6.25.10.old/arch/arm/mach-at91/vlink_leds.c 1970-01-01 01:00:00.000000000 +0100
50 +++ linux-2.6.25.10/arch/arm/mach-at91/vlink_leds.c 2008-07-06 09:40:37.000000000 +0200
53 + * LED driver for Atmel AT91-based boards.
55 + * Copyright (C) SAN People (Pty) Ltd
56 + * Modified for FDL VersaLink Copyright (C) Guthrie Consulting
58 + * This program is free software; you can redistribute it and/or
59 + * modify it under the terms of the GNU General Public License
60 + * as published by the Free Software Foundation; either version
61 + * 2 of the License, or (at your option) any later version.
64 +#include <linux/kernel.h>
65 +#include <linux/module.h>
66 +#include <linux/init.h>
68 +#include <asm/mach-types.h>
69 +#include <asm/leds.h>
70 +#include <asm/arch/board.h>
71 +#include <asm/arch/gpio.h>
74 +static inline void at91_led_on(unsigned int led)
76 + at91_set_gpio_value(led, 0);
79 +static inline void at91_led_off(unsigned int led)
81 + at91_set_gpio_value(led, 1);
84 +static inline void at91_led_toggle(unsigned int led)
86 + unsigned long is_off = at91_get_gpio_value(led);
89 + at91_led_off(at91_leds_cpu);
92 + at91_led_on(at91_leds_cpu);
99 + * Handle LED events.
103 + * VersaLink has a single bi-coloured LED which changes colour when the
104 + * polarity is reversed
106 +static void at91_leds_event(led_event_t evt)
108 + unsigned long flags;
110 + local_irq_save(flags);
113 + case led_start: /* System startup */
114 + at91_led_toggle(at91_leds_timer);
117 + case led_stop: /* System stop / suspend */
118 + at91_led_toggle(at91_leds_timer);
121 +#ifdef CONFIG_LEDS_TIMER
122 + case led_timer: /* Every 50 timer ticks */
123 + at91_led_toggle(at91_leds_timer);
127 +#ifdef CONFIG_LEDS_CPU
128 + case led_idle_start: /* Entering idle state */
129 + at91_led_toggle(at91_leds_timer);
132 + case led_idle_end: /* Exit idle state */
133 + at91_led_toggle(at91_leds_timer);
141 + local_irq_restore(flags);
145 +static int __init leds_init(void)
147 + if (!at91_leds_timer || !at91_leds_cpu)
150 + leds_event = at91_leds_event;
152 + leds_event(led_start);
156 +__initcall(leds_init);
157 diff -urN linux-2.6.25.10.old/include/asm-arm/arch-at91/board.h linux-2.6.25.10/include/asm-arm/arch-at91/board.h
158 --- linux-2.6.25.10.old/include/asm-arm/arch-at91/board.h 2008-07-06 09:01:54.000000000 +0200
159 +++ linux-2.6.25.10/include/asm-arm/arch-at91/board.h 2008-07-06 09:56:31.000000000 +0200
162 extern void __init at91_add_device_isi(void);
165 +extern u8 at91_leds_cpu;
166 +extern u8 at91_leds_timer;
167 +extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
169 /* Touchscreen Controller */
170 extern void __init at91_add_device_tsadcc(void);