1 diff -urN linux-2.6.21.1.orig/arch/arm/mach-at91/board-vlink.c linux-2.6.21.1/arch/arm/mach-at91/board-vlink.c
2 --- linux-2.6.21.1.orig/arch/arm/mach-at91/board-vlink.c 2007-05-28 13:33:41.000000000 +0200
3 +++ linux-2.6.21.1/arch/arm/mach-at91/board-vlink.c 2007-05-28 14:43:28.000000000 +0200
5 at91rm9200_initialize(18432000, AT91RM9200_PQFP);
8 -// at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
9 + at91_init_leds(AT91_PIN_PC14, AT91_PIN_PC15);
11 /* Setup the serial ports and console */
12 at91_init_serial(&vlink_uart_config);
18 static struct at91_udc_data __initdata vlink_udc_data = {
19 .vbus_pin = AT91_PIN_PD4,
20 .pullup_pin = AT91_PIN_PD5,
24 static struct at91_mmc_data __initdata vlink_mmc_data = {
25 // .det_pin = AT91_PIN_PB27,
30 -static struct at91_gpio_led vlink_leds[] = {
31 +/*static struct at91_gpio_led vlink_leds[] = {
34 - .gpio = AT91_PIN_PB1,
35 + .gpio = AT91_PIN_PC14,
36 .trigger = "heartbeat",
40 - .gpio = AT91_PIN_PB2,
41 + .gpio = AT91_PIN_PC15,
47 static void __init vlink_board_init(void)
51 at91_add_device_usbh(&vlink_usbh_data);
53 - at91_add_device_udc(&vlink_udc_data);
54 - at91_set_multi_drive(vlink_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
55 +// at91_add_device_udc(&vlink_udc_data);
56 +// at91_set_multi_drive(vlink_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
58 at91_add_device_i2c();
61 at91_add_device_mmc(0, &vlink_mmc_data);
64 - at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
65 +// at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
68 MACHINE_START(VLINK, "FDL VersaLink")
69 diff -urN linux-2.6.21.1.orig/arch/arm/mach-at91/Makefile linux-2.6.21.1/arch/arm/mach-at91/Makefile
70 --- linux-2.6.21.1.orig/arch/arm/mach-at91/Makefile 2007-05-28 13:13:15.000000000 +0200
71 +++ linux-2.6.21.1/arch/arm/mach-at91/Makefile 2007-05-28 14:19:06.000000000 +0200
73 led-$(CONFIG_MACH_CSB637) += leds.o
74 led-$(CONFIG_MACH_KB9200) += leds.o
75 led-$(CONFIG_MACH_KAFA) += leds.o
76 -led-$(CONFIG_MACH_VLINK) += leds.o
77 +led-$(CONFIG_MACH_VLINK) += vlink_leds.o
78 obj-$(CONFIG_LEDS) += $(led-y)
81 diff -urN linux-2.6.21.1.orig/arch/arm/mach-at91/vlink_leds.c linux-2.6.21.1/arch/arm/mach-at91/vlink_leds.c
82 --- linux-2.6.21.1.orig/arch/arm/mach-at91/vlink_leds.c 1970-01-01 01:00:00.000000000 +0100
83 +++ linux-2.6.21.1/arch/arm/mach-at91/vlink_leds.c 2007-05-28 14:41:03.000000000 +0200
86 + * LED driver for Atmel AT91-based boards.
88 + * Copyright (C) SAN People (Pty) Ltd
89 + * Modified for FDL VersaLink Copyright (C) Guthrie Consulting
91 + * This program is free software; you can redistribute it and/or
92 + * modify it under the terms of the GNU General Public License
93 + * as published by the Free Software Foundation; either version
94 + * 2 of the License, or (at your option) any later version.
97 +#include <linux/kernel.h>
98 +#include <linux/module.h>
99 +#include <linux/init.h>
101 +#include <asm/mach-types.h>
102 +#include <asm/leds.h>
103 +#include <asm/arch/board.h>
104 +#include <asm/arch/gpio.h>
107 +static inline void at91_led_on(unsigned int led)
109 + at91_set_gpio_value(led, 0);
112 +static inline void at91_led_off(unsigned int led)
114 + at91_set_gpio_value(led, 1);
117 +static inline void at91_led_toggle(unsigned int led)
119 + unsigned long is_off = at91_get_gpio_value(led);
122 + at91_led_off(at91_leds_cpu);
125 + at91_led_on(at91_leds_cpu);
132 + * Handle LED events.
136 + * VersaLink has a single bi-coloured LED which changes colour when the
137 + * polarity is reversed
139 +static void at91_leds_event(led_event_t evt)
141 + unsigned long flags;
143 + local_irq_save(flags);
146 + case led_start: /* System startup */
147 + at91_led_toggle(at91_leds_timer);
150 + case led_stop: /* System stop / suspend */
151 + at91_led_toggle(at91_leds_timer);
154 +#ifdef CONFIG_LEDS_TIMER
155 + case led_timer: /* Every 50 timer ticks */
156 + at91_led_toggle(at91_leds_timer);
160 +#ifdef CONFIG_LEDS_CPU
161 + case led_idle_start: /* Entering idle state */
162 + at91_led_toggle(at91_leds_timer);
165 + case led_idle_end: /* Exit idle state */
166 + at91_led_toggle(at91_leds_timer);
174 + local_irq_restore(flags);
178 +static int __init leds_init(void)
180 + if (!at91_leds_timer || !at91_leds_cpu)
183 + leds_event = at91_leds_event;
185 + leds_event(led_start);
189 +__initcall(leds_init);