82303856bfb642f8a3eb354538105d2b3300edf0
[openwrt/openwrt.git] / target / linux / brcm47xx / patches-4.9 / 320-MIPS-BCM47XX-Devices-database-update-for-4.x.patch
1 --- a/arch/mips/bcm47xx/board.c
2 +++ b/arch/mips/bcm47xx/board.c
3 @@ -140,6 +140,7 @@ struct bcm47xx_board_type_list2 bcm47xx_
4 {{BCM47XX_BOARD_LINKSYS_WRT300NV11, "Linksys WRT300N V1.1"}, "WRT300N", "1.1"},
5 {{BCM47XX_BOARD_LINKSYS_WRT310NV1, "Linksys WRT310N V1"}, "WRT310N", "1.0"},
6 {{BCM47XX_BOARD_LINKSYS_WRT310NV2, "Linksys WRT310N V2"}, "WRT310N", "2.0"},
7 + {{BCM47XX_BOARD_LINKSYS_WRT320N_V1, "Linksys WRT320N V1"}, "WRT320N", "1.0"},
8 {{BCM47XX_BOARD_LINKSYS_WRT54G3GV2, "Linksys WRT54G3GV2-VF"}, "WRT54G3GV2-VF", "1.0"},
9 {{BCM47XX_BOARD_LINKSYS_WRT610NV1, "Linksys WRT610N V1"}, "WRT610N", "1.0"},
10 {{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
11 @@ -159,9 +160,12 @@ struct bcm47xx_board_type_list1 bcm47xx_
12 {{BCM47XX_BOARD_LUXUL_XVW_P30_V1, "Luxul XVW-P30 V1"}, "luxul_xvwp30_v1"},
13 {{BCM47XX_BOARD_LUXUL_XWR_600_V1, "Luxul XWR-600 V1"}, "luxul_xwr600_v1"},
14 {{BCM47XX_BOARD_LUXUL_XWR_1750_V1, "Luxul XWR-1750 V1"}, "luxul_xwr1750_v1"},
15 + {{BCM47XX_BOARD_NETGEAR_R6300_V1, "Netgear R6300 V1"}, "U12H218T00_NETGEAR"},
16 {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"},
17 {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
18 {{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
19 + {{BCM47XX_BOARD_NETGEAR_WN2500RP_V1, "Netgear WN2500RP V1"}, "U12H197T00_NETGEAR"},
20 + {{BCM47XX_BOARD_NETGEAR_WN2500RP_V2, "Netgear WN2500RP V2"}, "U12H294T00_NETGEAR"},
21 {{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"},
22 {{BCM47XX_BOARD_NETGEAR_WNDR3400V1, "Netgear WNDR3400 V1"}, "U12H155T00_NETGEAR"},
23 {{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
24 @@ -171,6 +175,7 @@ struct bcm47xx_board_type_list1 bcm47xx_
25 {{BCM47XX_BOARD_NETGEAR_WNDR4000, "Netgear WNDR4000"}, "U12H181T00_NETGEAR"},
26 {{BCM47XX_BOARD_NETGEAR_WNDR4500V1, "Netgear WNDR4500 V1"}, "U12H189T00_NETGEAR"},
27 {{BCM47XX_BOARD_NETGEAR_WNDR4500V2, "Netgear WNDR4500 V2"}, "U12H224T00_NETGEAR"},
28 + {{BCM47XX_BOARD_NETGEAR_WNR1000_V3, "Netgear WNR1000 V3"}, "U12H139T50_NETGEAR"},
29 {{BCM47XX_BOARD_NETGEAR_WNR2000, "Netgear WNR2000"}, "U12H114T00_NETGEAR"},
30 {{BCM47XX_BOARD_NETGEAR_WNR3500L, "Netgear WNR3500L"}, "U12H136T99_NETGEAR"},
31 {{BCM47XX_BOARD_NETGEAR_WNR3500U, "Netgear WNR3500U"}, "U12H136T00_NETGEAR"},
32 --- a/arch/mips/bcm47xx/buttons.c
33 +++ b/arch/mips/bcm47xx/buttons.c
34 @@ -26,6 +26,12 @@
35 /* Asus */
36
37 static const struct gpio_keys_button
38 +bcm47xx_buttons_asus_rtn10u[] __initconst = {
39 + BCM47XX_GPIO_KEY(20, KEY_WPS_BUTTON),
40 + BCM47XX_GPIO_KEY(21, KEY_RESTART),
41 +};
42 +
43 +static const struct gpio_keys_button
44 bcm47xx_buttons_asus_rtn12[] __initconst = {
45 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
46 BCM47XX_GPIO_KEY(1, KEY_RESTART),
47 @@ -276,6 +282,18 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
48 };
49
50 static const struct gpio_keys_button
51 +bcm47xx_buttons_linksys_wrt310n_v2[] __initconst = {
52 + BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
53 + BCM47XX_GPIO_KEY(6, KEY_RESTART),
54 +};
55 +
56 +static const struct gpio_keys_button
57 +bcm47xx_buttons_linksys_wrt320n_v1[] __initconst = {
58 + BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
59 + BCM47XX_GPIO_KEY(8, KEY_RESTART),
60 +};
61 +
62 +static const struct gpio_keys_button
63 bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
64 BCM47XX_GPIO_KEY(5, KEY_WIMAX),
65 BCM47XX_GPIO_KEY(6, KEY_RESTART),
66 @@ -384,6 +402,17 @@ bcm47xx_buttons_motorola_wr850gv2v3[] __
67 /* Netgear */
68
69 static const struct gpio_keys_button
70 +bcm47xx_buttons_netgear_r6300_v1[] __initconst = {
71 + BCM47XX_GPIO_KEY(6, KEY_RESTART),
72 +};
73 +
74 +static const struct gpio_keys_button
75 +bcm47xx_buttons_netgear_wn2500rp_v1[] __initconst = {
76 + BCM47XX_GPIO_KEY(12, KEY_RESTART),
77 + BCM47XX_GPIO_KEY(31, KEY_WPS_BUTTON),
78 +};
79 +
80 +static const struct gpio_keys_button
81 bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
82 BCM47XX_GPIO_KEY(4, KEY_RESTART),
83 BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
84 @@ -411,6 +440,11 @@ bcm47xx_buttons_netgear_wndr4500v1[] __i
85 };
86
87 static const struct gpio_keys_button
88 +bcm47xx_buttons_netgear_wnr1000_v3[] __initconst = {
89 + BCM47XX_GPIO_KEY(3, KEY_RESTART),
90 +};
91 +
92 +static const struct gpio_keys_button
93 bcm47xx_buttons_netgear_wnr3500lv1[] __initconst = {
94 BCM47XX_GPIO_KEY(4, KEY_RESTART),
95 BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
96 @@ -464,6 +498,9 @@ int __init bcm47xx_buttons_register(void
97 int err;
98
99 switch (board) {
100 + case BCM47XX_BOARD_ASUS_RTN10U:
101 + err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn10u);
102 + break;
103 case BCM47XX_BOARD_ASUS_RTN12:
104 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12);
105 break;
106 @@ -594,6 +631,12 @@ int __init bcm47xx_buttons_register(void
107 case BCM47XX_BOARD_LINKSYS_WRT310NV1:
108 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
109 break;
110 + case BCM47XX_BOARD_LINKSYS_WRT310NV2:
111 + err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
112 + break;
113 + case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
114 + err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
115 + break;
116 case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
117 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2);
118 break;
119 @@ -657,6 +700,12 @@ int __init bcm47xx_buttons_register(void
120 err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gv2v3);
121 break;
122
123 + case BCM47XX_BOARD_NETGEAR_R6300_V1:
124 + err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
125 + break;
126 + case BCM47XX_BOARD_NETGEAR_WN2500RP_V1:
127 + err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wn2500rp_v1);
128 + break;
129 case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
130 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1);
131 break;
132 @@ -669,6 +718,9 @@ int __init bcm47xx_buttons_register(void
133 case BCM47XX_BOARD_NETGEAR_WNDR4500V1:
134 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr4500v1);
135 break;
136 + case BCM47XX_BOARD_NETGEAR_WNR1000_V3:
137 + err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr1000_v3);
138 + break;
139 case BCM47XX_BOARD_NETGEAR_WNR3500L:
140 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1);
141 break;
142 --- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
143 +++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
144 @@ -71,6 +71,7 @@ enum bcm47xx_board {
145 BCM47XX_BOARD_LINKSYS_WRT300NV11,
146 BCM47XX_BOARD_LINKSYS_WRT310NV1,
147 BCM47XX_BOARD_LINKSYS_WRT310NV2,
148 + BCM47XX_BOARD_LINKSYS_WRT320N_V1,
149 BCM47XX_BOARD_LINKSYS_WRT54G3GV2,
150 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101,
151 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467,
152 @@ -97,9 +98,12 @@ enum bcm47xx_board {
153 BCM47XX_BOARD_MOTOROLA_WR850GP,
154 BCM47XX_BOARD_MOTOROLA_WR850GV2V3,
155
156 + BCM47XX_BOARD_NETGEAR_R6300_V1,
157 BCM47XX_BOARD_NETGEAR_WGR614V8,
158 BCM47XX_BOARD_NETGEAR_WGR614V9,
159 BCM47XX_BOARD_NETGEAR_WGR614_V10,
160 + BCM47XX_BOARD_NETGEAR_WN2500RP_V1,
161 + BCM47XX_BOARD_NETGEAR_WN2500RP_V2,
162 BCM47XX_BOARD_NETGEAR_WNDR3300,
163 BCM47XX_BOARD_NETGEAR_WNDR3400V1,
164 BCM47XX_BOARD_NETGEAR_WNDR3400V2,
165 @@ -109,6 +113,7 @@ enum bcm47xx_board {
166 BCM47XX_BOARD_NETGEAR_WNDR4000,
167 BCM47XX_BOARD_NETGEAR_WNDR4500V1,
168 BCM47XX_BOARD_NETGEAR_WNDR4500V2,
169 + BCM47XX_BOARD_NETGEAR_WNR1000_V3,
170 BCM47XX_BOARD_NETGEAR_WNR2000,
171 BCM47XX_BOARD_NETGEAR_WNR3500L,
172 BCM47XX_BOARD_NETGEAR_WNR3500U,
173 --- a/arch/mips/bcm47xx/leds.c
174 +++ b/arch/mips/bcm47xx/leds.c
175 @@ -29,6 +29,14 @@
176 /* Asus */
177
178 static const struct gpio_led
179 +bcm47xx_leds_asus_rtn10u[] __initconst = {
180 + BCM47XX_GPIO_LED(5, "green", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
181 + BCM47XX_GPIO_LED(6, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
182 + BCM47XX_GPIO_LED(7, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
183 + BCM47XX_GPIO_LED(8, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
184 +};
185 +
186 +static const struct gpio_led
187 bcm47xx_leds_asus_rtn12[] __initconst = {
188 BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
189 BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
190 @@ -313,6 +321,13 @@ bcm47xx_leds_linksys_wrt310nv1[] __initc
191 };
192
193 static const struct gpio_led
194 +bcm47xx_leds_linksys_wrt320n_v1[] __initconst = {
195 + BCM47XX_GPIO_LED(1, "blue", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
196 + BCM47XX_GPIO_LED(2, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON),
197 + BCM47XX_GPIO_LED(4, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
198 +};
199 +
200 +static const struct gpio_led
201 bcm47xx_leds_linksys_wrt54g_generic[] __initconst = {
202 BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
203 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
204 @@ -532,6 +547,9 @@ void __init bcm47xx_leds_register(void)
205 enum bcm47xx_board board = bcm47xx_board_get();
206
207 switch (board) {
208 + case BCM47XX_BOARD_ASUS_RTN10U:
209 + bcm47xx_set_pdata(bcm47xx_leds_asus_rtn10u);
210 + break;
211 case BCM47XX_BOARD_ASUS_RTN12:
212 bcm47xx_set_pdata(bcm47xx_leds_asus_rtn12);
213 break;
214 @@ -665,6 +683,9 @@ void __init bcm47xx_leds_register(void)
215 case BCM47XX_BOARD_LINKSYS_WRT310NV1:
216 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1);
217 break;
218 + case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
219 + bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt320n_v1);
220 + break;
221 case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
222 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2);
223 break;