buttons.c 17 KB

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