add Avila/Cambria latch LED support, thanks Chris
[openwrt.git] / target / linux / ixp4xx / patches-2.6.24 / 301-avila_led.patch
1 Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/avila.h
2 ===================================================================
3 --- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/avila.h
4 +++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/avila.h
5 @@ -36,4 +36,6 @@
6 #define AVILA_PCI_INTC_PIN 9
7 #define AVILA_PCI_INTD_PIN 8
8
9 -
10 +/* User LEDs */
11 +#define AVILA_GW23XX_LED_USER_GPIO 3
12 +#define AVILA_GW23X7_LED_USER_GPIO 4
13 Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
14 ===================================================================
15 --- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/avila-setup.c
16 +++ linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
17 @@ -26,6 +26,7 @@
18 # include <linux/eeprom.h>
19 #endif
20
21 +#include <linux/leds.h>
22 #include <linux/i2c-gpio.h>
23
24 #include <asm/types.h>
25 @@ -172,6 +173,25 @@ static struct platform_device avila_npec
26 .dev.platform_data = &avila_npec_data,
27 };
28
29 +static struct gpio_led avila_leds[] = {
30 + {
31 + .name = "user", /* green led */
32 + .gpio = AVILA_GW23XX_LED_USER_GPIO,
33 + .active_low = 1,
34 + }
35 +};
36 +
37 +static struct gpio_led_platform_data avila_leds_data = {
38 + .num_leds = 1,
39 + .leds = avila_leds,
40 +};
41 +
42 +static struct platform_device avila_leds_device = {
43 + .name = "leds-gpio",
44 + .id = -1,
45 + .dev.platform_data = &avila_leds_data,
46 +};
47 +
48 static struct platform_device *avila_devices[] __initdata = {
49 &avila_i2c_gpio,
50 &avila_flash,
51 @@ -182,6 +202,8 @@ static void __init avila_gw23xx_setup(vo
52 {
53 platform_device_register(&avila_npeb_device);
54 platform_device_register(&avila_npec_device);
55 +
56 + platform_device_register(&avila_leds_device);
57 }
58
59 #ifdef CONFIG_SENSORS_EEPROM
60 @@ -189,6 +211,8 @@ static void __init avila_gw2342_setup(vo
61 {
62 platform_device_register(&avila_npeb_device);
63 platform_device_register(&avila_npec_device);
64 +
65 + platform_device_register(&avila_leds_device);
66 }
67
68 static void __init avila_gw2345_setup(void)
69 @@ -199,22 +223,30 @@ static void __init avila_gw2345_setup(vo
70
71 avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */
72 platform_device_register(&avila_npec_device);
73 +
74 + platform_device_register(&avila_leds_device);
75 }
76
77 static void __init avila_gw2347_setup(void)
78 {
79 platform_device_register(&avila_npeb_device);
80 +
81 + avila_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
82 + platform_device_register(&avila_leds_device);
83 }
84
85 static void __init avila_gw2348_setup(void)
86 {
87 platform_device_register(&avila_npeb_device);
88 platform_device_register(&avila_npec_device);
89 +
90 + platform_device_register(&avila_leds_device);
91 }
92
93 static void __init avila_gw2353_setup(void)
94 {
95 platform_device_register(&avila_npeb_device);
96 + platform_device_register(&avila_leds_device);
97 }
98
99 static void __init avila_gw2355_setup(void)
100 @@ -225,11 +257,16 @@ static void __init avila_gw2355_setup(vo
101
102 avila_npec_data.phy = 16;
103 platform_device_register(&avila_npec_device);
104 +
105 + platform_device_register(&avila_leds_device);
106 }
107
108 static void __init avila_gw2357_setup(void)
109 {
110 platform_device_register(&avila_npeb_device);
111 +
112 + avila_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
113 + platform_device_register(&avila_leds_device);
114 }
115
116 static struct avila_board_info avila_boards[] __initdata = {
This page took 0.055894 seconds and 5 git commands to generate.