Linux 3.15-rc1
[linux/fpc-iii.git] / arch / mips / bcm47xx / buttons.c
blob49a1ce06844ba7a68e864ba61ab39c6ffe0434ac
1 #include "bcm47xx_private.h"
3 #include <linux/input.h>
4 #include <linux/gpio_keys.h>
5 #include <linux/interrupt.h>
6 #include <bcm47xx_board.h>
7 #include <bcm47xx.h>
9 /**************************************************
10 * Database
11 **************************************************/
13 #define BCM47XX_GPIO_KEY(_gpio, _code) \
14 { \
15 .code = _code, \
16 .gpio = _gpio, \
17 .active_low = 1, \
20 /* Asus */
22 static const struct gpio_keys_button
23 bcm47xx_buttons_asus_rtn12[] __initconst = {
24 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
25 BCM47XX_GPIO_KEY(1, KEY_RESTART),
26 BCM47XX_GPIO_KEY(4, BTN_0), /* Router mode */
27 BCM47XX_GPIO_KEY(5, BTN_1), /* Repeater mode */
28 BCM47XX_GPIO_KEY(6, BTN_2), /* AP mode */
31 static const struct gpio_keys_button
32 bcm47xx_buttons_asus_rtn16[] __initconst = {
33 BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
34 BCM47XX_GPIO_KEY(8, KEY_RESTART),
37 static const struct gpio_keys_button
38 bcm47xx_buttons_asus_rtn66u[] __initconst = {
39 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
40 BCM47XX_GPIO_KEY(9, KEY_RESTART),
43 static const struct gpio_keys_button
44 bcm47xx_buttons_asus_wl300g[] __initconst = {
45 BCM47XX_GPIO_KEY(6, KEY_RESTART),
48 static const struct gpio_keys_button
49 bcm47xx_buttons_asus_wl320ge[] __initconst = {
50 BCM47XX_GPIO_KEY(6, KEY_RESTART),
53 static const struct gpio_keys_button
54 bcm47xx_buttons_asus_wl330ge[] __initconst = {
55 BCM47XX_GPIO_KEY(2, KEY_RESTART),
58 static const struct gpio_keys_button
59 bcm47xx_buttons_asus_wl500gd[] __initconst = {
60 BCM47XX_GPIO_KEY(6, KEY_RESTART),
63 static const struct gpio_keys_button
64 bcm47xx_buttons_asus_wl500gpv1[] __initconst = {
65 BCM47XX_GPIO_KEY(0, KEY_RESTART),
66 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
69 static const struct gpio_keys_button
70 bcm47xx_buttons_asus_wl500gpv2[] __initconst = {
71 BCM47XX_GPIO_KEY(2, KEY_RESTART),
72 BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON),
75 static const struct gpio_keys_button
76 bcm47xx_buttons_asus_wl500w[] __initconst = {
77 BCM47XX_GPIO_KEY(6, KEY_RESTART),
78 BCM47XX_GPIO_KEY(7, KEY_WPS_BUTTON),
81 static const struct gpio_keys_button
82 bcm47xx_buttons_asus_wl520gc[] __initconst = {
83 BCM47XX_GPIO_KEY(2, KEY_RESTART),
84 BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON),
87 static const struct gpio_keys_button
88 bcm47xx_buttons_asus_wl520gu[] __initconst = {
89 BCM47XX_GPIO_KEY(2, KEY_RESTART),
90 BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON),
93 static const struct gpio_keys_button
94 bcm47xx_buttons_asus_wl700ge[] __initconst = {
95 BCM47XX_GPIO_KEY(0, KEY_POWER), /* Hard disk power switch */
96 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), /* EZSetup */
97 BCM47XX_GPIO_KEY(6, KEY_COPY), /* Copy data from USB to internal disk */
98 BCM47XX_GPIO_KEY(7, KEY_RESTART), /* Hard reset */
101 static const struct gpio_keys_button
102 bcm47xx_buttons_asus_wlhdd[] __initconst = {
103 BCM47XX_GPIO_KEY(6, KEY_RESTART),
106 /* Huawei */
108 static const struct gpio_keys_button
109 bcm47xx_buttons_huawei_e970[] __initconst = {
110 BCM47XX_GPIO_KEY(6, KEY_RESTART),
113 /* Belkin */
115 static const struct gpio_keys_button
116 bcm47xx_buttons_belkin_f7d4301[] __initconst = {
117 BCM47XX_GPIO_KEY(6, KEY_RESTART),
118 BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON),
121 /* Buffalo */
123 static const struct gpio_keys_button
124 bcm47xx_buttons_buffalo_whr2_a54g54[] __initconst = {
125 BCM47XX_GPIO_KEY(4, KEY_RESTART),
128 static const struct gpio_keys_button
129 bcm47xx_buttons_buffalo_whr_g125[] __initconst = {
130 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
131 BCM47XX_GPIO_KEY(4, KEY_RESTART),
132 BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */
135 static const struct gpio_keys_button
136 bcm47xx_buttons_buffalo_whr_g54s[] __initconst = {
137 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
138 BCM47XX_GPIO_KEY(4, KEY_RESTART),
139 BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */
142 static const struct gpio_keys_button
143 bcm47xx_buttons_buffalo_whr_hp_g54[] __initconst = {
144 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
145 BCM47XX_GPIO_KEY(4, KEY_RESTART),
146 BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */
149 static const struct gpio_keys_button
150 bcm47xx_buttons_buffalo_wzr_g300n[] __initconst = {
151 BCM47XX_GPIO_KEY(4, KEY_RESTART),
154 static const struct gpio_keys_button
155 bcm47xx_buttons_buffalo_wzr_rs_g54[] __initconst = {
156 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
157 BCM47XX_GPIO_KEY(4, KEY_RESTART),
160 static const struct gpio_keys_button
161 bcm47xx_buttons_buffalo_wzr_rs_g54hp[] __initconst = {
162 BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
163 BCM47XX_GPIO_KEY(4, KEY_RESTART),
166 /* Dell */
168 static const struct gpio_keys_button
169 bcm47xx_buttons_dell_tm2300[] __initconst = {
170 BCM47XX_GPIO_KEY(0, KEY_RESTART),
173 /* D-Link */
175 static const struct gpio_keys_button
176 bcm47xx_buttons_dlink_dir130[] __initconst = {
177 BCM47XX_GPIO_KEY(3, KEY_RESTART),
178 BCM47XX_GPIO_KEY(7, KEY_UNKNOWN),
181 static const struct gpio_keys_button
182 bcm47xx_buttons_dlink_dir330[] __initconst = {
183 BCM47XX_GPIO_KEY(3, KEY_RESTART),
184 BCM47XX_GPIO_KEY(7, KEY_UNKNOWN),
187 /* Linksys */
189 static const struct gpio_keys_button
190 bcm47xx_buttons_linksys_e1000v1[] __initconst = {
191 BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
192 BCM47XX_GPIO_KEY(6, KEY_RESTART),
195 static const struct gpio_keys_button
196 bcm47xx_buttons_linksys_e1000v21[] __initconst = {
197 BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON),
198 BCM47XX_GPIO_KEY(10, KEY_RESTART),
201 static const struct gpio_keys_button
202 bcm47xx_buttons_linksys_e2000v1[] __initconst = {
203 BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
204 BCM47XX_GPIO_KEY(8, KEY_RESTART),
207 static const struct gpio_keys_button
208 bcm47xx_buttons_linksys_e3000v1[] __initconst = {
209 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
210 BCM47XX_GPIO_KEY(6, KEY_RESTART),
213 static const struct gpio_keys_button
214 bcm47xx_buttons_linksys_e3200v1[] __initconst = {
215 BCM47XX_GPIO_KEY(5, KEY_RESTART),
216 BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON),
219 static const struct gpio_keys_button
220 bcm47xx_buttons_linksys_e4200v1[] __initconst = {
221 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
222 BCM47XX_GPIO_KEY(6, KEY_RESTART),
225 static const struct gpio_keys_button
226 bcm47xx_buttons_linksys_wrt150nv1[] __initconst = {
227 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
228 BCM47XX_GPIO_KEY(6, KEY_RESTART),
231 static const struct gpio_keys_button
232 bcm47xx_buttons_linksys_wrt150nv11[] __initconst = {
233 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
234 BCM47XX_GPIO_KEY(6, KEY_RESTART),
237 static const struct gpio_keys_button
238 bcm47xx_buttons_linksys_wrt160nv1[] __initconst = {
239 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
240 BCM47XX_GPIO_KEY(6, KEY_RESTART),
243 static const struct gpio_keys_button
244 bcm47xx_buttons_linksys_wrt160nv3[] __initconst = {
245 BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
246 BCM47XX_GPIO_KEY(6, KEY_RESTART),
249 static const struct gpio_keys_button
250 bcm47xx_buttons_linksys_wrt300nv11[] __initconst = {
251 BCM47XX_GPIO_KEY(4, KEY_UNKNOWN),
252 BCM47XX_GPIO_KEY(6, KEY_RESTART),
255 static const struct gpio_keys_button
256 bcm47xx_buttons_linksys_wrt310nv1[] __initconst = {
257 BCM47XX_GPIO_KEY(6, KEY_RESTART),
258 BCM47XX_GPIO_KEY(8, KEY_UNKNOWN),
261 static const struct gpio_keys_button
262 bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
263 BCM47XX_GPIO_KEY(5, KEY_WIMAX),
264 BCM47XX_GPIO_KEY(6, KEY_RESTART),
267 static const struct gpio_keys_button
268 bcm47xx_buttons_linksys_wrt54gsv1[] __initconst = {
269 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
270 BCM47XX_GPIO_KEY(6, KEY_RESTART),
273 static const struct gpio_keys_button
274 bcm47xx_buttons_linksys_wrt610nv1[] __initconst = {
275 BCM47XX_GPIO_KEY(6, KEY_RESTART),
276 BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON),
279 static const struct gpio_keys_button
280 bcm47xx_buttons_linksys_wrt610nv2[] __initconst = {
281 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
282 BCM47XX_GPIO_KEY(6, KEY_RESTART),
285 static const struct gpio_keys_button
286 bcm47xx_buttons_linksys_wrtsl54gs[] __initconst = {
287 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
288 BCM47XX_GPIO_KEY(6, KEY_RESTART),
291 /* Motorola */
293 static const struct gpio_keys_button
294 bcm47xx_buttons_motorola_we800g[] __initconst = {
295 BCM47XX_GPIO_KEY(0, KEY_RESTART),
298 static const struct gpio_keys_button
299 bcm47xx_buttons_motorola_wr850gp[] __initconst = {
300 BCM47XX_GPIO_KEY(5, KEY_RESTART),
303 static const struct gpio_keys_button
304 bcm47xx_buttons_motorola_wr850gv2v3[] __initconst = {
305 BCM47XX_GPIO_KEY(5, KEY_RESTART),
308 /* Netgear */
310 static const struct gpio_keys_button
311 bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
312 BCM47XX_GPIO_KEY(4, KEY_RESTART),
313 BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
314 BCM47XX_GPIO_KEY(8, KEY_RFKILL),
317 static const struct gpio_keys_button
318 bcm47xx_buttons_netgear_wndr3700v3[] __initconst = {
319 BCM47XX_GPIO_KEY(2, KEY_RFKILL),
320 BCM47XX_GPIO_KEY(3, KEY_RESTART),
321 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
324 static const struct gpio_keys_button
325 bcm47xx_buttons_netgear_wndr4500v1[] __initconst = {
326 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
327 BCM47XX_GPIO_KEY(5, KEY_RFKILL),
328 BCM47XX_GPIO_KEY(6, KEY_RESTART),
331 static const struct gpio_keys_button
332 bcm47xx_buttons_netgear_wnr834bv2[] __initconst = {
333 BCM47XX_GPIO_KEY(6, KEY_RESTART),
336 /* SimpleTech */
338 static const struct gpio_keys_button
339 bcm47xx_buttons_simpletech_simpleshare[] __initconst = {
340 BCM47XX_GPIO_KEY(0, KEY_RESTART),
343 /**************************************************
344 * Init
345 **************************************************/
347 static struct gpio_keys_platform_data bcm47xx_button_pdata;
349 static struct platform_device bcm47xx_buttons_gpio_keys = {
350 .name = "gpio-keys",
351 .dev = {
352 .platform_data = &bcm47xx_button_pdata,
356 /* Copy data from __initconst */
357 static int __init bcm47xx_buttons_copy(const struct gpio_keys_button *buttons,
358 size_t nbuttons)
360 size_t size = nbuttons * sizeof(*buttons);
362 bcm47xx_button_pdata.buttons = kmalloc(size, GFP_KERNEL);
363 if (!bcm47xx_button_pdata.buttons)
364 return -ENOMEM;
365 memcpy(bcm47xx_button_pdata.buttons, buttons, size);
366 bcm47xx_button_pdata.nbuttons = nbuttons;
368 return 0;
371 #define bcm47xx_copy_bdata(dev_buttons) \
372 bcm47xx_buttons_copy(dev_buttons, ARRAY_SIZE(dev_buttons));
374 int __init bcm47xx_buttons_register(void)
376 enum bcm47xx_board board = bcm47xx_board_get();
377 int err;
379 switch (board) {
380 case BCM47XX_BOARD_ASUS_RTN12:
381 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12);
382 break;
383 case BCM47XX_BOARD_ASUS_RTN16:
384 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn16);
385 break;
386 case BCM47XX_BOARD_ASUS_RTN66U:
387 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn66u);
388 break;
389 case BCM47XX_BOARD_ASUS_WL300G:
390 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl300g);
391 break;
392 case BCM47XX_BOARD_ASUS_WL320GE:
393 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl320ge);
394 break;
395 case BCM47XX_BOARD_ASUS_WL330GE:
396 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl330ge);
397 break;
398 case BCM47XX_BOARD_ASUS_WL500GD:
399 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gd);
400 break;
401 case BCM47XX_BOARD_ASUS_WL500GPV1:
402 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gpv1);
403 break;
404 case BCM47XX_BOARD_ASUS_WL500GPV2:
405 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gpv2);
406 break;
407 case BCM47XX_BOARD_ASUS_WL500W:
408 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500w);
409 break;
410 case BCM47XX_BOARD_ASUS_WL520GC:
411 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl520gc);
412 break;
413 case BCM47XX_BOARD_ASUS_WL520GU:
414 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl520gu);
415 break;
416 case BCM47XX_BOARD_ASUS_WL700GE:
417 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl700ge);
418 break;
419 case BCM47XX_BOARD_ASUS_WLHDD:
420 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wlhdd);
421 break;
423 case BCM47XX_BOARD_BELKIN_F7D3301:
424 case BCM47XX_BOARD_BELKIN_F7D3302:
425 case BCM47XX_BOARD_BELKIN_F7D4301:
426 case BCM47XX_BOARD_BELKIN_F7D4302:
427 case BCM47XX_BOARD_BELKIN_F7D4401:
428 err = bcm47xx_copy_bdata(bcm47xx_buttons_belkin_f7d4301);
429 break;
431 case BCM47XX_BOARD_BUFFALO_WHR2_A54G54:
432 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr2_a54g54);
433 break;
434 case BCM47XX_BOARD_BUFFALO_WHR_G125:
435 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_g125);
436 break;
437 case BCM47XX_BOARD_BUFFALO_WHR_G54S:
438 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_g54s);
439 break;
440 case BCM47XX_BOARD_BUFFALO_WHR_HP_G54:
441 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_hp_g54);
442 break;
443 case BCM47XX_BOARD_BUFFALO_WZR_G300N:
444 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_g300n);
445 break;
446 case BCM47XX_BOARD_BUFFALO_WZR_RS_G54:
447 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54);
448 break;
449 case BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP:
450 err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54hp);
451 break;
453 case BCM47XX_BOARD_DELL_TM2300:
454 err = bcm47xx_copy_bdata(bcm47xx_buttons_dell_tm2300);
455 break;
457 case BCM47XX_BOARD_DLINK_DIR130:
458 err = bcm47xx_copy_bdata(bcm47xx_buttons_dlink_dir130);
459 break;
460 case BCM47XX_BOARD_DLINK_DIR330:
461 err = bcm47xx_copy_bdata(bcm47xx_buttons_dlink_dir330);
462 break;
464 case BCM47XX_BOARD_HUAWEI_E970:
465 err = bcm47xx_copy_bdata(bcm47xx_buttons_huawei_e970);
466 break;
468 case BCM47XX_BOARD_LINKSYS_E1000V1:
469 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e1000v1);
470 break;
471 case BCM47XX_BOARD_LINKSYS_E1000V21:
472 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e1000v21);
473 break;
474 case BCM47XX_BOARD_LINKSYS_E2000V1:
475 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1);
476 break;
477 case BCM47XX_BOARD_LINKSYS_E3000V1:
478 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1);
479 break;
480 case BCM47XX_BOARD_LINKSYS_E3200V1:
481 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3200v1);
482 break;
483 case BCM47XX_BOARD_LINKSYS_E4200V1:
484 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e4200v1);
485 break;
486 case BCM47XX_BOARD_LINKSYS_WRT150NV1:
487 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt150nv1);
488 break;
489 case BCM47XX_BOARD_LINKSYS_WRT150NV11:
490 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt150nv11);
491 break;
492 case BCM47XX_BOARD_LINKSYS_WRT160NV1:
493 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt160nv1);
494 break;
495 case BCM47XX_BOARD_LINKSYS_WRT160NV3:
496 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt160nv3);
497 break;
498 case BCM47XX_BOARD_LINKSYS_WRT300NV11:
499 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt300nv11);
500 break;
501 case BCM47XX_BOARD_LINKSYS_WRT310NV1:
502 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
503 break;
504 case BCM47XX_BOARD_LINKSYS_WRT54G:
505 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54gsv1);
506 break;
507 case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
508 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2);
509 break;
510 case BCM47XX_BOARD_LINKSYS_WRT610NV1:
511 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv1);
512 break;
513 case BCM47XX_BOARD_LINKSYS_WRT610NV2:
514 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv2);
515 break;
516 case BCM47XX_BOARD_LINKSYS_WRTSL54GS:
517 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs);
518 break;
520 case BCM47XX_BOARD_MOTOROLA_WE800G:
521 err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_we800g);
522 break;
523 case BCM47XX_BOARD_MOTOROLA_WR850GP:
524 err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gp);
525 break;
526 case BCM47XX_BOARD_MOTOROLA_WR850GV2V3:
527 err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gv2v3);
528 break;
530 case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
531 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1);
532 break;
533 case BCM47XX_BOARD_NETGEAR_WNDR3700V3:
534 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3700v3);
535 break;
536 case BCM47XX_BOARD_NETGEAR_WNDR4500V1:
537 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr4500v1);
538 break;
539 case BCM47XX_BOARD_NETGEAR_WNR834BV2:
540 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr834bv2);
541 break;
543 case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE:
544 err = bcm47xx_copy_bdata(bcm47xx_buttons_simpletech_simpleshare);
545 break;
547 default:
548 pr_debug("No buttons configuration found for this device\n");
549 return -ENOTSUPP;
552 if (err)
553 return -ENOMEM;
555 err = platform_device_register(&bcm47xx_buttons_gpio_keys);
556 if (err) {
557 pr_err("Failed to register platform device: %d\n", err);
558 return err;
561 return 0;