1
0

0084-MIPS-ralink-add-MT7628-EPHY-LEDs-pinmux-support.patch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. From 2b436a351803f38d0c8ca9c26103472c8aaeb599 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
  3. Date: Thu, 19 May 2016 22:07:36 +0200
  4. Subject: [PATCH] MIPS: ralink: add MT7628 EPHY LEDs pinmux support
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
  9. Cc: john@phrozen.org
  10. Cc: linux-mips@linux-mips.org
  11. Cc: linux-kernel@vger.kernel.org
  12. Patchwork: https://patchwork.linux-mips.org/patch/13308/
  13. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  14. ---
  15. arch/mips/ralink/mt7620.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++
  16. 1 file changed, 100 insertions(+)
  17. --- a/arch/mips/ralink/mt7620.c
  18. +++ b/arch/mips/ralink/mt7620.c
  19. @@ -188,6 +188,41 @@ static struct rt2880_pmx_func gpio_grp_m
  20. FUNC("gpio", 0, 11, 1),
  21. };
  22. +static struct rt2880_pmx_func p4led_kn_grp_mt7628[] = {
  23. + FUNC("jtag", 3, 30, 1),
  24. + FUNC("util", 2, 30, 1),
  25. + FUNC("gpio", 1, 30, 1),
  26. + FUNC("p4led_kn", 0, 30, 1),
  27. +};
  28. +
  29. +static struct rt2880_pmx_func p3led_kn_grp_mt7628[] = {
  30. + FUNC("jtag", 3, 31, 1),
  31. + FUNC("util", 2, 31, 1),
  32. + FUNC("gpio", 1, 31, 1),
  33. + FUNC("p3led_kn", 0, 31, 1),
  34. +};
  35. +
  36. +static struct rt2880_pmx_func p2led_kn_grp_mt7628[] = {
  37. + FUNC("jtag", 3, 32, 1),
  38. + FUNC("util", 2, 32, 1),
  39. + FUNC("gpio", 1, 32, 1),
  40. + FUNC("p2led_kn", 0, 32, 1),
  41. +};
  42. +
  43. +static struct rt2880_pmx_func p1led_kn_grp_mt7628[] = {
  44. + FUNC("jtag", 3, 33, 1),
  45. + FUNC("util", 2, 33, 1),
  46. + FUNC("gpio", 1, 33, 1),
  47. + FUNC("p1led_kn", 0, 33, 1),
  48. +};
  49. +
  50. +static struct rt2880_pmx_func p0led_kn_grp_mt7628[] = {
  51. + FUNC("jtag", 3, 34, 1),
  52. + FUNC("rsvd", 2, 34, 1),
  53. + FUNC("gpio", 1, 34, 1),
  54. + FUNC("p0led_kn", 0, 34, 1),
  55. +};
  56. +
  57. static struct rt2880_pmx_func wled_kn_grp_mt7628[] = {
  58. FUNC("rsvd", 3, 35, 1),
  59. FUNC("rsvd", 2, 35, 1),
  60. @@ -195,6 +230,41 @@ static struct rt2880_pmx_func wled_kn_gr
  61. FUNC("wled_kn", 0, 35, 1),
  62. };
  63. +static struct rt2880_pmx_func p4led_an_grp_mt7628[] = {
  64. + FUNC("jtag", 3, 39, 1),
  65. + FUNC("util", 2, 39, 1),
  66. + FUNC("gpio", 1, 39, 1),
  67. + FUNC("p4led_an", 0, 39, 1),
  68. +};
  69. +
  70. +static struct rt2880_pmx_func p3led_an_grp_mt7628[] = {
  71. + FUNC("jtag", 3, 40, 1),
  72. + FUNC("util", 2, 40, 1),
  73. + FUNC("gpio", 1, 40, 1),
  74. + FUNC("p3led_an", 0, 40, 1),
  75. +};
  76. +
  77. +static struct rt2880_pmx_func p2led_an_grp_mt7628[] = {
  78. + FUNC("jtag", 3, 41, 1),
  79. + FUNC("util", 2, 41, 1),
  80. + FUNC("gpio", 1, 41, 1),
  81. + FUNC("p2led_an", 0, 41, 1),
  82. +};
  83. +
  84. +static struct rt2880_pmx_func p1led_an_grp_mt7628[] = {
  85. + FUNC("jtag", 3, 42, 1),
  86. + FUNC("util", 2, 42, 1),
  87. + FUNC("gpio", 1, 42, 1),
  88. + FUNC("p1led_an", 0, 42, 1),
  89. +};
  90. +
  91. +static struct rt2880_pmx_func p0led_an_grp_mt7628[] = {
  92. + FUNC("jtag", 3, 43, 1),
  93. + FUNC("rsvd", 2, 43, 1),
  94. + FUNC("gpio", 1, 43, 1),
  95. + FUNC("p0led_an", 0, 43, 1),
  96. +};
  97. +
  98. static struct rt2880_pmx_func wled_an_grp_mt7628[] = {
  99. FUNC("rsvd", 3, 44, 1),
  100. FUNC("rsvd", 2, 44, 1),
  101. @@ -204,7 +274,17 @@ static struct rt2880_pmx_func wled_an_gr
  102. #define MT7628_GPIO_MODE_MASK 0x3
  103. +#define MT7628_GPIO_MODE_P4LED_KN 58
  104. +#define MT7628_GPIO_MODE_P3LED_KN 56
  105. +#define MT7628_GPIO_MODE_P2LED_KN 54
  106. +#define MT7628_GPIO_MODE_P1LED_KN 52
  107. +#define MT7628_GPIO_MODE_P0LED_KN 50
  108. #define MT7628_GPIO_MODE_WLED_KN 48
  109. +#define MT7628_GPIO_MODE_P4LED_AN 42
  110. +#define MT7628_GPIO_MODE_P3LED_AN 40
  111. +#define MT7628_GPIO_MODE_P2LED_AN 38
  112. +#define MT7628_GPIO_MODE_P1LED_AN 36
  113. +#define MT7628_GPIO_MODE_P0LED_AN 34
  114. #define MT7628_GPIO_MODE_WLED_AN 32
  115. #define MT7628_GPIO_MODE_PWM1 30
  116. #define MT7628_GPIO_MODE_PWM0 28
  117. @@ -251,8 +331,28 @@ static struct rt2880_pmx_group mt7628an_
  118. 1, MT7628_GPIO_MODE_GPIO),
  119. GRP_G("wled_an", wled_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
  120. 1, MT7628_GPIO_MODE_WLED_AN),
  121. + GRP_G("p0led_an", p0led_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
  122. + 1, MT7628_GPIO_MODE_P0LED_AN),
  123. + GRP_G("p1led_an", p1led_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
  124. + 1, MT7628_GPIO_MODE_P1LED_AN),
  125. + GRP_G("p2led_an", p2led_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
  126. + 1, MT7628_GPIO_MODE_P2LED_AN),
  127. + GRP_G("p3led_an", p3led_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
  128. + 1, MT7628_GPIO_MODE_P3LED_AN),
  129. + GRP_G("p4led_an", p4led_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
  130. + 1, MT7628_GPIO_MODE_P4LED_AN),
  131. GRP_G("wled_kn", wled_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
  132. 1, MT7628_GPIO_MODE_WLED_KN),
  133. + GRP_G("p0led_kn", p0led_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
  134. + 1, MT7628_GPIO_MODE_P0LED_KN),
  135. + GRP_G("p1led_kn", p1led_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
  136. + 1, MT7628_GPIO_MODE_P1LED_KN),
  137. + GRP_G("p2led_kn", p2led_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
  138. + 1, MT7628_GPIO_MODE_P2LED_KN),
  139. + GRP_G("p3led_kn", p3led_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
  140. + 1, MT7628_GPIO_MODE_P3LED_KN),
  141. + GRP_G("p4led_kn", p4led_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
  142. + 1, MT7628_GPIO_MODE_P4LED_KN),
  143. { 0 }
  144. };