1 Index: linux-2.6.25.4/arch/arm/mach-ixp4xx/avila-setup.c
2 ===================================================================
3 --- linux-2.6.25.4.orig/arch/arm/mach-ixp4xx/avila-setup.c
4 +++ linux-2.6.25.4/arch/arm/mach-ixp4xx/avila-setup.c
6 # include <linux/eeprom.h>
9 +#include <linux/leds.h>
10 #include <linux/i2c-gpio.h>
12 #include <asm/types.h>
13 @@ -172,6 +173,72 @@ static struct platform_device avila_npec
14 .dev.platform_data = &avila_npec_data,
17 +static struct gpio_led avila_gpio_leds[] = {
19 + .name = "user", /* green led */
20 + .gpio = AVILA_GW23XX_LED_USER_GPIO,
25 +static struct gpio_led_platform_data avila_gpio_leds_data = {
27 + .leds = avila_gpio_leds,
30 +static struct platform_device avila_gpio_leds_device = {
31 + .name = "leds-gpio",
33 + .dev.platform_data = &avila_gpio_leds_data,
36 +static struct latch_led avila_latch_leds[] = {
38 + .name = "led0", /* green led */
42 + .name = "led1", /* green led */
46 + .name = "led2", /* green led */
50 + .name = "led3", /* green led */
54 + .name = "led4", /* green led */
58 + .name = "led5", /* green led */
62 + .name = "led6", /* green led */
66 + .name = "led7", /* green led */
71 +static struct latch_led_platform_data avila_latch_leds_data = {
73 + .leds = avila_latch_leds,
77 +static struct platform_device avila_latch_leds_device = {
78 + .name = "leds-latch",
80 + .dev.platform_data = &avila_latch_leds_data,
83 static struct platform_device *avila_devices[] __initdata = {
86 @@ -182,6 +249,8 @@ static void __init avila_gw23xx_setup(vo
88 platform_device_register(&avila_npeb_device);
89 platform_device_register(&avila_npec_device);
91 + platform_device_register(&avila_gpio_leds_device);
94 #ifdef CONFIG_SENSORS_EEPROM
95 @@ -189,6 +258,8 @@ static void __init avila_gw2342_setup(vo
97 platform_device_register(&avila_npeb_device);
98 platform_device_register(&avila_npec_device);
100 + platform_device_register(&avila_gpio_leds_device);
103 static void __init avila_gw2345_setup(void)
104 @@ -199,22 +270,30 @@ static void __init avila_gw2345_setup(vo
106 avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */
107 platform_device_register(&avila_npec_device);
109 + platform_device_register(&avila_gpio_leds_device);
112 static void __init avila_gw2347_setup(void)
114 platform_device_register(&avila_npeb_device);
116 + avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
117 + platform_device_register(&avila_gpio_leds_device);
120 static void __init avila_gw2348_setup(void)
122 platform_device_register(&avila_npeb_device);
123 platform_device_register(&avila_npec_device);
125 + platform_device_register(&avila_gpio_leds_device);
128 static void __init avila_gw2353_setup(void)
130 platform_device_register(&avila_npeb_device);
131 + platform_device_register(&avila_gpio_leds_device);
134 static void __init avila_gw2355_setup(void)
135 @@ -225,11 +304,29 @@ static void __init avila_gw2355_setup(vo
137 avila_npec_data.phy = 16;
138 platform_device_register(&avila_npec_device);
140 + platform_device_register(&avila_gpio_leds_device);
142 + *IXP4XX_EXP_CS4 |= 0xbfff3c03;
143 + avila_latch_leds[0].name = "RXD";
144 + avila_latch_leds[1].name = "TXD";
145 + avila_latch_leds[2].name = "POL";
146 + avila_latch_leds[3].name = "LNK";
147 + avila_latch_leds[4].name = "ERR";
148 + avila_latch_leds_data.num_leds = 5;
149 + avila_latch_leds_data.mem = 0x54000000;
150 + platform_device_register(&avila_latch_leds_device);
153 static void __init avila_gw2357_setup(void)
155 platform_device_register(&avila_npeb_device);
157 + avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
158 + platform_device_register(&avila_gpio_leds_device);
160 + *IXP4XX_EXP_CS1 |= 0xbfff3c03;
161 + platform_device_register(&avila_latch_leds_device);
164 static struct avila_board_info avila_boards[] __initdata = {
165 Index: linux-2.6.25.4/include/asm-arm/arch-ixp4xx/avila.h
166 ===================================================================
167 --- linux-2.6.25.4.orig/include/asm-arm/arch-ixp4xx/avila.h
168 +++ linux-2.6.25.4/include/asm-arm/arch-ixp4xx/avila.h
170 #define AVILA_PCI_INTC_PIN 9
171 #define AVILA_PCI_INTD_PIN 8
175 +#define AVILA_GW23XX_LED_USER_GPIO 3
176 +#define AVILA_GW23X7_LED_USER_GPIO 4