brcm47xx: backport upstream patches for Netgear WNR1000 V3
[openwrt/openwrt.git] / target / linux / brcm47xx / patches-4.14 / 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 @@ -141,6 +141,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 @@ -160,9 +161,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 --- a/arch/mips/bcm47xx/buttons.c
25 +++ b/arch/mips/bcm47xx/buttons.c
26 @@ -27,6 +27,12 @@
27 /* Asus */
28
29 static const struct gpio_keys_button
30 +bcm47xx_buttons_asus_rtn10u[] __initconst = {
31 + BCM47XX_GPIO_KEY(20, KEY_WPS_BUTTON),
32 + BCM47XX_GPIO_KEY(21, KEY_RESTART),
33 +};
34 +
35 +static const struct gpio_keys_button
36 bcm47xx_buttons_asus_rtn12[] __initconst = {
37 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
38 BCM47XX_GPIO_KEY(1, KEY_RESTART),
39 @@ -277,6 +283,18 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
40 };
41
42 static const struct gpio_keys_button
43 +bcm47xx_buttons_linksys_wrt310n_v2[] __initconst = {
44 + BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
45 + BCM47XX_GPIO_KEY(6, KEY_RESTART),
46 +};
47 +
48 +static const struct gpio_keys_button
49 +bcm47xx_buttons_linksys_wrt320n_v1[] __initconst = {
50 + BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
51 + BCM47XX_GPIO_KEY(8, KEY_RESTART),
52 +};
53 +
54 +static const struct gpio_keys_button
55 bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
56 BCM47XX_GPIO_KEY(5, KEY_WIMAX),
57 BCM47XX_GPIO_KEY(6, KEY_RESTART),
58 @@ -385,6 +403,17 @@ bcm47xx_buttons_motorola_wr850gv2v3[] __
59 /* Netgear */
60
61 static const struct gpio_keys_button
62 +bcm47xx_buttons_netgear_r6300_v1[] __initconst = {
63 + BCM47XX_GPIO_KEY(6, KEY_RESTART),
64 +};
65 +
66 +static const struct gpio_keys_button
67 +bcm47xx_buttons_netgear_wn2500rp_v1[] __initconst = {
68 + BCM47XX_GPIO_KEY(12, KEY_RESTART),
69 + BCM47XX_GPIO_KEY(31, KEY_WPS_BUTTON),
70 +};
71 +
72 +static const struct gpio_keys_button
73 bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
74 BCM47XX_GPIO_KEY(4, KEY_RESTART),
75 BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
76 @@ -471,6 +500,9 @@ int __init bcm47xx_buttons_register(void
77 int err;
78
79 switch (board) {
80 + case BCM47XX_BOARD_ASUS_RTN10U:
81 + err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn10u);
82 + break;
83 case BCM47XX_BOARD_ASUS_RTN12:
84 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12);
85 break;
86 @@ -601,6 +633,12 @@ int __init bcm47xx_buttons_register(void
87 case BCM47XX_BOARD_LINKSYS_WRT310NV1:
88 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
89 break;
90 + case BCM47XX_BOARD_LINKSYS_WRT310NV2:
91 + err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
92 + break;
93 + case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
94 + err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
95 + break;
96 case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
97 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2);
98 break;
99 @@ -664,6 +702,12 @@ int __init bcm47xx_buttons_register(void
100 err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gv2v3);
101 break;
102
103 + case BCM47XX_BOARD_NETGEAR_R6300_V1:
104 + err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
105 + break;
106 + case BCM47XX_BOARD_NETGEAR_WN2500RP_V1:
107 + err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wn2500rp_v1);
108 + break;
109 case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
110 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1);
111 break;
112 --- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
113 +++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
114 @@ -72,6 +72,7 @@ enum bcm47xx_board {
115 BCM47XX_BOARD_LINKSYS_WRT300NV11,
116 BCM47XX_BOARD_LINKSYS_WRT310NV1,
117 BCM47XX_BOARD_LINKSYS_WRT310NV2,
118 + BCM47XX_BOARD_LINKSYS_WRT320N_V1,
119 BCM47XX_BOARD_LINKSYS_WRT54G3GV2,
120 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101,
121 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467,
122 @@ -98,9 +99,12 @@ enum bcm47xx_board {
123 BCM47XX_BOARD_MOTOROLA_WR850GP,
124 BCM47XX_BOARD_MOTOROLA_WR850GV2V3,
125
126 + BCM47XX_BOARD_NETGEAR_R6300_V1,
127 BCM47XX_BOARD_NETGEAR_WGR614V8,
128 BCM47XX_BOARD_NETGEAR_WGR614V9,
129 BCM47XX_BOARD_NETGEAR_WGR614_V10,
130 + BCM47XX_BOARD_NETGEAR_WN2500RP_V1,
131 + BCM47XX_BOARD_NETGEAR_WN2500RP_V2,
132 BCM47XX_BOARD_NETGEAR_WNDR3300,
133 BCM47XX_BOARD_NETGEAR_WNDR3400V1,
134 BCM47XX_BOARD_NETGEAR_WNDR3400V2,
135 --- a/arch/mips/bcm47xx/leds.c
136 +++ b/arch/mips/bcm47xx/leds.c
137 @@ -30,6 +30,14 @@
138 /* Asus */
139
140 static const struct gpio_led
141 +bcm47xx_leds_asus_rtn10u[] __initconst = {
142 + BCM47XX_GPIO_LED(5, "green", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
143 + BCM47XX_GPIO_LED(6, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
144 + BCM47XX_GPIO_LED(7, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
145 + BCM47XX_GPIO_LED(8, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
146 +};
147 +
148 +static const struct gpio_led
149 bcm47xx_leds_asus_rtn12[] __initconst = {
150 BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
151 BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
152 @@ -314,6 +322,13 @@ bcm47xx_leds_linksys_wrt310nv1[] __initc
153 };
154
155 static const struct gpio_led
156 +bcm47xx_leds_linksys_wrt320n_v1[] __initconst = {
157 + BCM47XX_GPIO_LED(1, "blue", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
158 + BCM47XX_GPIO_LED(2, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON),
159 + BCM47XX_GPIO_LED(4, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
160 +};
161 +
162 +static const struct gpio_led
163 bcm47xx_leds_linksys_wrt54g_generic[] __initconst = {
164 BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
165 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
166 @@ -556,6 +571,9 @@ void __init bcm47xx_leds_register(void)
167 enum bcm47xx_board board = bcm47xx_board_get();
168
169 switch (board) {
170 + case BCM47XX_BOARD_ASUS_RTN10U:
171 + bcm47xx_set_pdata(bcm47xx_leds_asus_rtn10u);
172 + break;
173 case BCM47XX_BOARD_ASUS_RTN12:
174 bcm47xx_set_pdata(bcm47xx_leds_asus_rtn12);
175 break;
176 @@ -689,6 +707,9 @@ void __init bcm47xx_leds_register(void)
177 case BCM47XX_BOARD_LINKSYS_WRT310NV1:
178 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1);
179 break;
180 + case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
181 + bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt320n_v1);
182 + break;
183 case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
184 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2);
185 break;