0065-MIPS-ralink-MT7688-pinmux-fixes.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. From e906a5f67e5a3337d696ec848e9c28fc68b39aa3 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <blogic@openwrt.org>
  3. Date: Mon, 4 Jan 2016 20:23:56 +0100
  4. Subject: [PATCH] MIPS: ralink: MT7688 pinmux fixes
  5. A few fixes to the pinmux data, 2 new muxes and a minor whitespace
  6. cleanup.
  7. Signed-off-by: John Crispin <blogic@openwrt.org>
  8. Cc: linux-mips@linux-mips.org
  9. Patchwork: https://patchwork.linux-mips.org/patch/11991/
  10. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  11. ---
  12. arch/mips/ralink/mt7620.c | 80 +++++++++++++++++++++++++++++------------------
  13. 1 file changed, 50 insertions(+), 30 deletions(-)
  14. --- a/arch/mips/ralink/mt7620.c
  15. +++ b/arch/mips/ralink/mt7620.c
  16. @@ -107,31 +107,31 @@ static struct rt2880_pmx_group mt7620a_p
  17. };
  18. static struct rt2880_pmx_func pwm1_grp_mt7628[] = {
  19. - FUNC("sdcx", 3, 19, 1),
  20. + FUNC("sdxc d6", 3, 19, 1),
  21. FUNC("utif", 2, 19, 1),
  22. FUNC("gpio", 1, 19, 1),
  23. - FUNC("pwm", 0, 19, 1),
  24. + FUNC("pwm1", 0, 19, 1),
  25. };
  26. static struct rt2880_pmx_func pwm0_grp_mt7628[] = {
  27. - FUNC("sdcx", 3, 18, 1),
  28. + FUNC("sdxc d7", 3, 18, 1),
  29. FUNC("utif", 2, 18, 1),
  30. FUNC("gpio", 1, 18, 1),
  31. - FUNC("pwm", 0, 18, 1),
  32. + FUNC("pwm0", 0, 18, 1),
  33. };
  34. static struct rt2880_pmx_func uart2_grp_mt7628[] = {
  35. - FUNC("sdcx", 3, 20, 2),
  36. + FUNC("sdxc d5 d4", 3, 20, 2),
  37. FUNC("pwm", 2, 20, 2),
  38. FUNC("gpio", 1, 20, 2),
  39. - FUNC("uart", 0, 20, 2),
  40. + FUNC("uart2", 0, 20, 2),
  41. };
  42. static struct rt2880_pmx_func uart1_grp_mt7628[] = {
  43. - FUNC("sdcx", 3, 45, 2),
  44. + FUNC("sw_r", 3, 45, 2),
  45. FUNC("pwm", 2, 45, 2),
  46. FUNC("gpio", 1, 45, 2),
  47. - FUNC("uart", 0, 45, 2),
  48. + FUNC("uart1", 0, 45, 2),
  49. };
  50. static struct rt2880_pmx_func i2c_grp_mt7628[] = {
  51. @@ -143,21 +143,21 @@ static struct rt2880_pmx_func i2c_grp_mt
  52. static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 36, 1) };
  53. static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 37, 1) };
  54. -static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 15, 38) };
  55. +static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) };
  56. static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) };
  57. static struct rt2880_pmx_func sd_mode_grp_mt7628[] = {
  58. FUNC("jtag", 3, 22, 8),
  59. FUNC("utif", 2, 22, 8),
  60. FUNC("gpio", 1, 22, 8),
  61. - FUNC("sdcx", 0, 22, 8),
  62. + FUNC("sdxc", 0, 22, 8),
  63. };
  64. static struct rt2880_pmx_func uart0_grp_mt7628[] = {
  65. FUNC("-", 3, 12, 2),
  66. FUNC("-", 2, 12, 2),
  67. FUNC("gpio", 1, 12, 2),
  68. - FUNC("uart", 0, 12, 2),
  69. + FUNC("uart0", 0, 12, 2),
  70. };
  71. static struct rt2880_pmx_func i2s_grp_mt7628[] = {
  72. @@ -171,7 +171,7 @@ static struct rt2880_pmx_func spi_cs1_gr
  73. FUNC("-", 3, 6, 1),
  74. FUNC("refclk", 2, 6, 1),
  75. FUNC("gpio", 1, 6, 1),
  76. - FUNC("spi", 0, 6, 1),
  77. + FUNC("spi cs1", 0, 6, 1),
  78. };
  79. static struct rt2880_pmx_func spis_grp_mt7628[] = {
  80. @@ -188,28 +188,44 @@ static struct rt2880_pmx_func gpio_grp_m
  81. FUNC("gpio", 0, 11, 1),
  82. };
  83. -#define MT7628_GPIO_MODE_MASK 0x3
  84. -
  85. -#define MT7628_GPIO_MODE_PWM1 30
  86. -#define MT7628_GPIO_MODE_PWM0 28
  87. -#define MT7628_GPIO_MODE_UART2 26
  88. -#define MT7628_GPIO_MODE_UART1 24
  89. -#define MT7628_GPIO_MODE_I2C 20
  90. -#define MT7628_GPIO_MODE_REFCLK 18
  91. -#define MT7628_GPIO_MODE_PERST 16
  92. -#define MT7628_GPIO_MODE_WDT 14
  93. -#define MT7628_GPIO_MODE_SPI 12
  94. -#define MT7628_GPIO_MODE_SDMODE 10
  95. -#define MT7628_GPIO_MODE_UART0 8
  96. -#define MT7628_GPIO_MODE_I2S 6
  97. -#define MT7628_GPIO_MODE_CS1 4
  98. -#define MT7628_GPIO_MODE_SPIS 2
  99. -#define MT7628_GPIO_MODE_GPIO 0
  100. +static struct rt2880_pmx_func wled_kn_grp_mt7628[] = {
  101. + FUNC("rsvd", 3, 35, 1),
  102. + FUNC("rsvd", 2, 35, 1),
  103. + FUNC("gpio", 1, 35, 1),
  104. + FUNC("wled_kn", 0, 35, 1),
  105. +};
  106. +
  107. +static struct rt2880_pmx_func wled_an_grp_mt7628[] = {
  108. + FUNC("rsvd", 3, 35, 1),
  109. + FUNC("rsvd", 2, 35, 1),
  110. + FUNC("gpio", 1, 35, 1),
  111. + FUNC("wled_an", 0, 35, 1),
  112. +};
  113. +
  114. +#define MT7628_GPIO_MODE_MASK 0x3
  115. +
  116. +#define MT7628_GPIO_MODE_WLED_KN 48
  117. +#define MT7628_GPIO_MODE_WLED_AN 32
  118. +#define MT7628_GPIO_MODE_PWM1 30
  119. +#define MT7628_GPIO_MODE_PWM0 28
  120. +#define MT7628_GPIO_MODE_UART2 26
  121. +#define MT7628_GPIO_MODE_UART1 24
  122. +#define MT7628_GPIO_MODE_I2C 20
  123. +#define MT7628_GPIO_MODE_REFCLK 18
  124. +#define MT7628_GPIO_MODE_PERST 16
  125. +#define MT7628_GPIO_MODE_WDT 14
  126. +#define MT7628_GPIO_MODE_SPI 12
  127. +#define MT7628_GPIO_MODE_SDMODE 10
  128. +#define MT7628_GPIO_MODE_UART0 8
  129. +#define MT7628_GPIO_MODE_I2S 6
  130. +#define MT7628_GPIO_MODE_CS1 4
  131. +#define MT7628_GPIO_MODE_SPIS 2
  132. +#define MT7628_GPIO_MODE_GPIO 0
  133. static struct rt2880_pmx_group mt7628an_pinmux_data[] = {
  134. GRP_G("pmw1", pwm1_grp_mt7628, MT7628_GPIO_MODE_MASK,
  135. 1, MT7628_GPIO_MODE_PWM1),
  136. - GRP_G("pmw1", pwm0_grp_mt7628, MT7628_GPIO_MODE_MASK,
  137. + GRP_G("pmw0", pwm0_grp_mt7628, MT7628_GPIO_MODE_MASK,
  138. 1, MT7628_GPIO_MODE_PWM0),
  139. GRP_G("uart2", uart2_grp_mt7628, MT7628_GPIO_MODE_MASK,
  140. 1, MT7628_GPIO_MODE_UART2),
  141. @@ -233,6 +249,10 @@ static struct rt2880_pmx_group mt7628an_
  142. 1, MT7628_GPIO_MODE_SPIS),
  143. GRP_G("gpio", gpio_grp_mt7628, MT7628_GPIO_MODE_MASK,
  144. 1, MT7628_GPIO_MODE_GPIO),
  145. + GRP_G("wled_an", wled_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
  146. + 1, MT7628_GPIO_MODE_WLED_AN),
  147. + GRP_G("wled_kn", wled_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
  148. + 1, MT7628_GPIO_MODE_WLED_KN),
  149. { 0 }
  150. };