1 diff -urN linux-2.6.19.2.old/arch/arm/mach-at91rm9200/Makefile linux-2.6.19.2/arch/arm/mach-at91rm9200/Makefile
2 --- linux-2.6.19.2.old/arch/arm/mach-at91rm9200/Makefile 2007-03-06 11:29:37.000000000 +0100
3 +++ linux-2.6.19.2/arch/arm/mach-at91rm9200/Makefile 2007-03-06 20:52:28.000000000 +0100
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) += vlink_leds.o
9 obj-$(CONFIG_LEDS) += $(led-y)
12 diff -urN linux-2.6.19.2.old/arch/arm/mach-at91rm9200/vlink_leds.c linux-2.6.19.2/arch/arm/mach-at91rm9200/vlink_leds.c
13 --- linux-2.6.19.2.old/arch/arm/mach-at91rm9200/vlink_leds.c 1970-01-01 01:00:00.000000000 +0100
14 +++ linux-2.6.19.2/arch/arm/mach-at91rm9200/vlink_leds.c 2007-03-06 21:11:16.000000000 +0100
17 + * LED driver for Atmel AT91-based boards.
19 + * Copyright (C) SAN People (Pty) Ltd
21 + * Modified for FDL Versalink board (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>
43 +static inline void at91_led_on(unsigned int led)
45 + at91_set_gpio_value(led, 0);
48 +static inline void at91_led_off(unsigned int led)
50 + at91_set_gpio_value(led, 1);
53 +static inline void at91_led_toggle(unsigned int led)
55 + unsigned long is_off = at91_get_gpio_value(AT91_PIN_PC7);
57 + at91_set_gpio_value(AT91_PIN_PC7, 0);
58 + at91_set_gpio_value(AT91_PIN_PC8, 1);
60 + at91_set_gpio_value(AT91_PIN_PC7, 1);
61 + at91_set_gpio_value(AT91_PIN_PC8, 0);
67 + * Handle LED events.
69 +static void at91_leds_event(led_event_t evt)
71 + unsigned long flags;
73 + local_irq_save(flags);
76 + case led_start: /* System startup */
77 +// at91_led_on(at91_leds_cpu);
78 + at91_led_toggle(at91_leds_timer);
80 + at91_set_gpio_value(AT91_PIN_PC7, 0);
81 + at91_set_gpio_value(AT91_PIN_PC8, 1);
85 + case led_stop: /* System stop / suspend */
86 + at91_led_toggle(at91_leds_timer);
88 + at91_set_gpio_value(AT91_PIN_PC7, 1);
89 + at91_set_gpio_value(AT91_PIN_PC8, 0);
93 +#ifdef CONFIG_LEDS_TIMER
94 + case led_timer: /* Every 50 timer ticks */
95 + at91_led_toggle(at91_leds_timer);
99 +#ifdef CONFIG_LEDS_CPU
100 + case led_idle_start: /* Entering idle state */
101 + at91_led_toggle(at91_leds_timer);
103 + at91_set_gpio_value(AT91_PIN_PC7, 1);
104 + at91_set_gpio_value(AT91_PIN_PC8, 0);
108 + case led_idle_end: /* Exit idle state */
109 + at91_led_toggle(at91_leds_timer);
111 + at91_set_gpio_value(AT91_PIN_PC7, 0);
112 + at91_set_gpio_value(AT91_PIN_PC8, 1);
121 + local_irq_restore(flags);
125 +static int __init leds_init(void)
127 +/* if (!at91_leds_timer || !at91_leds_cpu)
130 +// printk("leds_init()\n");
132 + /* Enable PIO to access the LEDs */
133 + at91_set_gpio_output(AT91_PIN_PC7, 1);
134 + at91_set_gpio_output(AT91_PIN_PC8, 1);
135 + at91_set_gpio_output(AT91_PIN_PC14, 1);
136 + at91_set_gpio_output(AT91_PIN_PC15, 1);
137 + at91_set_gpio_output(AT91_PIN_PB14, 1);
138 + at91_set_gpio_output(AT91_PIN_PB15, 1);
139 + at91_set_gpio_output(AT91_PIN_PB16, 1);
140 + at91_set_gpio_output(AT91_PIN_PB17, 1);
142 + at91_set_gpio_output(AT91_PIN_PB9, 1);
143 + at91_set_gpio_output(AT91_PIN_PB10, 1);
144 + at91_set_gpio_output(AT91_PIN_PB11, 1);
145 + at91_set_gpio_output(AT91_PIN_PB12, 1);
147 + at91_set_gpio_input(AT91_PIN_PB8, 1);
148 + at91_set_gpio_input(AT91_PIN_PB22, 1);
149 + at91_set_gpio_input(AT91_PIN_PA19, 1);
150 + at91_set_gpio_input(AT91_PIN_PA24, 1);
151 + at91_set_gpio_output(AT91_PIN_PA29, 1);
152 + at91_set_gpio_output(AT91_PIN_PB2, 1);
153 + at91_set_gpio_output(AT91_PIN_PB3, 1);
154 + at91_set_gpio_output(AT91_PIN_PB4, 1);
156 + at91_set_gpio_input(AT91_PIN_PB27, 1);
157 + at91_set_gpio_input(AT91_PIN_PB28, 1);
158 + at91_set_gpio_input(AT91_PIN_PB29, 1);
160 + leds_event = at91_leds_event;
162 + leds_event(led_start);
166 +__initcall(leds_init);