18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci#include "bcm47xx_private.h" 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci#include <linux/input.h> 58c2ecf20Sopenharmony_ci#include <linux/gpio_keys.h> 68c2ecf20Sopenharmony_ci#include <linux/interrupt.h> 78c2ecf20Sopenharmony_ci#include <bcm47xx_board.h> 88c2ecf20Sopenharmony_ci#include <bcm47xx.h> 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci/************************************************** 118c2ecf20Sopenharmony_ci * Database 128c2ecf20Sopenharmony_ci **************************************************/ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#define BCM47XX_GPIO_KEY(_gpio, _code) \ 158c2ecf20Sopenharmony_ci { \ 168c2ecf20Sopenharmony_ci .code = _code, \ 178c2ecf20Sopenharmony_ci .gpio = _gpio, \ 188c2ecf20Sopenharmony_ci .active_low = 1, \ 198c2ecf20Sopenharmony_ci } 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#define BCM47XX_GPIO_KEY_H(_gpio, _code) \ 228c2ecf20Sopenharmony_ci { \ 238c2ecf20Sopenharmony_ci .code = _code, \ 248c2ecf20Sopenharmony_ci .gpio = _gpio, \ 258c2ecf20Sopenharmony_ci } 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci/* Asus */ 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 308c2ecf20Sopenharmony_cibcm47xx_buttons_asus_rtn12[] __initconst = { 318c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), 328c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(1, KEY_RESTART), 338c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, BTN_0), /* Router mode */ 348c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, BTN_1), /* Repeater mode */ 358c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, BTN_2), /* AP mode */ 368c2ecf20Sopenharmony_ci}; 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 398c2ecf20Sopenharmony_cibcm47xx_buttons_asus_rtn16[] __initconst = { 408c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON), 418c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_RESTART), 428c2ecf20Sopenharmony_ci}; 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 458c2ecf20Sopenharmony_cibcm47xx_buttons_asus_rtn66u[] __initconst = { 468c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 478c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(9, KEY_RESTART), 488c2ecf20Sopenharmony_ci}; 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 518c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl300g[] __initconst = { 528c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 538c2ecf20Sopenharmony_ci}; 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 568c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl320ge[] __initconst = { 578c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 588c2ecf20Sopenharmony_ci}; 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 618c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl330ge[] __initconst = { 628c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(2, KEY_RESTART), 638c2ecf20Sopenharmony_ci}; 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 668c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl500g[] __initconst = { 678c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 688c2ecf20Sopenharmony_ci}; 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 718c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl500gd[] __initconst = { 728c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 738c2ecf20Sopenharmony_ci}; 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 768c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl500gpv1[] __initconst = { 778c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_RESTART), 788c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 798c2ecf20Sopenharmony_ci}; 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 828c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl500gpv2[] __initconst = { 838c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(2, KEY_RESTART), 848c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON), 858c2ecf20Sopenharmony_ci}; 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 888c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl500w[] __initconst = { 898c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY_H(6, KEY_RESTART), 908c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY_H(7, KEY_WPS_BUTTON), 918c2ecf20Sopenharmony_ci}; 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 948c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl520gc[] __initconst = { 958c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(2, KEY_RESTART), 968c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON), 978c2ecf20Sopenharmony_ci}; 988c2ecf20Sopenharmony_ci 998c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1008c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl520gu[] __initconst = { 1018c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(2, KEY_RESTART), 1028c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON), 1038c2ecf20Sopenharmony_ci}; 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1068c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wl700ge[] __initconst = { 1078c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_POWER), /* Hard disk power switch */ 1088c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), /* EZSetup */ 1098c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_COPY), /* Copy data from USB to internal disk */ 1108c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(7, KEY_RESTART), /* Hard reset */ 1118c2ecf20Sopenharmony_ci}; 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1148c2ecf20Sopenharmony_cibcm47xx_buttons_asus_wlhdd[] __initconst = { 1158c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 1168c2ecf20Sopenharmony_ci}; 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ci/* Huawei */ 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1218c2ecf20Sopenharmony_cibcm47xx_buttons_huawei_e970[] __initconst = { 1228c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 1238c2ecf20Sopenharmony_ci}; 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci/* Belkin */ 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1288c2ecf20Sopenharmony_cibcm47xx_buttons_belkin_f7d4301[] __initconst = { 1298c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 1308c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON), 1318c2ecf20Sopenharmony_ci}; 1328c2ecf20Sopenharmony_ci 1338c2ecf20Sopenharmony_ci/* Buffalo */ 1348c2ecf20Sopenharmony_ci 1358c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1368c2ecf20Sopenharmony_cibcm47xx_buttons_buffalo_whr2_a54g54[] __initconst = { 1378c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_RESTART), 1388c2ecf20Sopenharmony_ci}; 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1418c2ecf20Sopenharmony_cibcm47xx_buttons_buffalo_whr_g125[] __initconst = { 1428c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), 1438c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_RESTART), 1448c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */ 1458c2ecf20Sopenharmony_ci}; 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1488c2ecf20Sopenharmony_cibcm47xx_buttons_buffalo_whr_g54s[] __initconst = { 1498c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), 1508c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY_H(4, KEY_RESTART), 1518c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */ 1528c2ecf20Sopenharmony_ci}; 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1558c2ecf20Sopenharmony_cibcm47xx_buttons_buffalo_whr_hp_g54[] __initconst = { 1568c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), 1578c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_RESTART), 1588c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode swtich */ 1598c2ecf20Sopenharmony_ci}; 1608c2ecf20Sopenharmony_ci 1618c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1628c2ecf20Sopenharmony_cibcm47xx_buttons_buffalo_wzr_g300n[] __initconst = { 1638c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_RESTART), 1648c2ecf20Sopenharmony_ci}; 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1678c2ecf20Sopenharmony_cibcm47xx_buttons_buffalo_wzr_rs_g54[] __initconst = { 1688c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), 1698c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_RESTART), 1708c2ecf20Sopenharmony_ci}; 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1738c2ecf20Sopenharmony_cibcm47xx_buttons_buffalo_wzr_rs_g54hp[] __initconst = { 1748c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), 1758c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_RESTART), 1768c2ecf20Sopenharmony_ci}; 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_ci/* Dell */ 1798c2ecf20Sopenharmony_ci 1808c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1818c2ecf20Sopenharmony_cibcm47xx_buttons_dell_tm2300[] __initconst = { 1828c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_RESTART), 1838c2ecf20Sopenharmony_ci}; 1848c2ecf20Sopenharmony_ci 1858c2ecf20Sopenharmony_ci/* D-Link */ 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1888c2ecf20Sopenharmony_cibcm47xx_buttons_dlink_dir130[] __initconst = { 1898c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(3, KEY_RESTART), 1908c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(7, KEY_UNKNOWN), 1918c2ecf20Sopenharmony_ci}; 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 1948c2ecf20Sopenharmony_cibcm47xx_buttons_dlink_dir330[] __initconst = { 1958c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(3, KEY_RESTART), 1968c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(7, KEY_UNKNOWN), 1978c2ecf20Sopenharmony_ci}; 1988c2ecf20Sopenharmony_ci 1998c2ecf20Sopenharmony_ci/* Linksys */ 2008c2ecf20Sopenharmony_ci 2018c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2028c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_e1000v1[] __initconst = { 2038c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON), 2048c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2058c2ecf20Sopenharmony_ci}; 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2088c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_e1000v21[] __initconst = { 2098c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON), 2108c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(10, KEY_RESTART), 2118c2ecf20Sopenharmony_ci}; 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2148c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_e2000v1[] __initconst = { 2158c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON), 2168c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_RESTART), 2178c2ecf20Sopenharmony_ci}; 2188c2ecf20Sopenharmony_ci 2198c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2208c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_e3000v1[] __initconst = { 2218c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 2228c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2238c2ecf20Sopenharmony_ci}; 2248c2ecf20Sopenharmony_ci 2258c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2268c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_e3200v1[] __initconst = { 2278c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, KEY_RESTART), 2288c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON), 2298c2ecf20Sopenharmony_ci}; 2308c2ecf20Sopenharmony_ci 2318c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2328c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_e4200v1[] __initconst = { 2338c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 2348c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2358c2ecf20Sopenharmony_ci}; 2368c2ecf20Sopenharmony_ci 2378c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2388c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt150nv1[] __initconst = { 2398c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 2408c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2418c2ecf20Sopenharmony_ci}; 2428c2ecf20Sopenharmony_ci 2438c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2448c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt150nv11[] __initconst = { 2458c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 2468c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2478c2ecf20Sopenharmony_ci}; 2488c2ecf20Sopenharmony_ci 2498c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2508c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt160nv1[] __initconst = { 2518c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 2528c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2538c2ecf20Sopenharmony_ci}; 2548c2ecf20Sopenharmony_ci 2558c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2568c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt160nv3[] __initconst = { 2578c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON), 2588c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2598c2ecf20Sopenharmony_ci}; 2608c2ecf20Sopenharmony_ci 2618c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2628c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt300n_v1[] __initconst = { 2638c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 2648c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2658c2ecf20Sopenharmony_ci}; 2668c2ecf20Sopenharmony_ci 2678c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2688c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt300nv11[] __initconst = { 2698c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_UNKNOWN), 2708c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2718c2ecf20Sopenharmony_ci}; 2728c2ecf20Sopenharmony_ci 2738c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2748c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt310nv1[] __initconst = { 2758c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2768c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_UNKNOWN), 2778c2ecf20Sopenharmony_ci}; 2788c2ecf20Sopenharmony_ci 2798c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2808c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = { 2818c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, KEY_WIMAX), 2828c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2838c2ecf20Sopenharmony_ci}; 2848c2ecf20Sopenharmony_ci 2858c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2868c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt54g_generic[] __initconst = { 2878c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 2888c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2898c2ecf20Sopenharmony_ci}; 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2928c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt610nv1[] __initconst = { 2938c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 2948c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON), 2958c2ecf20Sopenharmony_ci}; 2968c2ecf20Sopenharmony_ci 2978c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 2988c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrt610nv2[] __initconst = { 2998c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 3008c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 3018c2ecf20Sopenharmony_ci}; 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3048c2ecf20Sopenharmony_cibcm47xx_buttons_linksys_wrtsl54gs[] __initconst = { 3058c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 3068c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 3078c2ecf20Sopenharmony_ci}; 3088c2ecf20Sopenharmony_ci 3098c2ecf20Sopenharmony_ci/* Luxul */ 3108c2ecf20Sopenharmony_ci 3118c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3128c2ecf20Sopenharmony_cibcm47xx_buttons_luxul_abr_4400_v1[] = { 3138c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(14, KEY_RESTART), 3148c2ecf20Sopenharmony_ci}; 3158c2ecf20Sopenharmony_ci 3168c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3178c2ecf20Sopenharmony_cibcm47xx_buttons_luxul_xap_310_v1[] = { 3188c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(20, KEY_RESTART), 3198c2ecf20Sopenharmony_ci}; 3208c2ecf20Sopenharmony_ci 3218c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3228c2ecf20Sopenharmony_cibcm47xx_buttons_luxul_xap_1210_v1[] = { 3238c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_RESTART), 3248c2ecf20Sopenharmony_ci}; 3258c2ecf20Sopenharmony_ci 3268c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3278c2ecf20Sopenharmony_cibcm47xx_buttons_luxul_xap_1230_v1[] = { 3288c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_RESTART), 3298c2ecf20Sopenharmony_ci}; 3308c2ecf20Sopenharmony_ci 3318c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3328c2ecf20Sopenharmony_cibcm47xx_buttons_luxul_xap_1240_v1[] = { 3338c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_RESTART), 3348c2ecf20Sopenharmony_ci}; 3358c2ecf20Sopenharmony_ci 3368c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3378c2ecf20Sopenharmony_cibcm47xx_buttons_luxul_xap_1500_v1[] = { 3388c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(14, KEY_RESTART), 3398c2ecf20Sopenharmony_ci}; 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3428c2ecf20Sopenharmony_cibcm47xx_buttons_luxul_xbr_4400_v1[] = { 3438c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(14, KEY_RESTART), 3448c2ecf20Sopenharmony_ci}; 3458c2ecf20Sopenharmony_ci 3468c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3478c2ecf20Sopenharmony_cibcm47xx_buttons_luxul_xvw_p30_v1[] = { 3488c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(20, KEY_RESTART), 3498c2ecf20Sopenharmony_ci}; 3508c2ecf20Sopenharmony_ci 3518c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3528c2ecf20Sopenharmony_cibcm47xx_buttons_luxul_xwr_600_v1[] = { 3538c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_RESTART), 3548c2ecf20Sopenharmony_ci}; 3558c2ecf20Sopenharmony_ci 3568c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3578c2ecf20Sopenharmony_cibcm47xx_buttons_luxul_xwr_1750_v1[] = { 3588c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(14, KEY_RESTART), 3598c2ecf20Sopenharmony_ci}; 3608c2ecf20Sopenharmony_ci 3618c2ecf20Sopenharmony_ci/* Microsoft */ 3628c2ecf20Sopenharmony_ci 3638c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3648c2ecf20Sopenharmony_cibcm47xx_buttons_microsoft_nm700[] __initconst = { 3658c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(7, KEY_RESTART), 3668c2ecf20Sopenharmony_ci}; 3678c2ecf20Sopenharmony_ci 3688c2ecf20Sopenharmony_ci/* Motorola */ 3698c2ecf20Sopenharmony_ci 3708c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3718c2ecf20Sopenharmony_cibcm47xx_buttons_motorola_we800g[] __initconst = { 3728c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_RESTART), 3738c2ecf20Sopenharmony_ci}; 3748c2ecf20Sopenharmony_ci 3758c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3768c2ecf20Sopenharmony_cibcm47xx_buttons_motorola_wr850gp[] __initconst = { 3778c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, KEY_RESTART), 3788c2ecf20Sopenharmony_ci}; 3798c2ecf20Sopenharmony_ci 3808c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3818c2ecf20Sopenharmony_cibcm47xx_buttons_motorola_wr850gv2v3[] __initconst = { 3828c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, KEY_RESTART), 3838c2ecf20Sopenharmony_ci}; 3848c2ecf20Sopenharmony_ci 3858c2ecf20Sopenharmony_ci/* Netgear */ 3868c2ecf20Sopenharmony_ci 3878c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3888c2ecf20Sopenharmony_cibcm47xx_buttons_netgear_r6200_v1[] __initconst = { 3898c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(2, KEY_RFKILL), 3908c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(3, KEY_RESTART), 3918c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 3928c2ecf20Sopenharmony_ci}; 3938c2ecf20Sopenharmony_ci 3948c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 3958c2ecf20Sopenharmony_cibcm47xx_buttons_netgear_wndr3400v1[] __initconst = { 3968c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_RESTART), 3978c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON), 3988c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(8, KEY_RFKILL), 3998c2ecf20Sopenharmony_ci}; 4008c2ecf20Sopenharmony_ci 4018c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 4028c2ecf20Sopenharmony_cibcm47xx_buttons_netgear_wndr3400_v3[] __initconst = { 4038c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(12, KEY_RESTART), 4048c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(23, KEY_WPS_BUTTON), 4058c2ecf20Sopenharmony_ci}; 4068c2ecf20Sopenharmony_ci 4078c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 4088c2ecf20Sopenharmony_cibcm47xx_buttons_netgear_wndr3700v3[] __initconst = { 4098c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(2, KEY_RFKILL), 4108c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(3, KEY_RESTART), 4118c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 4128c2ecf20Sopenharmony_ci}; 4138c2ecf20Sopenharmony_ci 4148c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 4158c2ecf20Sopenharmony_cibcm47xx_buttons_netgear_wndr4500v1[] __initconst = { 4168c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), 4178c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(5, KEY_RFKILL), 4188c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 4198c2ecf20Sopenharmony_ci}; 4208c2ecf20Sopenharmony_ci 4218c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 4228c2ecf20Sopenharmony_cibcm47xx_buttons_netgear_wnr1000_v3[] __initconst = { 4238c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(2, KEY_WPS_BUTTON), 4248c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(3, KEY_RESTART), 4258c2ecf20Sopenharmony_ci}; 4268c2ecf20Sopenharmony_ci 4278c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 4288c2ecf20Sopenharmony_cibcm47xx_buttons_netgear_wnr3500lv1[] __initconst = { 4298c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(4, KEY_RESTART), 4308c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON), 4318c2ecf20Sopenharmony_ci}; 4328c2ecf20Sopenharmony_ci 4338c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 4348c2ecf20Sopenharmony_cibcm47xx_buttons_netgear_wnr834bv2[] __initconst = { 4358c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(6, KEY_RESTART), 4368c2ecf20Sopenharmony_ci}; 4378c2ecf20Sopenharmony_ci 4388c2ecf20Sopenharmony_ci/* SimpleTech */ 4398c2ecf20Sopenharmony_ci 4408c2ecf20Sopenharmony_cistatic const struct gpio_keys_button 4418c2ecf20Sopenharmony_cibcm47xx_buttons_simpletech_simpleshare[] __initconst = { 4428c2ecf20Sopenharmony_ci BCM47XX_GPIO_KEY(0, KEY_RESTART), 4438c2ecf20Sopenharmony_ci}; 4448c2ecf20Sopenharmony_ci 4458c2ecf20Sopenharmony_ci/************************************************** 4468c2ecf20Sopenharmony_ci * Init 4478c2ecf20Sopenharmony_ci **************************************************/ 4488c2ecf20Sopenharmony_ci 4498c2ecf20Sopenharmony_cistatic struct gpio_keys_platform_data bcm47xx_button_pdata; 4508c2ecf20Sopenharmony_ci 4518c2ecf20Sopenharmony_cistatic struct platform_device bcm47xx_buttons_gpio_keys = { 4528c2ecf20Sopenharmony_ci .name = "gpio-keys", 4538c2ecf20Sopenharmony_ci .dev = { 4548c2ecf20Sopenharmony_ci .platform_data = &bcm47xx_button_pdata, 4558c2ecf20Sopenharmony_ci } 4568c2ecf20Sopenharmony_ci}; 4578c2ecf20Sopenharmony_ci 4588c2ecf20Sopenharmony_ci/* Copy data from __initconst */ 4598c2ecf20Sopenharmony_cistatic int __init bcm47xx_buttons_copy(const struct gpio_keys_button *buttons, 4608c2ecf20Sopenharmony_ci size_t nbuttons) 4618c2ecf20Sopenharmony_ci{ 4628c2ecf20Sopenharmony_ci size_t size = nbuttons * sizeof(*buttons); 4638c2ecf20Sopenharmony_ci 4648c2ecf20Sopenharmony_ci bcm47xx_button_pdata.buttons = kmemdup(buttons, size, GFP_KERNEL); 4658c2ecf20Sopenharmony_ci if (!bcm47xx_button_pdata.buttons) 4668c2ecf20Sopenharmony_ci return -ENOMEM; 4678c2ecf20Sopenharmony_ci bcm47xx_button_pdata.nbuttons = nbuttons; 4688c2ecf20Sopenharmony_ci 4698c2ecf20Sopenharmony_ci return 0; 4708c2ecf20Sopenharmony_ci} 4718c2ecf20Sopenharmony_ci 4728c2ecf20Sopenharmony_ci#define bcm47xx_copy_bdata(dev_buttons) \ 4738c2ecf20Sopenharmony_ci bcm47xx_buttons_copy(dev_buttons, ARRAY_SIZE(dev_buttons)); 4748c2ecf20Sopenharmony_ci 4758c2ecf20Sopenharmony_ciint __init bcm47xx_buttons_register(void) 4768c2ecf20Sopenharmony_ci{ 4778c2ecf20Sopenharmony_ci enum bcm47xx_board board = bcm47xx_board_get(); 4788c2ecf20Sopenharmony_ci int err; 4798c2ecf20Sopenharmony_ci 4808c2ecf20Sopenharmony_ci switch (board) { 4818c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_RTN12: 4828c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12); 4838c2ecf20Sopenharmony_ci break; 4848c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_RTN16: 4858c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn16); 4868c2ecf20Sopenharmony_ci break; 4878c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_RTN66U: 4888c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn66u); 4898c2ecf20Sopenharmony_ci break; 4908c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL300G: 4918c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl300g); 4928c2ecf20Sopenharmony_ci break; 4938c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL320GE: 4948c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl320ge); 4958c2ecf20Sopenharmony_ci break; 4968c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL330GE: 4978c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl330ge); 4988c2ecf20Sopenharmony_ci break; 4998c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL500G: 5008c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500g); 5018c2ecf20Sopenharmony_ci break; 5028c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL500GD: 5038c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gd); 5048c2ecf20Sopenharmony_ci break; 5058c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL500GPV1: 5068c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gpv1); 5078c2ecf20Sopenharmony_ci break; 5088c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL500GPV2: 5098c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gpv2); 5108c2ecf20Sopenharmony_ci break; 5118c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL500W: 5128c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500w); 5138c2ecf20Sopenharmony_ci break; 5148c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL520GC: 5158c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl520gc); 5168c2ecf20Sopenharmony_ci break; 5178c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL520GU: 5188c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl520gu); 5198c2ecf20Sopenharmony_ci break; 5208c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WL700GE: 5218c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl700ge); 5228c2ecf20Sopenharmony_ci break; 5238c2ecf20Sopenharmony_ci case BCM47XX_BOARD_ASUS_WLHDD: 5248c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wlhdd); 5258c2ecf20Sopenharmony_ci break; 5268c2ecf20Sopenharmony_ci 5278c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BELKIN_F7D3301: 5288c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BELKIN_F7D3302: 5298c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BELKIN_F7D4301: 5308c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BELKIN_F7D4302: 5318c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BELKIN_F7D4401: 5328c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_belkin_f7d4301); 5338c2ecf20Sopenharmony_ci break; 5348c2ecf20Sopenharmony_ci 5358c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BUFFALO_WHR2_A54G54: 5368c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr2_a54g54); 5378c2ecf20Sopenharmony_ci break; 5388c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BUFFALO_WHR_G125: 5398c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_g125); 5408c2ecf20Sopenharmony_ci break; 5418c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BUFFALO_WHR_G54S: 5428c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_g54s); 5438c2ecf20Sopenharmony_ci break; 5448c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BUFFALO_WHR_HP_G54: 5458c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_hp_g54); 5468c2ecf20Sopenharmony_ci break; 5478c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BUFFALO_WZR_G300N: 5488c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_g300n); 5498c2ecf20Sopenharmony_ci break; 5508c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BUFFALO_WZR_RS_G54: 5518c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54); 5528c2ecf20Sopenharmony_ci break; 5538c2ecf20Sopenharmony_ci case BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP: 5548c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54hp); 5558c2ecf20Sopenharmony_ci break; 5568c2ecf20Sopenharmony_ci 5578c2ecf20Sopenharmony_ci case BCM47XX_BOARD_DELL_TM2300: 5588c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_dell_tm2300); 5598c2ecf20Sopenharmony_ci break; 5608c2ecf20Sopenharmony_ci 5618c2ecf20Sopenharmony_ci case BCM47XX_BOARD_DLINK_DIR130: 5628c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_dlink_dir130); 5638c2ecf20Sopenharmony_ci break; 5648c2ecf20Sopenharmony_ci case BCM47XX_BOARD_DLINK_DIR330: 5658c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_dlink_dir330); 5668c2ecf20Sopenharmony_ci break; 5678c2ecf20Sopenharmony_ci 5688c2ecf20Sopenharmony_ci case BCM47XX_BOARD_HUAWEI_E970: 5698c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_huawei_e970); 5708c2ecf20Sopenharmony_ci break; 5718c2ecf20Sopenharmony_ci 5728c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_E1000V1: 5738c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e1000v1); 5748c2ecf20Sopenharmony_ci break; 5758c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_E1000V21: 5768c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e1000v21); 5778c2ecf20Sopenharmony_ci break; 5788c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_E2000V1: 5798c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1); 5808c2ecf20Sopenharmony_ci break; 5818c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_E3000V1: 5828c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1); 5838c2ecf20Sopenharmony_ci break; 5848c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_E3200V1: 5858c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3200v1); 5868c2ecf20Sopenharmony_ci break; 5878c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_E4200V1: 5888c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e4200v1); 5898c2ecf20Sopenharmony_ci break; 5908c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT150NV1: 5918c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt150nv1); 5928c2ecf20Sopenharmony_ci break; 5938c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT150NV11: 5948c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt150nv11); 5958c2ecf20Sopenharmony_ci break; 5968c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT160NV1: 5978c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt160nv1); 5988c2ecf20Sopenharmony_ci break; 5998c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT160NV3: 6008c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt160nv3); 6018c2ecf20Sopenharmony_ci break; 6028c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT300N_V1: 6038c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt300n_v1); 6048c2ecf20Sopenharmony_ci break; 6058c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT300NV11: 6068c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt300nv11); 6078c2ecf20Sopenharmony_ci break; 6088c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT310NV1: 6098c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1); 6108c2ecf20Sopenharmony_ci break; 6118c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT54G3GV2: 6128c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2); 6138c2ecf20Sopenharmony_ci break; 6148c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101: 6158c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467: 6168c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708: 6178c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g_generic); 6188c2ecf20Sopenharmony_ci break; 6198c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT610NV1: 6208c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv1); 6218c2ecf20Sopenharmony_ci break; 6228c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRT610NV2: 6238c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv2); 6248c2ecf20Sopenharmony_ci break; 6258c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LINKSYS_WRTSL54GS: 6268c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs); 6278c2ecf20Sopenharmony_ci break; 6288c2ecf20Sopenharmony_ci 6298c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LUXUL_ABR_4400_V1: 6308c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_abr_4400_v1); 6318c2ecf20Sopenharmony_ci break; 6328c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LUXUL_XAP_310_V1: 6338c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_310_v1); 6348c2ecf20Sopenharmony_ci break; 6358c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LUXUL_XAP_1210_V1: 6368c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1210_v1); 6378c2ecf20Sopenharmony_ci break; 6388c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LUXUL_XAP_1230_V1: 6398c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1230_v1); 6408c2ecf20Sopenharmony_ci break; 6418c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LUXUL_XAP_1240_V1: 6428c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1240_v1); 6438c2ecf20Sopenharmony_ci break; 6448c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LUXUL_XAP_1500_V1: 6458c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1500_v1); 6468c2ecf20Sopenharmony_ci break; 6478c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LUXUL_XBR_4400_V1: 6488c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xbr_4400_v1); 6498c2ecf20Sopenharmony_ci break; 6508c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LUXUL_XVW_P30_V1: 6518c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xvw_p30_v1); 6528c2ecf20Sopenharmony_ci break; 6538c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LUXUL_XWR_600_V1: 6548c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_600_v1); 6558c2ecf20Sopenharmony_ci break; 6568c2ecf20Sopenharmony_ci case BCM47XX_BOARD_LUXUL_XWR_1750_V1: 6578c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_1750_v1); 6588c2ecf20Sopenharmony_ci break; 6598c2ecf20Sopenharmony_ci 6608c2ecf20Sopenharmony_ci case BCM47XX_BOARD_MICROSOFT_MN700: 6618c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_microsoft_nm700); 6628c2ecf20Sopenharmony_ci break; 6638c2ecf20Sopenharmony_ci 6648c2ecf20Sopenharmony_ci case BCM47XX_BOARD_MOTOROLA_WE800G: 6658c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_we800g); 6668c2ecf20Sopenharmony_ci break; 6678c2ecf20Sopenharmony_ci case BCM47XX_BOARD_MOTOROLA_WR850GP: 6688c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gp); 6698c2ecf20Sopenharmony_ci break; 6708c2ecf20Sopenharmony_ci case BCM47XX_BOARD_MOTOROLA_WR850GV2V3: 6718c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gv2v3); 6728c2ecf20Sopenharmony_ci break; 6738c2ecf20Sopenharmony_ci 6748c2ecf20Sopenharmony_ci case BCM47XX_BOARD_NETGEAR_R6200_V1: 6758c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1); 6768c2ecf20Sopenharmony_ci break; 6778c2ecf20Sopenharmony_ci case BCM47XX_BOARD_NETGEAR_WNDR3400V1: 6788c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1); 6798c2ecf20Sopenharmony_ci break; 6808c2ecf20Sopenharmony_ci case BCM47XX_BOARD_NETGEAR_WNDR3400_V3: 6818c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400_v3); 6828c2ecf20Sopenharmony_ci break; 6838c2ecf20Sopenharmony_ci case BCM47XX_BOARD_NETGEAR_WNDR3700V3: 6848c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3700v3); 6858c2ecf20Sopenharmony_ci break; 6868c2ecf20Sopenharmony_ci case BCM47XX_BOARD_NETGEAR_WNDR4500V1: 6878c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr4500v1); 6888c2ecf20Sopenharmony_ci break; 6898c2ecf20Sopenharmony_ci case BCM47XX_BOARD_NETGEAR_WNR1000_V3: 6908c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr1000_v3); 6918c2ecf20Sopenharmony_ci break; 6928c2ecf20Sopenharmony_ci case BCM47XX_BOARD_NETGEAR_WNR3500L: 6938c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1); 6948c2ecf20Sopenharmony_ci break; 6958c2ecf20Sopenharmony_ci case BCM47XX_BOARD_NETGEAR_WNR834BV2: 6968c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr834bv2); 6978c2ecf20Sopenharmony_ci break; 6988c2ecf20Sopenharmony_ci 6998c2ecf20Sopenharmony_ci case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE: 7008c2ecf20Sopenharmony_ci err = bcm47xx_copy_bdata(bcm47xx_buttons_simpletech_simpleshare); 7018c2ecf20Sopenharmony_ci break; 7028c2ecf20Sopenharmony_ci 7038c2ecf20Sopenharmony_ci default: 7048c2ecf20Sopenharmony_ci pr_debug("No buttons configuration found for this device\n"); 7058c2ecf20Sopenharmony_ci return -ENOTSUPP; 7068c2ecf20Sopenharmony_ci } 7078c2ecf20Sopenharmony_ci 7088c2ecf20Sopenharmony_ci if (err) 7098c2ecf20Sopenharmony_ci return -ENOMEM; 7108c2ecf20Sopenharmony_ci 7118c2ecf20Sopenharmony_ci err = platform_device_register(&bcm47xx_buttons_gpio_keys); 7128c2ecf20Sopenharmony_ci if (err) { 7138c2ecf20Sopenharmony_ci pr_err("Failed to register platform device: %d\n", err); 7148c2ecf20Sopenharmony_ci return err; 7158c2ecf20Sopenharmony_ci } 7168c2ecf20Sopenharmony_ci 7178c2ecf20Sopenharmony_ci return 0; 7188c2ecf20Sopenharmony_ci} 719