buttons.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. #include "bcm47xx_private.h"
  2. #include <linux/input.h>
  3. #include <linux/gpio_keys.h>
  4. #include <linux/interrupt.h>
  5. #include <bcm47xx_board.h>
  6. #include <bcm47xx.h>
  7. /**************************************************
  8. * Database
  9. **************************************************/
  10. #define BCM47XX_GPIO_KEY(_gpio, _code) \
  11. { \
  12. .code = _code, \
  13. .gpio = _gpio, \
  14. .active_low = 1, \
  15. }
  16. /* Asus */
  17. static const struct gpio_keys_button
  18. bcm47xx_buttons_asus_rtn12[] __initconst = {
  19. BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
  20. BCM47XX_GPIO_KEY(1, KEY_RESTART),
  21. BCM47XX_GPIO_KEY(4, BTN_0), /* Router mode */
  22. BCM47XX_GPIO_KEY(5, BTN_1), /* Repeater mode */
  23. BCM47XX_GPIO_KEY(6, BTN_2), /* AP mode */
  24. };
  25. static const struct gpio_keys_button
  26. bcm47xx_buttons_asus_rtn16[] __initconst = {
  27. BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
  28. BCM47XX_GPIO_KEY(8, KEY_RESTART),
  29. };
  30. static const struct gpio_keys_button
  31. bcm47xx_buttons_asus_rtn66u[] __initconst = {
  32. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  33. BCM47XX_GPIO_KEY(9, KEY_RESTART),
  34. };
  35. static const struct gpio_keys_button
  36. bcm47xx_buttons_asus_wl300g[] __initconst = {
  37. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  38. };
  39. static const struct gpio_keys_button
  40. bcm47xx_buttons_asus_wl320ge[] __initconst = {
  41. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  42. };
  43. static const struct gpio_keys_button
  44. bcm47xx_buttons_asus_wl330ge[] __initconst = {
  45. BCM47XX_GPIO_KEY(2, KEY_RESTART),
  46. };
  47. static const struct gpio_keys_button
  48. bcm47xx_buttons_asus_wl500g[] __initconst = {
  49. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  50. };
  51. static const struct gpio_keys_button
  52. bcm47xx_buttons_asus_wl500gd[] __initconst = {
  53. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  54. };
  55. static const struct gpio_keys_button
  56. bcm47xx_buttons_asus_wl500gpv1[] __initconst = {
  57. BCM47XX_GPIO_KEY(0, KEY_RESTART),
  58. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  59. };
  60. static const struct gpio_keys_button
  61. bcm47xx_buttons_asus_wl500gpv2[] __initconst = {
  62. BCM47XX_GPIO_KEY(2, KEY_RESTART),
  63. BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON),
  64. };
  65. static const struct gpio_keys_button
  66. bcm47xx_buttons_asus_wl500w[] __initconst = {
  67. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  68. BCM47XX_GPIO_KEY(7, KEY_WPS_BUTTON),
  69. };
  70. static const struct gpio_keys_button
  71. bcm47xx_buttons_asus_wl520gc[] __initconst = {
  72. BCM47XX_GPIO_KEY(2, KEY_RESTART),
  73. BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON),
  74. };
  75. static const struct gpio_keys_button
  76. bcm47xx_buttons_asus_wl520gu[] __initconst = {
  77. BCM47XX_GPIO_KEY(2, KEY_RESTART),
  78. BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON),
  79. };
  80. static const struct gpio_keys_button
  81. bcm47xx_buttons_asus_wl700ge[] __initconst = {
  82. BCM47XX_GPIO_KEY(0, KEY_POWER), /* Hard disk power switch */
  83. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), /* EZSetup */
  84. BCM47XX_GPIO_KEY(6, KEY_COPY), /* Copy data from USB to internal disk */
  85. BCM47XX_GPIO_KEY(7, KEY_RESTART), /* Hard reset */
  86. };
  87. static const struct gpio_keys_button
  88. bcm47xx_buttons_asus_wlhdd[] __initconst = {
  89. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  90. };
  91. /* Huawei */
  92. static const struct gpio_keys_button
  93. bcm47xx_buttons_huawei_e970[] __initconst = {
  94. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  95. };
  96. /* Belkin */
  97. static const struct gpio_keys_button
  98. bcm47xx_buttons_belkin_f7d4301[] __initconst = {
  99. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  100. BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON),
  101. };
  102. /* Buffalo */
  103. static const struct gpio_keys_button
  104. bcm47xx_buttons_buffalo_whr2_a54g54[] __initconst = {
  105. BCM47XX_GPIO_KEY(4, KEY_RESTART),
  106. };
  107. static const struct gpio_keys_button
  108. bcm47xx_buttons_buffalo_whr_g125[] __initconst = {
  109. BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
  110. BCM47XX_GPIO_KEY(4, KEY_RESTART),
  111. BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */
  112. };
  113. static const struct gpio_keys_button
  114. bcm47xx_buttons_buffalo_whr_g54s[] __initconst = {
  115. BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
  116. BCM47XX_GPIO_KEY(4, KEY_RESTART),
  117. BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */
  118. };
  119. static const struct gpio_keys_button
  120. bcm47xx_buttons_buffalo_whr_hp_g54[] __initconst = {
  121. BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
  122. BCM47XX_GPIO_KEY(4, KEY_RESTART),
  123. BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */
  124. };
  125. static const struct gpio_keys_button
  126. bcm47xx_buttons_buffalo_wzr_g300n[] __initconst = {
  127. BCM47XX_GPIO_KEY(4, KEY_RESTART),
  128. };
  129. static const struct gpio_keys_button
  130. bcm47xx_buttons_buffalo_wzr_rs_g54[] __initconst = {
  131. BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
  132. BCM47XX_GPIO_KEY(4, KEY_RESTART),
  133. };
  134. static const struct gpio_keys_button
  135. bcm47xx_buttons_buffalo_wzr_rs_g54hp[] __initconst = {
  136. BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
  137. BCM47XX_GPIO_KEY(4, KEY_RESTART),
  138. };
  139. /* Dell */
  140. static const struct gpio_keys_button
  141. bcm47xx_buttons_dell_tm2300[] __initconst = {
  142. BCM47XX_GPIO_KEY(0, KEY_RESTART),
  143. };
  144. /* D-Link */
  145. static const struct gpio_keys_button
  146. bcm47xx_buttons_dlink_dir130[] __initconst = {
  147. BCM47XX_GPIO_KEY(3, KEY_RESTART),
  148. BCM47XX_GPIO_KEY(7, KEY_UNKNOWN),
  149. };
  150. static const struct gpio_keys_button
  151. bcm47xx_buttons_dlink_dir330[] __initconst = {
  152. BCM47XX_GPIO_KEY(3, KEY_RESTART),
  153. BCM47XX_GPIO_KEY(7, KEY_UNKNOWN),
  154. };
  155. /* Linksys */
  156. static const struct gpio_keys_button
  157. bcm47xx_buttons_linksys_e1000v1[] __initconst = {
  158. BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
  159. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  160. };
  161. static const struct gpio_keys_button
  162. bcm47xx_buttons_linksys_e1000v21[] __initconst = {
  163. BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON),
  164. BCM47XX_GPIO_KEY(10, KEY_RESTART),
  165. };
  166. static const struct gpio_keys_button
  167. bcm47xx_buttons_linksys_e2000v1[] __initconst = {
  168. BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
  169. BCM47XX_GPIO_KEY(8, KEY_RESTART),
  170. };
  171. static const struct gpio_keys_button
  172. bcm47xx_buttons_linksys_e3000v1[] __initconst = {
  173. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  174. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  175. };
  176. static const struct gpio_keys_button
  177. bcm47xx_buttons_linksys_e3200v1[] __initconst = {
  178. BCM47XX_GPIO_KEY(5, KEY_RESTART),
  179. BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON),
  180. };
  181. static const struct gpio_keys_button
  182. bcm47xx_buttons_linksys_e4200v1[] __initconst = {
  183. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  184. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  185. };
  186. static const struct gpio_keys_button
  187. bcm47xx_buttons_linksys_wrt150nv1[] __initconst = {
  188. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  189. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  190. };
  191. static const struct gpio_keys_button
  192. bcm47xx_buttons_linksys_wrt150nv11[] __initconst = {
  193. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  194. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  195. };
  196. static const struct gpio_keys_button
  197. bcm47xx_buttons_linksys_wrt160nv1[] __initconst = {
  198. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  199. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  200. };
  201. static const struct gpio_keys_button
  202. bcm47xx_buttons_linksys_wrt160nv3[] __initconst = {
  203. BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
  204. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  205. };
  206. static const struct gpio_keys_button
  207. bcm47xx_buttons_linksys_wrt300n_v1[] __initconst = {
  208. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  209. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  210. };
  211. static const struct gpio_keys_button
  212. bcm47xx_buttons_linksys_wrt300nv11[] __initconst = {
  213. BCM47XX_GPIO_KEY(4, KEY_UNKNOWN),
  214. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  215. };
  216. static const struct gpio_keys_button
  217. bcm47xx_buttons_linksys_wrt310nv1[] __initconst = {
  218. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  219. BCM47XX_GPIO_KEY(8, KEY_UNKNOWN),
  220. };
  221. static const struct gpio_keys_button
  222. bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
  223. BCM47XX_GPIO_KEY(5, KEY_WIMAX),
  224. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  225. };
  226. static const struct gpio_keys_button
  227. bcm47xx_buttons_linksys_wrt54g_generic[] __initconst = {
  228. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  229. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  230. };
  231. static const struct gpio_keys_button
  232. bcm47xx_buttons_linksys_wrt610nv1[] __initconst = {
  233. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  234. BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON),
  235. };
  236. static const struct gpio_keys_button
  237. bcm47xx_buttons_linksys_wrt610nv2[] __initconst = {
  238. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  239. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  240. };
  241. static const struct gpio_keys_button
  242. bcm47xx_buttons_linksys_wrtsl54gs[] __initconst = {
  243. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  244. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  245. };
  246. /* Luxul */
  247. static const struct gpio_keys_button
  248. bcm47xx_buttons_luxul_xwr_1750_v1[] = {
  249. BCM47XX_GPIO_KEY(14, BTN_TASK),
  250. };
  251. /* Microsoft */
  252. static const struct gpio_keys_button
  253. bcm47xx_buttons_microsoft_nm700[] __initconst = {
  254. BCM47XX_GPIO_KEY(7, KEY_RESTART),
  255. };
  256. /* Motorola */
  257. static const struct gpio_keys_button
  258. bcm47xx_buttons_motorola_we800g[] __initconst = {
  259. BCM47XX_GPIO_KEY(0, KEY_RESTART),
  260. };
  261. static const struct gpio_keys_button
  262. bcm47xx_buttons_motorola_wr850gp[] __initconst = {
  263. BCM47XX_GPIO_KEY(5, KEY_RESTART),
  264. };
  265. static const struct gpio_keys_button
  266. bcm47xx_buttons_motorola_wr850gv2v3[] __initconst = {
  267. BCM47XX_GPIO_KEY(5, KEY_RESTART),
  268. };
  269. /* Netgear */
  270. static const struct gpio_keys_button
  271. bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
  272. BCM47XX_GPIO_KEY(4, KEY_RESTART),
  273. BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
  274. BCM47XX_GPIO_KEY(8, KEY_RFKILL),
  275. };
  276. static const struct gpio_keys_button
  277. bcm47xx_buttons_netgear_wndr3400_v3[] __initconst = {
  278. BCM47XX_GPIO_KEY(12, KEY_RESTART),
  279. BCM47XX_GPIO_KEY(23, KEY_WPS_BUTTON),
  280. };
  281. static const struct gpio_keys_button
  282. bcm47xx_buttons_netgear_wndr3700v3[] __initconst = {
  283. BCM47XX_GPIO_KEY(2, KEY_RFKILL),
  284. BCM47XX_GPIO_KEY(3, KEY_RESTART),
  285. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  286. };
  287. static const struct gpio_keys_button
  288. bcm47xx_buttons_netgear_wndr4500v1[] __initconst = {
  289. BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
  290. BCM47XX_GPIO_KEY(5, KEY_RFKILL),
  291. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  292. };
  293. static const struct gpio_keys_button
  294. bcm47xx_buttons_netgear_wnr3500lv1[] __initconst = {
  295. BCM47XX_GPIO_KEY(4, KEY_RESTART),
  296. BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
  297. };
  298. static const struct gpio_keys_button
  299. bcm47xx_buttons_netgear_wnr834bv2[] __initconst = {
  300. BCM47XX_GPIO_KEY(6, KEY_RESTART),
  301. };
  302. /* SimpleTech */
  303. static const struct gpio_keys_button
  304. bcm47xx_buttons_simpletech_simpleshare[] __initconst = {
  305. BCM47XX_GPIO_KEY(0, KEY_RESTART),
  306. };
  307. /**************************************************
  308. * Init
  309. **************************************************/
  310. static struct gpio_keys_platform_data bcm47xx_button_pdata;
  311. static struct platform_device bcm47xx_buttons_gpio_keys = {
  312. .name = "gpio-keys",
  313. .dev = {
  314. .platform_data = &bcm47xx_button_pdata,
  315. }
  316. };
  317. /* Copy data from __initconst */
  318. static int __init bcm47xx_buttons_copy(const struct gpio_keys_button *buttons,
  319. size_t nbuttons)
  320. {
  321. size_t size = nbuttons * sizeof(*buttons);
  322. bcm47xx_button_pdata.buttons = kmalloc(size, GFP_KERNEL);
  323. if (!bcm47xx_button_pdata.buttons)
  324. return -ENOMEM;
  325. memcpy(bcm47xx_button_pdata.buttons, buttons, size);
  326. bcm47xx_button_pdata.nbuttons = nbuttons;
  327. return 0;
  328. }
  329. #define bcm47xx_copy_bdata(dev_buttons) \
  330. bcm47xx_buttons_copy(dev_buttons, ARRAY_SIZE(dev_buttons));
  331. int __init bcm47xx_buttons_register(void)
  332. {
  333. enum bcm47xx_board board = bcm47xx_board_get();
  334. int err;
  335. switch (board) {
  336. case BCM47XX_BOARD_ASUS_RTN12:
  337. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12);
  338. break;
  339. case BCM47XX_BOARD_ASUS_RTN16:
  340. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn16);
  341. break;
  342. case BCM47XX_BOARD_ASUS_RTN66U:
  343. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn66u);
  344. break;
  345. case BCM47XX_BOARD_ASUS_WL300G:
  346. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl300g);
  347. break;
  348. case BCM47XX_BOARD_ASUS_WL320GE:
  349. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl320ge);
  350. break;
  351. case BCM47XX_BOARD_ASUS_WL330GE:
  352. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl330ge);
  353. break;
  354. case BCM47XX_BOARD_ASUS_WL500G:
  355. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500g);
  356. break;
  357. case BCM47XX_BOARD_ASUS_WL500GD:
  358. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gd);
  359. break;
  360. case BCM47XX_BOARD_ASUS_WL500GPV1:
  361. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gpv1);
  362. break;
  363. case BCM47XX_BOARD_ASUS_WL500GPV2:
  364. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gpv2);
  365. break;
  366. case BCM47XX_BOARD_ASUS_WL500W:
  367. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500w);
  368. break;
  369. case BCM47XX_BOARD_ASUS_WL520GC:
  370. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl520gc);
  371. break;
  372. case BCM47XX_BOARD_ASUS_WL520GU:
  373. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl520gu);
  374. break;
  375. case BCM47XX_BOARD_ASUS_WL700GE:
  376. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl700ge);
  377. break;
  378. case BCM47XX_BOARD_ASUS_WLHDD:
  379. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wlhdd);
  380. break;
  381. case BCM47XX_BOARD_BELKIN_F7D3301:
  382. case BCM47XX_BOARD_BELKIN_F7D3302:
  383. case BCM47XX_BOARD_BELKIN_F7D4301:
  384. case BCM47XX_BOARD_BELKIN_F7D4302:
  385. case BCM47XX_BOARD_BELKIN_F7D4401:
  386. err = bcm47xx_copy_bdata(bcm47xx_buttons_belkin_f7d4301);
  387. break;
  388. case BCM47XX_BOARD_BUFFALO_WHR2_A54G54:
  389. err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr2_a54g54);
  390. break;
  391. case BCM47XX_BOARD_BUFFALO_WHR_G125:
  392. err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_g125);
  393. break;
  394. case BCM47XX_BOARD_BUFFALO_WHR_G54S:
  395. err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_g54s);
  396. break;
  397. case BCM47XX_BOARD_BUFFALO_WHR_HP_G54:
  398. err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_hp_g54);
  399. break;
  400. case BCM47XX_BOARD_BUFFALO_WZR_G300N:
  401. err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_g300n);
  402. break;
  403. case BCM47XX_BOARD_BUFFALO_WZR_RS_G54:
  404. err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54);
  405. break;
  406. case BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP:
  407. err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54hp);
  408. break;
  409. case BCM47XX_BOARD_DELL_TM2300:
  410. err = bcm47xx_copy_bdata(bcm47xx_buttons_dell_tm2300);
  411. break;
  412. case BCM47XX_BOARD_DLINK_DIR130:
  413. err = bcm47xx_copy_bdata(bcm47xx_buttons_dlink_dir130);
  414. break;
  415. case BCM47XX_BOARD_DLINK_DIR330:
  416. err = bcm47xx_copy_bdata(bcm47xx_buttons_dlink_dir330);
  417. break;
  418. case BCM47XX_BOARD_HUAWEI_E970:
  419. err = bcm47xx_copy_bdata(bcm47xx_buttons_huawei_e970);
  420. break;
  421. case BCM47XX_BOARD_LINKSYS_E1000V1:
  422. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e1000v1);
  423. break;
  424. case BCM47XX_BOARD_LINKSYS_E1000V21:
  425. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e1000v21);
  426. break;
  427. case BCM47XX_BOARD_LINKSYS_E2000V1:
  428. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1);
  429. break;
  430. case BCM47XX_BOARD_LINKSYS_E3000V1:
  431. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1);
  432. break;
  433. case BCM47XX_BOARD_LINKSYS_E3200V1:
  434. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3200v1);
  435. break;
  436. case BCM47XX_BOARD_LINKSYS_E4200V1:
  437. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e4200v1);
  438. break;
  439. case BCM47XX_BOARD_LINKSYS_WRT150NV1:
  440. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt150nv1);
  441. break;
  442. case BCM47XX_BOARD_LINKSYS_WRT150NV11:
  443. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt150nv11);
  444. break;
  445. case BCM47XX_BOARD_LINKSYS_WRT160NV1:
  446. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt160nv1);
  447. break;
  448. case BCM47XX_BOARD_LINKSYS_WRT160NV3:
  449. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt160nv3);
  450. break;
  451. case BCM47XX_BOARD_LINKSYS_WRT300N_V1:
  452. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt300n_v1);
  453. break;
  454. case BCM47XX_BOARD_LINKSYS_WRT300NV11:
  455. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt300nv11);
  456. break;
  457. case BCM47XX_BOARD_LINKSYS_WRT310NV1:
  458. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
  459. break;
  460. case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
  461. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2);
  462. break;
  463. case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101:
  464. case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467:
  465. case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708:
  466. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g_generic);
  467. break;
  468. case BCM47XX_BOARD_LINKSYS_WRT610NV1:
  469. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv1);
  470. break;
  471. case BCM47XX_BOARD_LINKSYS_WRT610NV2:
  472. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv2);
  473. break;
  474. case BCM47XX_BOARD_LINKSYS_WRTSL54GS:
  475. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs);
  476. break;
  477. case BCM47XX_BOARD_LUXUL_XWR_1750_V1:
  478. err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_1750_v1);
  479. break;
  480. case BCM47XX_BOARD_MICROSOFT_MN700:
  481. err = bcm47xx_copy_bdata(bcm47xx_buttons_microsoft_nm700);
  482. break;
  483. case BCM47XX_BOARD_MOTOROLA_WE800G:
  484. err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_we800g);
  485. break;
  486. case BCM47XX_BOARD_MOTOROLA_WR850GP:
  487. err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gp);
  488. break;
  489. case BCM47XX_BOARD_MOTOROLA_WR850GV2V3:
  490. err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gv2v3);
  491. break;
  492. case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
  493. err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1);
  494. break;
  495. case BCM47XX_BOARD_NETGEAR_WNDR3400_V3:
  496. err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400_v3);
  497. break;
  498. case BCM47XX_BOARD_NETGEAR_WNDR3700V3:
  499. err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3700v3);
  500. break;
  501. case BCM47XX_BOARD_NETGEAR_WNDR4500V1:
  502. err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr4500v1);
  503. break;
  504. case BCM47XX_BOARD_NETGEAR_WNR3500L:
  505. err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1);
  506. break;
  507. case BCM47XX_BOARD_NETGEAR_WNR834BV2:
  508. err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr834bv2);
  509. break;
  510. case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE:
  511. err = bcm47xx_copy_bdata(bcm47xx_buttons_simpletech_simpleshare);
  512. break;
  513. default:
  514. pr_debug("No buttons configuration found for this device\n");
  515. return -ENOTSUPP;
  516. }
  517. if (err)
  518. return -ENOMEM;
  519. err = platform_device_register(&bcm47xx_buttons_gpio_keys);
  520. if (err) {
  521. pr_err("Failed to register platform device: %d\n", err);
  522. return err;
  523. }
  524. return 0;
  525. }