1 --- a/arch/arm/mach-ixp4xx/avila-setup.c
2 +++ b/arch/arm/mach-ixp4xx/avila-setup.c
4 # include <linux/eeprom.h>
7 +#include <linux/leds.h>
8 #include <linux/i2c-gpio.h>
10 #include <asm/types.h>
11 @@ -172,6 +173,72 @@ static struct platform_device avila_npec
12 .dev.platform_data = &avila_npec_data,
15 +static struct gpio_led avila_gpio_leds[] = {
17 + .name = "user", /* green led */
18 + .gpio = AVILA_GW23XX_LED_USER_GPIO,
23 +static struct gpio_led_platform_data avila_gpio_leds_data = {
25 + .leds = avila_gpio_leds,
28 +static struct platform_device avila_gpio_leds_device = {
29 + .name = "leds-gpio",
31 + .dev.platform_data = &avila_gpio_leds_data,
34 +static struct latch_led avila_latch_leds[] = {
36 + .name = "led0", /* green led */
40 + .name = "led1", /* green led */
44 + .name = "led2", /* green led */
48 + .name = "led3", /* green led */
52 + .name = "led4", /* green led */
56 + .name = "led5", /* green led */
60 + .name = "led6", /* green led */
64 + .name = "led7", /* green led */
69 +static struct latch_led_platform_data avila_latch_leds_data = {
71 + .leds = avila_latch_leds,
75 +static struct platform_device avila_latch_leds_device = {
76 + .name = "leds-latch",
78 + .dev.platform_data = &avila_latch_leds_data,
81 static struct platform_device *avila_devices[] __initdata = {
84 @@ -182,6 +249,8 @@ static void __init avila_gw23xx_setup(vo
86 platform_device_register(&avila_npeb_device);
87 platform_device_register(&avila_npec_device);
89 + platform_device_register(&avila_gpio_leds_device);
92 #ifdef CONFIG_SENSORS_EEPROM
93 @@ -189,6 +258,8 @@ static void __init avila_gw2342_setup(vo
95 platform_device_register(&avila_npeb_device);
96 platform_device_register(&avila_npec_device);
98 + platform_device_register(&avila_gpio_leds_device);
101 static void __init avila_gw2345_setup(void)
102 @@ -199,22 +270,30 @@ static void __init avila_gw2345_setup(vo
104 avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */
105 platform_device_register(&avila_npec_device);
107 + platform_device_register(&avila_gpio_leds_device);
110 static void __init avila_gw2347_setup(void)
112 platform_device_register(&avila_npeb_device);
114 + avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
115 + platform_device_register(&avila_gpio_leds_device);
118 static void __init avila_gw2348_setup(void)
120 platform_device_register(&avila_npeb_device);
121 platform_device_register(&avila_npec_device);
123 + platform_device_register(&avila_gpio_leds_device);
126 static void __init avila_gw2353_setup(void)
128 platform_device_register(&avila_npeb_device);
129 + platform_device_register(&avila_gpio_leds_device);
132 static void __init avila_gw2355_setup(void)
133 @@ -225,11 +304,29 @@ static void __init avila_gw2355_setup(vo
135 avila_npec_data.phy = 16;
136 platform_device_register(&avila_npec_device);
138 + platform_device_register(&avila_gpio_leds_device);
140 + *IXP4XX_EXP_CS4 |= 0xbfff3c03;
141 + avila_latch_leds[0].name = "RXD";
142 + avila_latch_leds[1].name = "TXD";
143 + avila_latch_leds[2].name = "POL";
144 + avila_latch_leds[3].name = "LNK";
145 + avila_latch_leds[4].name = "ERR";
146 + avila_latch_leds_data.num_leds = 5;
147 + avila_latch_leds_data.mem = 0x54000000;
148 + platform_device_register(&avila_latch_leds_device);
151 static void __init avila_gw2357_setup(void)
153 platform_device_register(&avila_npeb_device);
155 + avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
156 + platform_device_register(&avila_gpio_leds_device);
158 + *IXP4XX_EXP_CS1 |= 0xbfff3c03;
159 + platform_device_register(&avila_latch_leds_device);
162 static struct avila_board_info avila_boards[] __initdata = {
163 --- a/arch/arm/mach-ixp4xx/include/mach/avila.h
164 +++ b/arch/arm/mach-ixp4xx/include/mach/avila.h
166 #define AVILA_PCI_INTC_PIN 9
167 #define AVILA_PCI_INTD_PIN 8
171 +#define AVILA_GW23XX_LED_USER_GPIO 3
172 +#define AVILA_GW23X7_LED_USER_GPIO 4