030-v5.17-0003-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From aecf89f2f8e8a604c33085c230a1f04ea325de64 Mon Sep 17 00:00:00 2001
  2. From: Florian Fainelli <[email protected]>
  3. Date: Thu, 6 Jan 2022 19:51:39 -0800
  4. Subject: [PATCH] MIPS: BCM47XX: Add LEDs and buttons for Asus RTN-10U
  5. Add the definitions for the buttons and LEDs used on the Asus RTN-10U
  6. router.
  7. Signed-off-by: Florian Fainelli <[email protected]>
  8. Signed-off-by: Thomas Bogendoerfer <[email protected]>
  9. ---
  10. arch/mips/bcm47xx/buttons.c | 9 +++++++++
  11. arch/mips/bcm47xx/leds.c | 11 +++++++++++
  12. 2 files changed, 20 insertions(+)
  13. --- a/arch/mips/bcm47xx/buttons.c
  14. +++ b/arch/mips/bcm47xx/buttons.c
  15. @@ -27,6 +27,12 @@
  16. /* Asus */
  17. static const struct gpio_keys_button
  18. +bcm47xx_buttons_asus_rtn10u[] __initconst = {
  19. + BCM47XX_GPIO_KEY(20, KEY_WPS_BUTTON),
  20. + BCM47XX_GPIO_KEY(21, KEY_RESTART),
  21. +};
  22. +
  23. +static const struct gpio_keys_button
  24. bcm47xx_buttons_asus_rtn12[] __initconst = {
  25. BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
  26. BCM47XX_GPIO_KEY(1, KEY_RESTART),
  27. @@ -490,6 +496,9 @@ int __init bcm47xx_buttons_register(void
  28. int err;
  29. switch (board) {
  30. + case BCM47XX_BOARD_ASUS_RTN10U:
  31. + err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn10u);
  32. + break;
  33. case BCM47XX_BOARD_ASUS_RTN12:
  34. err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12);
  35. break;
  36. --- a/arch/mips/bcm47xx/leds.c
  37. +++ b/arch/mips/bcm47xx/leds.c
  38. @@ -30,6 +30,14 @@
  39. /* Asus */
  40. static const struct gpio_led
  41. +bcm47xx_leds_asus_rtn10u[] __initconst = {
  42. + BCM47XX_GPIO_LED(5, "green", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
  43. + BCM47XX_GPIO_LED(6, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
  44. + BCM47XX_GPIO_LED(7, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
  45. + BCM47XX_GPIO_LED(8, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
  46. +};
  47. +
  48. +static const struct gpio_led
  49. bcm47xx_leds_asus_rtn12[] __initconst = {
  50. BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
  51. BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
  52. @@ -563,6 +571,9 @@ void __init bcm47xx_leds_register(void)
  53. enum bcm47xx_board board = bcm47xx_board_get();
  54. switch (board) {
  55. + case BCM47XX_BOARD_ASUS_RTN10U:
  56. + bcm47xx_set_pdata(bcm47xx_leds_asus_rtn10u);
  57. + break;
  58. case BCM47XX_BOARD_ASUS_RTN12:
  59. bcm47xx_set_pdata(bcm47xx_leds_asus_rtn12);
  60. break;