aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-01-02 07:37:56 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-01-24 16:39:51 -0500
commit3be972556fa14b5bffec0ff076a8f82dbe799f8e (patch)
tree36e1220f805e0473cf6e874b7030936233530a49 /arch/mips
parentef1e3e7a19bd498862eb36ef8730d1d4700891ea (diff)
MIPS: BCM47XX: Import buttons database from OpenWrt
This includes all devices from OpenWrt's "diag" that we support in arch code (we have entries for in enum bcm47xx_board). Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6301/
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/bcm47xx/buttons.c456
1 files changed, 456 insertions, 0 deletions
diff --git a/arch/mips/bcm47xx/buttons.c b/arch/mips/bcm47xx/buttons.c
index d93711bf41b0..13f8e4191bdc 100644
--- a/arch/mips/bcm47xx/buttons.c
+++ b/arch/mips/bcm47xx/buttons.c
@@ -11,6 +11,299 @@
11 * Database 11 * Database
12 **************************************************/ 12 **************************************************/
13 13
14#define BCM47XX_GPIO_KEY(_gpio, _code) \
15 { \
16 .code = _code, \
17 .gpio = _gpio, \
18 .active_low = 1, \
19 }
20
21/* Asus */
22
23static const struct gpio_keys_button
24bcm47xx_buttons_asus_rtn12[] __initconst = {
25 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
26 BCM47XX_GPIO_KEY(1, KEY_RESTART),
27 BCM47XX_GPIO_KEY(4, BTN_0), /* Router mode */
28 BCM47XX_GPIO_KEY(5, BTN_1), /* Repeater mode */
29 BCM47XX_GPIO_KEY(6, BTN_2), /* AP mode */
30};
31
32static const struct gpio_keys_button
33bcm47xx_buttons_asus_rtn16[] __initconst = {
34 BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
35 BCM47XX_GPIO_KEY(8, KEY_RESTART),
36};
37
38static const struct gpio_keys_button
39bcm47xx_buttons_asus_rtn66u[] __initconst = {
40 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
41 BCM47XX_GPIO_KEY(9, KEY_RESTART),
42};
43
44static const struct gpio_keys_button
45bcm47xx_buttons_asus_wl300g[] __initconst = {
46 BCM47XX_GPIO_KEY(6, KEY_RESTART),
47};
48
49static const struct gpio_keys_button
50bcm47xx_buttons_asus_wl320ge[] __initconst = {
51 BCM47XX_GPIO_KEY(6, KEY_RESTART),
52};
53
54static const struct gpio_keys_button
55bcm47xx_buttons_asus_wl330ge[] __initconst = {
56 BCM47XX_GPIO_KEY(2, KEY_RESTART),
57};
58
59static const struct gpio_keys_button
60bcm47xx_buttons_asus_wl500gd[] __initconst = {
61 BCM47XX_GPIO_KEY(6, KEY_RESTART),
62};
63
64static const struct gpio_keys_button
65bcm47xx_buttons_asus_wl500gpv1[] __initconst = {
66 BCM47XX_GPIO_KEY(0, KEY_RESTART),
67 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
68};
69
70static const struct gpio_keys_button
71bcm47xx_buttons_asus_wl500gpv2[] __initconst = {
72 BCM47XX_GPIO_KEY(2, KEY_RESTART),
73 BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON),
74};
75
76static const struct gpio_keys_button
77bcm47xx_buttons_asus_wl500w[] __initconst = {
78 BCM47XX_GPIO_KEY(6, KEY_RESTART),
79 BCM47XX_GPIO_KEY(7, KEY_WPS_BUTTON),
80};
81
82static const struct gpio_keys_button
83bcm47xx_buttons_asus_wl520gc[] __initconst = {
84 BCM47XX_GPIO_KEY(2, KEY_RESTART),
85 BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON),
86};
87
88static const struct gpio_keys_button
89bcm47xx_buttons_asus_wl520gu[] __initconst = {
90 BCM47XX_GPIO_KEY(2, KEY_RESTART),
91 BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON),
92};
93
94static const struct gpio_keys_button
95bcm47xx_buttons_asus_wl700ge[] __initconst = {
96 BCM47XX_GPIO_KEY(0, KEY_POWER), /* Hard disk power switch */
97 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), /* EZSetup */
98 BCM47XX_GPIO_KEY(6, KEY_COPY), /* Copy data from USB to internal disk */
99 BCM47XX_GPIO_KEY(7, KEY_RESTART), /* Hard reset */
100};
101
102static const struct gpio_keys_button
103bcm47xx_buttons_asus_wlhdd[] __initconst = {
104 BCM47XX_GPIO_KEY(6, KEY_RESTART),
105};
106
107/* Huawei */
108
109static const struct gpio_keys_button
110bcm47xx_buttons_huawei_e970[] __initconst = {
111 BCM47XX_GPIO_KEY(6, KEY_RESTART),
112};
113
114/* Belkin */
115
116static const struct gpio_keys_button
117bcm47xx_buttons_belkin_f7d4301[] __initconst = {
118 BCM47XX_GPIO_KEY(6, KEY_RESTART),
119 BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON),
120};
121
122/* Buffalo */
123
124static const struct gpio_keys_button
125bcm47xx_buttons_buffalo_whr2_a54g54[] __initconst = {
126 BCM47XX_GPIO_KEY(4, KEY_RESTART),
127};
128
129static const struct gpio_keys_button
130bcm47xx_buttons_buffalo_whr_g125[] __initconst = {
131 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
132 BCM47XX_GPIO_KEY(4, KEY_RESTART),
133 BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */
134};
135
136static const struct gpio_keys_button
137bcm47xx_buttons_buffalo_whr_g54s[] __initconst = {
138 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
139 BCM47XX_GPIO_KEY(4, KEY_RESTART),
140 BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */
141};
142
143static const struct gpio_keys_button
144bcm47xx_buttons_buffalo_whr_hp_g54[] __initconst = {
145 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
146 BCM47XX_GPIO_KEY(4, KEY_RESTART),
147 BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */
148};
149
150static const struct gpio_keys_button
151bcm47xx_buttons_buffalo_wzr_g300n[] __initconst = {
152 BCM47XX_GPIO_KEY(4, KEY_RESTART),
153};
154
155static const struct gpio_keys_button
156bcm47xx_buttons_buffalo_wzr_rs_g54[] __initconst = {
157 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
158 BCM47XX_GPIO_KEY(4, KEY_RESTART),
159};
160
161static const struct gpio_keys_button
162bcm47xx_buttons_buffalo_wzr_rs_g54hp[] __initconst = {
163 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
164 BCM47XX_GPIO_KEY(4, KEY_RESTART),
165};
166
167/* Dell */
168
169static const struct gpio_keys_button
170bcm47xx_buttons_dell_tm2300[] __initconst = {
171 BCM47XX_GPIO_KEY(0, KEY_RESTART),
172};
173
174/* D-Link */
175
176static const struct gpio_keys_button
177bcm47xx_buttons_dlink_dir130[] __initconst = {
178 BCM47XX_GPIO_KEY(3, KEY_RESTART),
179 BCM47XX_GPIO_KEY(7, KEY_UNKNOWN),
180};
181
182static const struct gpio_keys_button
183bcm47xx_buttons_dlink_dir330[] __initconst = {
184 BCM47XX_GPIO_KEY(3, KEY_RESTART),
185 BCM47XX_GPIO_KEY(7, KEY_UNKNOWN),
186};
187
188/* Linksys */
189
190static const struct gpio_keys_button
191bcm47xx_buttons_linksys_e1000v1[] __initconst = {
192 BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
193 BCM47XX_GPIO_KEY(6, KEY_RESTART),
194};
195
196static const struct gpio_keys_button
197bcm47xx_buttons_linksys_e1000v21[] __initconst = {
198 BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON),
199 BCM47XX_GPIO_KEY(10, KEY_RESTART),
200};
201
202static const struct gpio_keys_button
203bcm47xx_buttons_linksys_e2000v1[] __initconst = {
204 BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
205 BCM47XX_GPIO_KEY(8, KEY_RESTART),
206};
207
208static const struct gpio_keys_button
209bcm47xx_buttons_linksys_e3000v1[] __initconst = {
210 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
211 BCM47XX_GPIO_KEY(6, KEY_RESTART),
212};
213
214static const struct gpio_keys_button
215bcm47xx_buttons_linksys_e3200v1[] __initconst = {
216 BCM47XX_GPIO_KEY(5, KEY_RESTART),
217 BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON),
218};
219
220static const struct gpio_keys_button
221bcm47xx_buttons_linksys_e4200v1[] __initconst = {
222 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
223 BCM47XX_GPIO_KEY(6, KEY_RESTART),
224};
225
226static const struct gpio_keys_button
227bcm47xx_buttons_linksys_wrt150nv1[] __initconst = {
228 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
229 BCM47XX_GPIO_KEY(6, KEY_RESTART),
230};
231
232static const struct gpio_keys_button
233bcm47xx_buttons_linksys_wrt150nv11[] __initconst = {
234 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
235 BCM47XX_GPIO_KEY(6, KEY_RESTART),
236};
237
238static const struct gpio_keys_button
239bcm47xx_buttons_linksys_wrt160nv1[] __initconst = {
240 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
241 BCM47XX_GPIO_KEY(6, KEY_RESTART),
242};
243
244static const struct gpio_keys_button
245bcm47xx_buttons_linksys_wrt160nv3[] __initconst = {
246 BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
247 BCM47XX_GPIO_KEY(6, KEY_RESTART),
248};
249
250static const struct gpio_keys_button
251bcm47xx_buttons_linksys_wrt300nv11[] __initconst = {
252 BCM47XX_GPIO_KEY(4, KEY_UNKNOWN),
253 BCM47XX_GPIO_KEY(6, KEY_RESTART),
254};
255
256static const struct gpio_keys_button
257bcm47xx_buttons_linksys_wrt310nv1[] __initconst = {
258 BCM47XX_GPIO_KEY(6, KEY_RESTART),
259 BCM47XX_GPIO_KEY(8, KEY_UNKNOWN),
260};
261
262static const struct gpio_keys_button
263bcm47xx_buttons_linksys_wrt610nv1[] __initconst = {
264 BCM47XX_GPIO_KEY(6, KEY_RESTART),
265 BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON),
266};
267
268static const struct gpio_keys_button
269bcm47xx_buttons_linksys_wrt610nv2[] __initconst = {
270 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
271 BCM47XX_GPIO_KEY(6, KEY_RESTART),
272};
273
274/* Motorola */
275
276static const struct gpio_keys_button
277bcm47xx_buttons_motorola_we800g[] __initconst = {
278 BCM47XX_GPIO_KEY(0, KEY_RESTART),
279};
280
281static const struct gpio_keys_button
282bcm47xx_buttons_motorola_wr850gp[] __initconst = {
283 BCM47XX_GPIO_KEY(5, KEY_RESTART),
284};
285
286static const struct gpio_keys_button
287bcm47xx_buttons_motorola_wr850gv2v3[] __initconst = {
288 BCM47XX_GPIO_KEY(5, KEY_RESTART),
289};
290
291/* Netgear */
292
293static const struct gpio_keys_button
294bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
295 BCM47XX_GPIO_KEY(4, KEY_RESTART),
296 BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
297 BCM47XX_GPIO_KEY(8, KEY_RFKILL),
298};
299
300static const struct gpio_keys_button
301bcm47xx_buttons_netgear_wndr3700v3[] __initconst = {
302 BCM47XX_GPIO_KEY(2, KEY_RFKILL),
303 BCM47XX_GPIO_KEY(3, KEY_RESTART),
304 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
305};
306
14static const struct gpio_keys_button 307static const struct gpio_keys_button
15bcm47xx_buttons_netgear_wndr4500_v1[] __initconst = { 308bcm47xx_buttons_netgear_wndr4500_v1[] __initconst = {
16 { 309 {
@@ -30,6 +323,18 @@ bcm47xx_buttons_netgear_wndr4500_v1[] __initconst = {
30 }, 323 },
31}; 324};
32 325
326static const struct gpio_keys_button
327bcm47xx_buttons_netgear_wnr834bv2[] __initconst = {
328 BCM47XX_GPIO_KEY(6, KEY_RESTART),
329};
330
331/* SimpleTech */
332
333static const struct gpio_keys_button
334bcm47xx_buttons_simpletech_simpleshare[] __initconst = {
335 BCM47XX_GPIO_KEY(0, KEY_RESTART),
336};
337
33/************************************************** 338/**************************************************
34 * Init 339 * Init
35 **************************************************/ 340 **************************************************/
@@ -74,9 +379,160 @@ int __init bcm47xx_buttons_register(void)
74#endif 379#endif
75 380
76 switch (board) { 381 switch (board) {
382 case BCM47XX_BOARD_ASUS_RTN12:
383 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12);
384 break;
385 case BCM47XX_BOARD_ASUS_RTN16:
386 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn16);
387 break;
388 case BCM47XX_BOARD_ASUS_RTN66U:
389 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn66u);
390 break;
391 case BCM47XX_BOARD_ASUS_WL300G:
392 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl300g);
393 break;
394 case BCM47XX_BOARD_ASUS_WL320GE:
395 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl320ge);
396 break;
397 case BCM47XX_BOARD_ASUS_WL330GE:
398 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl330ge);
399 break;
400 case BCM47XX_BOARD_ASUS_WL500GD:
401 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gd);
402 break;
403 case BCM47XX_BOARD_ASUS_WL500GPV1:
404 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gpv1);
405 break;
406 case BCM47XX_BOARD_ASUS_WL500GPV2:
407 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gpv2);
408 break;
409 case BCM47XX_BOARD_ASUS_WL500W:
410 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500w);
411 break;
412 case BCM47XX_BOARD_ASUS_WL520GC:
413 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl520gc);
414 break;
415 case BCM47XX_BOARD_ASUS_WL520GU:
416 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl520gu);
417 break;
418 case BCM47XX_BOARD_ASUS_WL700GE:
419 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl700ge);
420 break;
421 case BCM47XX_BOARD_ASUS_WLHDD:
422 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wlhdd);
423 break;
424
425 case BCM47XX_BOARD_BELKIN_F7D4301:
426 err = bcm47xx_copy_bdata(bcm47xx_buttons_belkin_f7d4301);
427 break;
428
429 case BCM47XX_BOARD_BUFFALO_WHR2_A54G54:
430 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr2_a54g54);
431 break;
432 case BCM47XX_BOARD_BUFFALO_WHR_G125:
433 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_g125);
434 break;
435 case BCM47XX_BOARD_BUFFALO_WHR_G54S:
436 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_g54s);
437 break;
438 case BCM47XX_BOARD_BUFFALO_WHR_HP_G54:
439 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_hp_g54);
440 break;
441 case BCM47XX_BOARD_BUFFALO_WZR_G300N:
442 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_g300n);
443 break;
444 case BCM47XX_BOARD_BUFFALO_WZR_RS_G54:
445 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54);
446 break;
447 case BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP:
448 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54hp);
449 break;
450
451 case BCM47XX_BOARD_DELL_TM2300:
452 err = bcm47xx_copy_bdata(bcm47xx_buttons_dell_tm2300);
453 break;
454
455 case BCM47XX_BOARD_DLINK_DIR130:
456 err = bcm47xx_copy_bdata(bcm47xx_buttons_dlink_dir130);
457 break;
458 case BCM47XX_BOARD_DLINK_DIR330:
459 err = bcm47xx_copy_bdata(bcm47xx_buttons_dlink_dir330);
460 break;
461
462 case BCM47XX_BOARD_HUAWEI_E970:
463 err = bcm47xx_copy_bdata(bcm47xx_buttons_huawei_e970);
464 break;
465
466 case BCM47XX_BOARD_LINKSYS_E1000V1:
467 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e1000v1);
468 break;
469 case BCM47XX_BOARD_LINKSYS_E1000V21:
470 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e1000v21);
471 break;
472 case BCM47XX_BOARD_LINKSYS_E2000V1:
473 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1);
474 break;
475 case BCM47XX_BOARD_LINKSYS_E3000V1:
476 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1);
477 break;
478 case BCM47XX_BOARD_LINKSYS_E3200V1:
479 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3200v1);
480 break;
481 case BCM47XX_BOARD_LINKSYS_E4200V1:
482 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e4200v1);
483 break;
484 case BCM47XX_BOARD_LINKSYS_WRT150NV1:
485 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt150nv1);
486 break;
487 case BCM47XX_BOARD_LINKSYS_WRT150NV11:
488 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt150nv11);
489 break;
490 case BCM47XX_BOARD_LINKSYS_WRT160NV1:
491 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt160nv1);
492 break;
493 case BCM47XX_BOARD_LINKSYS_WRT160NV3:
494 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt160nv3);
495 break;
496 case BCM47XX_BOARD_LINKSYS_WRT300NV11:
497 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt300nv11);
498 break;
499 case BCM47XX_BOARD_LINKSYS_WRT310NV1:
500 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
501 break;
502 case BCM47XX_BOARD_LINKSYS_WRT610NV1:
503 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv1);
504 break;
505 case BCM47XX_BOARD_LINKSYS_WRT610NV2:
506 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv2);
507 break;
508
509 case BCM47XX_BOARD_MOTOROLA_WE800G:
510 err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_we800g);
511 break;
512 case BCM47XX_BOARD_MOTOROLA_WR850GP:
513 err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gp);
514 break;
515 case BCM47XX_BOARD_MOTOROLA_WR850GV2V3:
516 err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gv2v3);
517 break;
518
519 case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
520 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1);
521 break;
522 case BCM47XX_BOARD_NETGEAR_WNDR3700V3:
523 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3700v3);
524 break;
77 case BCM47XX_BOARD_NETGEAR_WNDR4500V1: 525 case BCM47XX_BOARD_NETGEAR_WNDR4500V1:
78 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr4500_v1); 526 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr4500_v1);
79 break; 527 break;
528 case BCM47XX_BOARD_NETGEAR_WNR834BV2:
529 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr834bv2);
530 break;
531
532 case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE:
533 err = bcm47xx_copy_bdata(bcm47xx_buttons_simpletech_simpleshare);
534 break;
535
80 default: 536 default:
81 pr_debug("No buttons configuration found for this device\n"); 537 pr_debug("No buttons configuration found for this device\n");
82 return -ENOTSUPP; 538 return -ENOTSUPP;