@@ -107,31 +107,31 @@ static struct rt2880_pmx_group mt7620a_pinmux_data[] = {
107107};
108108
109109static struct rt2880_pmx_func pwm1_grp_mt7628 [] = {
110- FUNC ("sdcx " , 3 , 19 , 1 ),
110+ FUNC ("sdxc d6 " , 3 , 19 , 1 ),
111111 FUNC ("utif" , 2 , 19 , 1 ),
112112 FUNC ("gpio" , 1 , 19 , 1 ),
113- FUNC ("pwm " , 0 , 19 , 1 ),
113+ FUNC ("pwm1 " , 0 , 19 , 1 ),
114114};
115115
116116static struct rt2880_pmx_func pwm0_grp_mt7628 [] = {
117- FUNC ("sdcx " , 3 , 18 , 1 ),
117+ FUNC ("sdxc d7 " , 3 , 18 , 1 ),
118118 FUNC ("utif" , 2 , 18 , 1 ),
119119 FUNC ("gpio" , 1 , 18 , 1 ),
120- FUNC ("pwm " , 0 , 18 , 1 ),
120+ FUNC ("pwm0 " , 0 , 18 , 1 ),
121121};
122122
123123static struct rt2880_pmx_func uart2_grp_mt7628 [] = {
124- FUNC ("sdcx " , 3 , 20 , 2 ),
124+ FUNC ("sdxc d5 d4 " , 3 , 20 , 2 ),
125125 FUNC ("pwm" , 2 , 20 , 2 ),
126126 FUNC ("gpio" , 1 , 20 , 2 ),
127- FUNC ("uart " , 0 , 20 , 2 ),
127+ FUNC ("uart2 " , 0 , 20 , 2 ),
128128};
129129
130130static struct rt2880_pmx_func uart1_grp_mt7628 [] = {
131- FUNC ("sdcx " , 3 , 45 , 2 ),
131+ FUNC ("sw_r " , 3 , 45 , 2 ),
132132 FUNC ("pwm" , 2 , 45 , 2 ),
133133 FUNC ("gpio" , 1 , 45 , 2 ),
134- FUNC ("uart " , 0 , 45 , 2 ),
134+ FUNC ("uart1 " , 0 , 45 , 2 ),
135135};
136136
137137static struct rt2880_pmx_func i2c_grp_mt7628 [] = {
@@ -143,21 +143,21 @@ static struct rt2880_pmx_func i2c_grp_mt7628[] = {
143143
144144static struct rt2880_pmx_func refclk_grp_mt7628 [] = { FUNC ("reclk" , 0 , 36 , 1 ) };
145145static struct rt2880_pmx_func perst_grp_mt7628 [] = { FUNC ("perst" , 0 , 37 , 1 ) };
146- static struct rt2880_pmx_func wdt_grp_mt7628 [] = { FUNC ("wdt" , 0 , 15 , 38 ) };
146+ static struct rt2880_pmx_func wdt_grp_mt7628 [] = { FUNC ("wdt" , 0 , 38 , 1 ) };
147147static struct rt2880_pmx_func spi_grp_mt7628 [] = { FUNC ("spi" , 0 , 7 , 4 ) };
148148
149149static struct rt2880_pmx_func sd_mode_grp_mt7628 [] = {
150150 FUNC ("jtag" , 3 , 22 , 8 ),
151151 FUNC ("utif" , 2 , 22 , 8 ),
152152 FUNC ("gpio" , 1 , 22 , 8 ),
153- FUNC ("sdcx " , 0 , 22 , 8 ),
153+ FUNC ("sdxc " , 0 , 22 , 8 ),
154154};
155155
156156static struct rt2880_pmx_func uart0_grp_mt7628 [] = {
157157 FUNC ("-" , 3 , 12 , 2 ),
158158 FUNC ("-" , 2 , 12 , 2 ),
159159 FUNC ("gpio" , 1 , 12 , 2 ),
160- FUNC ("uart " , 0 , 12 , 2 ),
160+ FUNC ("uart0 " , 0 , 12 , 2 ),
161161};
162162
163163static struct rt2880_pmx_func i2s_grp_mt7628 [] = {
@@ -171,7 +171,7 @@ static struct rt2880_pmx_func spi_cs1_grp_mt7628[] = {
171171 FUNC ("-" , 3 , 6 , 1 ),
172172 FUNC ("refclk" , 2 , 6 , 1 ),
173173 FUNC ("gpio" , 1 , 6 , 1 ),
174- FUNC ("spi" , 0 , 6 , 1 ),
174+ FUNC ("spi cs1 " , 0 , 6 , 1 ),
175175};
176176
177177static struct rt2880_pmx_func spis_grp_mt7628 [] = {
@@ -188,28 +188,44 @@ static struct rt2880_pmx_func gpio_grp_mt7628[] = {
188188 FUNC ("gpio" , 0 , 11 , 1 ),
189189};
190190
191- #define MT7628_GPIO_MODE_MASK 0x3
192-
193- #define MT7628_GPIO_MODE_PWM1 30
194- #define MT7628_GPIO_MODE_PWM0 28
195- #define MT7628_GPIO_MODE_UART2 26
196- #define MT7628_GPIO_MODE_UART1 24
197- #define MT7628_GPIO_MODE_I2C 20
198- #define MT7628_GPIO_MODE_REFCLK 18
199- #define MT7628_GPIO_MODE_PERST 16
200- #define MT7628_GPIO_MODE_WDT 14
201- #define MT7628_GPIO_MODE_SPI 12
202- #define MT7628_GPIO_MODE_SDMODE 10
203- #define MT7628_GPIO_MODE_UART0 8
204- #define MT7628_GPIO_MODE_I2S 6
205- #define MT7628_GPIO_MODE_CS1 4
206- #define MT7628_GPIO_MODE_SPIS 2
207- #define MT7628_GPIO_MODE_GPIO 0
191+ static struct rt2880_pmx_func wled_kn_grp_mt7628 [] = {
192+ FUNC ("rsvd" , 3 , 35 , 1 ),
193+ FUNC ("rsvd" , 2 , 35 , 1 ),
194+ FUNC ("gpio" , 1 , 35 , 1 ),
195+ FUNC ("wled_kn" , 0 , 35 , 1 ),
196+ };
197+
198+ static struct rt2880_pmx_func wled_an_grp_mt7628 [] = {
199+ FUNC ("rsvd" , 3 , 44 , 1 ),
200+ FUNC ("rsvd" , 2 , 44 , 1 ),
201+ FUNC ("gpio" , 1 , 44 , 1 ),
202+ FUNC ("wled_an" , 0 , 44 , 1 ),
203+ };
204+
205+ #define MT7628_GPIO_MODE_MASK 0x3
206+
207+ #define MT7628_GPIO_MODE_WLED_KN 48
208+ #define MT7628_GPIO_MODE_WLED_AN 32
209+ #define MT7628_GPIO_MODE_PWM1 30
210+ #define MT7628_GPIO_MODE_PWM0 28
211+ #define MT7628_GPIO_MODE_UART2 26
212+ #define MT7628_GPIO_MODE_UART1 24
213+ #define MT7628_GPIO_MODE_I2C 20
214+ #define MT7628_GPIO_MODE_REFCLK 18
215+ #define MT7628_GPIO_MODE_PERST 16
216+ #define MT7628_GPIO_MODE_WDT 14
217+ #define MT7628_GPIO_MODE_SPI 12
218+ #define MT7628_GPIO_MODE_SDMODE 10
219+ #define MT7628_GPIO_MODE_UART0 8
220+ #define MT7628_GPIO_MODE_I2S 6
221+ #define MT7628_GPIO_MODE_CS1 4
222+ #define MT7628_GPIO_MODE_SPIS 2
223+ #define MT7628_GPIO_MODE_GPIO 0
208224
209225static struct rt2880_pmx_group mt7628an_pinmux_data [] = {
210- GRP_G ("pmw1 " , pwm1_grp_mt7628 , MT7628_GPIO_MODE_MASK ,
226+ GRP_G ("pwm1 " , pwm1_grp_mt7628 , MT7628_GPIO_MODE_MASK ,
211227 1 , MT7628_GPIO_MODE_PWM1 ),
212- GRP_G ("pmw1 " , pwm0_grp_mt7628 , MT7628_GPIO_MODE_MASK ,
228+ GRP_G ("pwm0 " , pwm0_grp_mt7628 , MT7628_GPIO_MODE_MASK ,
213229 1 , MT7628_GPIO_MODE_PWM0 ),
214230 GRP_G ("uart2" , uart2_grp_mt7628 , MT7628_GPIO_MODE_MASK ,
215231 1 , MT7628_GPIO_MODE_UART2 ),
@@ -233,6 +249,10 @@ static struct rt2880_pmx_group mt7628an_pinmux_data[] = {
233249 1 , MT7628_GPIO_MODE_SPIS ),
234250 GRP_G ("gpio" , gpio_grp_mt7628 , MT7628_GPIO_MODE_MASK ,
235251 1 , MT7628_GPIO_MODE_GPIO ),
252+ GRP_G ("wled_an" , wled_an_grp_mt7628 , MT7628_GPIO_MODE_MASK ,
253+ 1 , MT7628_GPIO_MODE_WLED_AN ),
254+ GRP_G ("wled_kn" , wled_kn_grp_mt7628 , MT7628_GPIO_MODE_MASK ,
255+ 1 , MT7628_GPIO_MODE_WLED_KN ),
236256 { 0 }
237257};
238258
@@ -439,7 +459,7 @@ void __init ralink_clk_init(void)
439459 ralink_clk_add ("10000c00.uartlite" , periph_rate );
440460 ralink_clk_add ("10180000.wmac" , xtal_rate );
441461
442- if (IS_ENABLED (CONFIG_USB ) && is_mt76x8 ()) {
462+ if (IS_ENABLED (CONFIG_USB ) && ! is_mt76x8 ()) {
443463 /*
444464 * When the CPU goes into sleep mode, the BUS clock will be
445465 * too low for USB to function properly. Adjust the busses
0 commit comments