030-MIPS-BCM47XX-Add-Luxul-devices-to-the-database.patch 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. From 36b3b702c20e67b18070159dfba80d2084836928 Mon Sep 17 00:00:00 2001
  2. From: Dan Haab <dhaab@luxul.com>
  3. Date: Mon, 23 Jan 2017 12:50:38 -0700
  4. Subject: [PATCH] MIPS: BCM47XX: Add Luxul devices to the database
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. So far only Luxul XWR-1750 router was supported. This adds a set of
  9. other Luxul devices based on BCM47XX. It's a standard support for LEDs
  10. and buttons.
  11. Signed-off-by: Dan Haab <dhaab@luxul.com>
  12. Cc: Hauke Mehrtens <hauke@hauke-m.de>
  13. Cc: Rafał Miłecki <zajec5@gmail.com>
  14. Cc: linux-mips@linux-mips.org
  15. Patchwork: https://patchwork.linux-mips.org/patch/15106/
  16. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  17. ---
  18. arch/mips/bcm47xx/board.c | 9 +++
  19. arch/mips/bcm47xx/buttons.c | 72 +++++++++++++++++++
  20. arch/mips/bcm47xx/leds.c | 81 ++++++++++++++++++++++
  21. arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 9 +++
  22. 4 files changed, 171 insertions(+)
  23. --- a/arch/mips/bcm47xx/board.c
  24. +++ b/arch/mips/bcm47xx/board.c
  25. @@ -149,6 +149,15 @@ struct bcm47xx_board_type_list2 bcm47xx_
  26. /* board_id */
  27. static const
  28. struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = {
  29. + {{BCM47XX_BOARD_LUXUL_ABR_4400_V1, "Luxul ABR-4400 V1"}, "luxul_abr4400_v1"},
  30. + {{BCM47XX_BOARD_LUXUL_XAP_310_V1, "Luxul XAP-310 V1"}, "luxul_xap310_v1"},
  31. + {{BCM47XX_BOARD_LUXUL_XAP_1210_V1, "Luxul XAP-1210 V1"}, "luxul_xap1210_v1"},
  32. + {{BCM47XX_BOARD_LUXUL_XAP_1230_V1, "Luxul XAP-1230 V1"}, "luxul_xap1230_v1"},
  33. + {{BCM47XX_BOARD_LUXUL_XAP_1240_V1, "Luxul XAP-1240 V1"}, "luxul_xap1240_v1"},
  34. + {{BCM47XX_BOARD_LUXUL_XAP_1500_V1, "Luxul XAP-1500 V1"}, "luxul_xap1500_v1"},
  35. + {{BCM47XX_BOARD_LUXUL_XBR_4400_V1, "Luxul XBR-4400 V1"}, "luxul_xbr4400_v1"},
  36. + {{BCM47XX_BOARD_LUXUL_XVW_P30_V1, "Luxul XVW-P30 V1"}, "luxul_xvwp30_v1"},
  37. + {{BCM47XX_BOARD_LUXUL_XWR_600_V1, "Luxul XWR-600 V1"}, "luxul_xwr600_v1"},
  38. {{BCM47XX_BOARD_LUXUL_XWR_1750_V1, "Luxul XWR-1750 V1"}, "luxul_xwr1750_v1"},
  39. {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"},
  40. {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
  41. --- a/arch/mips/bcm47xx/buttons.c
  42. +++ b/arch/mips/bcm47xx/buttons.c
  43. @@ -308,6 +308,51 @@ bcm47xx_buttons_linksys_wrtsl54gs[] __in
  44. /* Luxul */
  45. static const struct gpio_keys_button
  46. +bcm47xx_buttons_luxul_abr_4400_v1[] = {
  47. + BCM47XX_GPIO_KEY(14, KEY_RESTART),
  48. +};
  49. +
  50. +static const struct gpio_keys_button
  51. +bcm47xx_buttons_luxul_xap_310_v1[] = {
  52. + BCM47XX_GPIO_KEY(20, KEY_RESTART),
  53. +};
  54. +
  55. +static const struct gpio_keys_button
  56. +bcm47xx_buttons_luxul_xap_1210_v1[] = {
  57. + BCM47XX_GPIO_KEY(8, KEY_RESTART),
  58. +};
  59. +
  60. +static const struct gpio_keys_button
  61. +bcm47xx_buttons_luxul_xap_1230_v1[] = {
  62. + BCM47XX_GPIO_KEY(8, KEY_RESTART),
  63. +};
  64. +
  65. +static const struct gpio_keys_button
  66. +bcm47xx_buttons_luxul_xap_1240_v1[] = {
  67. + BCM47XX_GPIO_KEY(8, KEY_RESTART),
  68. +};
  69. +
  70. +static const struct gpio_keys_button
  71. +bcm47xx_buttons_luxul_xap_1500_v1[] = {
  72. + BCM47XX_GPIO_KEY(14, KEY_RESTART),
  73. +};
  74. +
  75. +static const struct gpio_keys_button
  76. +bcm47xx_buttons_luxul_xbr_4400_v1[] = {
  77. + BCM47XX_GPIO_KEY(14, KEY_RESTART),
  78. +};
  79. +
  80. +static const struct gpio_keys_button
  81. +bcm47xx_buttons_luxul_xvw_p30_v1[] = {
  82. + BCM47XX_GPIO_KEY(20, KEY_RESTART),
  83. +};
  84. +
  85. +static const struct gpio_keys_button
  86. +bcm47xx_buttons_luxul_xwr_600_v1[] = {
  87. + BCM47XX_GPIO_KEY(8, KEY_RESTART),
  88. +};
  89. +
  90. +static const struct gpio_keys_button
  91. bcm47xx_buttons_luxul_xwr_1750_v1[] = {
  92. BCM47XX_GPIO_KEY(14, BTN_TASK),
  93. };
  94. @@ -567,6 +612,33 @@ int __init bcm47xx_buttons_register(void
  95. err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs);
  96. break;
  97. + case BCM47XX_BOARD_LUXUL_ABR_4400_V1:
  98. + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_abr_4400_v1);
  99. + break;
  100. + case BCM47XX_BOARD_LUXUL_XAP_310_V1:
  101. + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_310_v1);
  102. + break;
  103. + case BCM47XX_BOARD_LUXUL_XAP_1210_V1:
  104. + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1210_v1);
  105. + break;
  106. + case BCM47XX_BOARD_LUXUL_XAP_1230_V1:
  107. + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1230_v1);
  108. + break;
  109. + case BCM47XX_BOARD_LUXUL_XAP_1240_V1:
  110. + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1240_v1);
  111. + break;
  112. + case BCM47XX_BOARD_LUXUL_XAP_1500_V1:
  113. + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1500_v1);
  114. + break;
  115. + case BCM47XX_BOARD_LUXUL_XBR_4400_V1:
  116. + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xbr_4400_v1);
  117. + break;
  118. + case BCM47XX_BOARD_LUXUL_XVW_P30_V1:
  119. + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xvw_p30_v1);
  120. + break;
  121. + case BCM47XX_BOARD_LUXUL_XWR_600_V1:
  122. + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_600_v1);
  123. + break;
  124. case BCM47XX_BOARD_LUXUL_XWR_1750_V1:
  125. err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_1750_v1);
  126. break;
  127. --- a/arch/mips/bcm47xx/leds.c
  128. +++ b/arch/mips/bcm47xx/leds.c
  129. @@ -373,6 +373,60 @@ bcm47xx_leds_linksys_wrtsl54gs[] __initc
  130. /* Luxul */
  131. static const struct gpio_led
  132. +bcm47xx_leds_luxul_abr_4400_v1[] __initconst = {
  133. + BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
  134. + BCM47XX_GPIO_LED_TRIGGER(15, "green", "status", 0, "timer"),
  135. +};
  136. +
  137. +static const struct gpio_led
  138. +bcm47xx_leds_luxul_xap_310_v1[] __initconst = {
  139. + BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
  140. +};
  141. +
  142. +static const struct gpio_led
  143. +bcm47xx_leds_luxul_xap_1210_v1[] __initconst = {
  144. + BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
  145. +};
  146. +
  147. +static const struct gpio_led
  148. +bcm47xx_leds_luxul_xap_1230_v1[] __initconst = {
  149. + BCM47XX_GPIO_LED(3, "blue", "2ghz", 0, LEDS_GPIO_DEFSTATE_OFF),
  150. + BCM47XX_GPIO_LED(4, "green", "bridge", 0, LEDS_GPIO_DEFSTATE_OFF),
  151. + BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
  152. +};
  153. +
  154. +static const struct gpio_led
  155. +bcm47xx_leds_luxul_xap_1240_v1[] __initconst = {
  156. + BCM47XX_GPIO_LED(3, "blue", "2ghz", 0, LEDS_GPIO_DEFSTATE_OFF),
  157. + BCM47XX_GPIO_LED(4, "green", "bridge", 0, LEDS_GPIO_DEFSTATE_OFF),
  158. + BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
  159. +};
  160. +
  161. +static const struct gpio_led
  162. +bcm47xx_leds_luxul_xap_1500_v1[] __initconst = {
  163. + BCM47XX_GPIO_LED_TRIGGER(13, "green", "status", 1, "timer"),
  164. +};
  165. +
  166. +static const struct gpio_led
  167. +bcm47xx_leds_luxul_xbr_4400_v1[] __initconst = {
  168. + BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
  169. + BCM47XX_GPIO_LED_TRIGGER(15, "green", "status", 0, "timer"),
  170. +};
  171. +
  172. +static const struct gpio_led
  173. +bcm47xx_leds_luxul_xvw_p30_v1[] __initconst = {
  174. + BCM47XX_GPIO_LED_TRIGGER(0, "blue", "status", 1, "timer"),
  175. + BCM47XX_GPIO_LED(1, "green", "link", 1, LEDS_GPIO_DEFSTATE_OFF),
  176. +};
  177. +
  178. +static const struct gpio_led
  179. +bcm47xx_leds_luxul_xwr_600_v1[] __initconst = {
  180. + BCM47XX_GPIO_LED(3, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
  181. + BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
  182. + BCM47XX_GPIO_LED(9, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
  183. +};
  184. +
  185. +static const struct gpio_led
  186. bcm47xx_leds_luxul_xwr_1750_v1[] __initconst = {
  187. BCM47XX_GPIO_LED(5, "green", "5ghz", 0, LEDS_GPIO_DEFSTATE_OFF),
  188. BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
  189. @@ -633,6 +687,33 @@ void __init bcm47xx_leds_register(void)
  190. bcm47xx_set_pdata(bcm47xx_leds_linksys_wrtsl54gs);
  191. break;
  192. + case BCM47XX_BOARD_LUXUL_ABR_4400_V1:
  193. + bcm47xx_set_pdata(bcm47xx_leds_luxul_abr_4400_v1);
  194. + break;
  195. + case BCM47XX_BOARD_LUXUL_XAP_310_V1:
  196. + bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_310_v1);
  197. + break;
  198. + case BCM47XX_BOARD_LUXUL_XAP_1210_V1:
  199. + bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1210_v1);
  200. + break;
  201. + case BCM47XX_BOARD_LUXUL_XAP_1230_V1:
  202. + bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1230_v1);
  203. + break;
  204. + case BCM47XX_BOARD_LUXUL_XAP_1240_V1:
  205. + bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1240_v1);
  206. + break;
  207. + case BCM47XX_BOARD_LUXUL_XAP_1500_V1:
  208. + bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1500_v1);
  209. + break;
  210. + case BCM47XX_BOARD_LUXUL_XBR_4400_V1:
  211. + bcm47xx_set_pdata(bcm47xx_leds_luxul_xbr_4400_v1);
  212. + break;
  213. + case BCM47XX_BOARD_LUXUL_XVW_P30_V1:
  214. + bcm47xx_set_pdata(bcm47xx_leds_luxul_xvw_p30_v1);
  215. + break;
  216. + case BCM47XX_BOARD_LUXUL_XWR_600_V1:
  217. + bcm47xx_set_pdata(bcm47xx_leds_luxul_xwr_600_v1);
  218. + break;
  219. case BCM47XX_BOARD_LUXUL_XWR_1750_V1:
  220. bcm47xx_set_pdata(bcm47xx_leds_luxul_xwr_1750_v1);
  221. break;
  222. --- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
  223. +++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
  224. @@ -80,6 +80,15 @@ enum bcm47xx_board {
  225. BCM47XX_BOARD_LINKSYS_WRT610NV2,
  226. BCM47XX_BOARD_LINKSYS_WRTSL54GS,
  227. + BCM47XX_BOARD_LUXUL_ABR_4400_V1,
  228. + BCM47XX_BOARD_LUXUL_XAP_310_V1,
  229. + BCM47XX_BOARD_LUXUL_XAP_1210_V1,
  230. + BCM47XX_BOARD_LUXUL_XAP_1230_V1,
  231. + BCM47XX_BOARD_LUXUL_XAP_1240_V1,
  232. + BCM47XX_BOARD_LUXUL_XAP_1500_V1,
  233. + BCM47XX_BOARD_LUXUL_XBR_4400_V1,
  234. + BCM47XX_BOARD_LUXUL_XVW_P30_V1,
  235. + BCM47XX_BOARD_LUXUL_XWR_600_V1,
  236. BCM47XX_BOARD_LUXUL_XWR_1750_V1,
  237. BCM47XX_BOARD_MICROSOFT_MN700,