1 Index: linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
2 ===================================================================
3 --- linux-2.6.21.7.orig/arch/arm/mach-at91/board-vlink.c
4 +++ linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
5 @@ -61,7 +61,7 @@ static void __init vlink_map_io(void)
6 at91rm9200_initialize(18432000, AT91RM9200_PQFP);
9 -// at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
10 + at91_init_leds(AT91_PIN_PC14, AT91_PIN_PC15);
12 /* Setup the serial ports and console */
13 at91_init_serial(&vlink_uart_config);
14 @@ -81,10 +81,12 @@ static struct at91_usbh_data __initdata
19 static struct at91_udc_data __initdata vlink_udc_data = {
20 .vbus_pin = AT91_PIN_PD4,
21 .pullup_pin = AT91_PIN_PD5,
25 static struct at91_mmc_data __initdata vlink_mmc_data = {
26 // .det_pin = AT91_PIN_PB27,
27 @@ -108,18 +110,19 @@ static struct spi_board_info vlink_spi_d
31 -static struct at91_gpio_led vlink_leds[] = {
32 +/*static struct at91_gpio_led vlink_leds[] = {
35 - .gpio = AT91_PIN_PB1,
36 + .gpio = AT91_PIN_PC14,
37 .trigger = "heartbeat",
41 - .gpio = AT91_PIN_PB2,
42 + .gpio = AT91_PIN_PC15,
48 static void __init vlink_board_init(void)
50 @@ -130,8 +133,8 @@ static void __init vlink_board_init(void
52 at91_add_device_usbh(&vlink_usbh_data);
54 - at91_add_device_udc(&vlink_udc_data);
55 - at91_set_multi_drive(vlink_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
56 +// at91_add_device_udc(&vlink_udc_data);
57 +// at91_set_multi_drive(vlink_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
59 at91_add_device_i2c();
61 @@ -145,7 +148,7 @@ static void __init vlink_board_init(void
62 at91_add_device_mmc(0, &vlink_mmc_data);
65 - at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
66 +// at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
69 MACHINE_START(VLINK, "FDL VersaLink")
70 Index: linux-2.6.21.7/arch/arm/mach-at91/Makefile
71 ===================================================================
72 --- linux-2.6.21.7.orig/arch/arm/mach-at91/Makefile
73 +++ linux-2.6.21.7/arch/arm/mach-at91/Makefile
74 @@ -52,7 +52,7 @@ led-$(CONFIG_MACH_CSB337) += leds.o
75 led-$(CONFIG_MACH_CSB637) += leds.o
76 led-$(CONFIG_MACH_KB9200) += leds.o
77 led-$(CONFIG_MACH_KAFA) += leds.o
78 -led-$(CONFIG_MACH_VLINK) += leds.o
79 +led-$(CONFIG_MACH_VLINK) += vlink_leds.o
80 obj-$(CONFIG_LEDS) += $(led-y)
83 Index: linux-2.6.21.7/arch/arm/mach-at91/vlink_leds.c
84 ===================================================================
86 +++ linux-2.6.21.7/arch/arm/mach-at91/vlink_leds.c
89 + * LED driver for Atmel AT91-based boards.
91 + * Copyright (C) SAN People (Pty) Ltd
92 + * Modified for FDL VersaLink Copyright (C) Guthrie Consulting
94 + * This program is free software; you can redistribute it and/or
95 + * modify it under the terms of the GNU General Public License
96 + * as published by the Free Software Foundation; either version
97 + * 2 of the License, or (at your option) any later version.
100 +#include <linux/kernel.h>
101 +#include <linux/module.h>
102 +#include <linux/init.h>
104 +#include <asm/mach-types.h>
105 +#include <asm/leds.h>
106 +#include <asm/arch/board.h>
107 +#include <asm/arch/gpio.h>
110 +static inline void at91_led_on(unsigned int led)
112 + at91_set_gpio_value(led, 0);
115 +static inline void at91_led_off(unsigned int led)
117 + at91_set_gpio_value(led, 1);
120 +static inline void at91_led_toggle(unsigned int led)
122 + unsigned long is_off = at91_get_gpio_value(led);
125 + at91_led_off(at91_leds_cpu);
128 + at91_led_on(at91_leds_cpu);
135 + * Handle LED events.
139 + * VersaLink has a single bi-coloured LED which changes colour when the
140 + * polarity is reversed
142 +static void at91_leds_event(led_event_t evt)
144 + unsigned long flags;
146 + local_irq_save(flags);
149 + case led_start: /* System startup */
150 + at91_led_toggle(at91_leds_timer);
153 + case led_stop: /* System stop / suspend */
154 + at91_led_toggle(at91_leds_timer);
157 +#ifdef CONFIG_LEDS_TIMER
158 + case led_timer: /* Every 50 timer ticks */
159 + at91_led_toggle(at91_leds_timer);
163 +#ifdef CONFIG_LEDS_CPU
164 + case led_idle_start: /* Entering idle state */
165 + at91_led_toggle(at91_leds_timer);
168 + case led_idle_end: /* Exit idle state */
169 + at91_led_toggle(at91_leds_timer);
177 + local_irq_restore(flags);
181 +static int __init leds_init(void)
183 + if (!at91_leds_timer || !at91_leds_cpu)
186 + leds_event = at91_leds_event;
188 + leds_event(led_start);
192 +__initcall(leds_init);