1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun * Copyright (C) 2017-2018 MediaTek Inc.
4*4882a593Smuzhiyun *
5*4882a593Smuzhiyun * Author: Sean Wang <sean.wang@mediatek.com>
6*4882a593Smuzhiyun *
7*4882a593Smuzhiyun */
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun #include "pinctrl-moore.h"
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun #define MT7622_PIN(_number, _name) \
12*4882a593Smuzhiyun MTK_PIN(_number, _name, 1, _number, DRV_GRP0)
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_mode_range[] = {
15*4882a593Smuzhiyun PIN_FIELD(0, 0, 0x320, 0x10, 16, 4),
16*4882a593Smuzhiyun PIN_FIELD(1, 4, 0x3a0, 0x10, 16, 4),
17*4882a593Smuzhiyun PIN_FIELD(5, 5, 0x320, 0x10, 0, 4),
18*4882a593Smuzhiyun PINS_FIELD(6, 7, 0x300, 0x10, 4, 4),
19*4882a593Smuzhiyun PIN_FIELD(8, 9, 0x350, 0x10, 20, 4),
20*4882a593Smuzhiyun PINS_FIELD(10, 13, 0x300, 0x10, 8, 4),
21*4882a593Smuzhiyun PIN_FIELD(14, 15, 0x320, 0x10, 4, 4),
22*4882a593Smuzhiyun PIN_FIELD(16, 17, 0x320, 0x10, 20, 4),
23*4882a593Smuzhiyun PIN_FIELD(18, 21, 0x310, 0x10, 16, 4),
24*4882a593Smuzhiyun PIN_FIELD(22, 22, 0x380, 0x10, 16, 4),
25*4882a593Smuzhiyun PINS_FIELD(23, 24, 0x300, 0x10, 24, 4),
26*4882a593Smuzhiyun PINS_FIELD(25, 36, 0x300, 0x10, 12, 4),
27*4882a593Smuzhiyun PINS_FIELD(37, 50, 0x300, 0x10, 20, 4),
28*4882a593Smuzhiyun PIN_FIELD(51, 70, 0x330, 0x10, 4, 4),
29*4882a593Smuzhiyun PINS_FIELD(71, 72, 0x300, 0x10, 16, 4),
30*4882a593Smuzhiyun PIN_FIELD(73, 76, 0x310, 0x10, 0, 4),
31*4882a593Smuzhiyun PIN_FIELD(77, 77, 0x320, 0x10, 28, 4),
32*4882a593Smuzhiyun PIN_FIELD(78, 78, 0x320, 0x10, 12, 4),
33*4882a593Smuzhiyun PIN_FIELD(79, 82, 0x3a0, 0x10, 0, 4),
34*4882a593Smuzhiyun PIN_FIELD(83, 83, 0x350, 0x10, 28, 4),
35*4882a593Smuzhiyun PIN_FIELD(84, 84, 0x330, 0x10, 0, 4),
36*4882a593Smuzhiyun PIN_FIELD(85, 90, 0x360, 0x10, 4, 4),
37*4882a593Smuzhiyun PIN_FIELD(91, 94, 0x390, 0x10, 16, 4),
38*4882a593Smuzhiyun PIN_FIELD(95, 97, 0x380, 0x10, 20, 4),
39*4882a593Smuzhiyun PIN_FIELD(98, 101, 0x390, 0x10, 0, 4),
40*4882a593Smuzhiyun PIN_FIELD(102, 102, 0x360, 0x10, 0, 4),
41*4882a593Smuzhiyun };
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_dir_range[] = {
44*4882a593Smuzhiyun PIN_FIELD(0, 102, 0x0, 0x10, 0, 1),
45*4882a593Smuzhiyun };
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_di_range[] = {
48*4882a593Smuzhiyun PIN_FIELD(0, 102, 0x200, 0x10, 0, 1),
49*4882a593Smuzhiyun };
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_do_range[] = {
52*4882a593Smuzhiyun PIN_FIELD(0, 102, 0x100, 0x10, 0, 1),
53*4882a593Smuzhiyun };
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_sr_range[] = {
56*4882a593Smuzhiyun PIN_FIELD(0, 31, 0x910, 0x10, 0, 1),
57*4882a593Smuzhiyun PIN_FIELD(32, 50, 0xa10, 0x10, 0, 1),
58*4882a593Smuzhiyun PIN_FIELD(51, 70, 0x810, 0x10, 0, 1),
59*4882a593Smuzhiyun PIN_FIELD(71, 72, 0xb10, 0x10, 0, 1),
60*4882a593Smuzhiyun PIN_FIELD(73, 86, 0xb10, 0x10, 4, 1),
61*4882a593Smuzhiyun PIN_FIELD(87, 90, 0xc10, 0x10, 0, 1),
62*4882a593Smuzhiyun PIN_FIELD(91, 102, 0xb10, 0x10, 18, 1),
63*4882a593Smuzhiyun };
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_smt_range[] = {
66*4882a593Smuzhiyun PIN_FIELD(0, 31, 0x920, 0x10, 0, 1),
67*4882a593Smuzhiyun PIN_FIELD(32, 50, 0xa20, 0x10, 0, 1),
68*4882a593Smuzhiyun PIN_FIELD(51, 70, 0x820, 0x10, 0, 1),
69*4882a593Smuzhiyun PIN_FIELD(71, 72, 0xb20, 0x10, 0, 1),
70*4882a593Smuzhiyun PIN_FIELD(73, 86, 0xb20, 0x10, 4, 1),
71*4882a593Smuzhiyun PIN_FIELD(87, 90, 0xc20, 0x10, 0, 1),
72*4882a593Smuzhiyun PIN_FIELD(91, 102, 0xb20, 0x10, 18, 1),
73*4882a593Smuzhiyun };
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_pu_range[] = {
76*4882a593Smuzhiyun PIN_FIELD(0, 31, 0x930, 0x10, 0, 1),
77*4882a593Smuzhiyun PIN_FIELD(32, 50, 0xa30, 0x10, 0, 1),
78*4882a593Smuzhiyun PIN_FIELD(51, 70, 0x830, 0x10, 0, 1),
79*4882a593Smuzhiyun PIN_FIELD(71, 72, 0xb30, 0x10, 0, 1),
80*4882a593Smuzhiyun PIN_FIELD(73, 86, 0xb30, 0x10, 4, 1),
81*4882a593Smuzhiyun PIN_FIELD(87, 90, 0xc30, 0x10, 0, 1),
82*4882a593Smuzhiyun PIN_FIELD(91, 102, 0xb30, 0x10, 18, 1),
83*4882a593Smuzhiyun };
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_pd_range[] = {
86*4882a593Smuzhiyun PIN_FIELD(0, 31, 0x940, 0x10, 0, 1),
87*4882a593Smuzhiyun PIN_FIELD(32, 50, 0xa40, 0x10, 0, 1),
88*4882a593Smuzhiyun PIN_FIELD(51, 70, 0x840, 0x10, 0, 1),
89*4882a593Smuzhiyun PIN_FIELD(71, 72, 0xb40, 0x10, 0, 1),
90*4882a593Smuzhiyun PIN_FIELD(73, 86, 0xb40, 0x10, 4, 1),
91*4882a593Smuzhiyun PIN_FIELD(87, 90, 0xc40, 0x10, 0, 1),
92*4882a593Smuzhiyun PIN_FIELD(91, 102, 0xb40, 0x10, 18, 1),
93*4882a593Smuzhiyun };
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_e4_range[] = {
96*4882a593Smuzhiyun PIN_FIELD(0, 31, 0x960, 0x10, 0, 1),
97*4882a593Smuzhiyun PIN_FIELD(32, 50, 0xa60, 0x10, 0, 1),
98*4882a593Smuzhiyun PIN_FIELD(51, 70, 0x860, 0x10, 0, 1),
99*4882a593Smuzhiyun PIN_FIELD(71, 72, 0xb60, 0x10, 0, 1),
100*4882a593Smuzhiyun PIN_FIELD(73, 86, 0xb60, 0x10, 4, 1),
101*4882a593Smuzhiyun PIN_FIELD(87, 90, 0xc60, 0x10, 0, 1),
102*4882a593Smuzhiyun PIN_FIELD(91, 102, 0xb60, 0x10, 18, 1),
103*4882a593Smuzhiyun };
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_e8_range[] = {
106*4882a593Smuzhiyun PIN_FIELD(0, 31, 0x970, 0x10, 0, 1),
107*4882a593Smuzhiyun PIN_FIELD(32, 50, 0xa70, 0x10, 0, 1),
108*4882a593Smuzhiyun PIN_FIELD(51, 70, 0x870, 0x10, 0, 1),
109*4882a593Smuzhiyun PIN_FIELD(71, 72, 0xb70, 0x10, 0, 1),
110*4882a593Smuzhiyun PIN_FIELD(73, 86, 0xb70, 0x10, 4, 1),
111*4882a593Smuzhiyun PIN_FIELD(87, 90, 0xc70, 0x10, 0, 1),
112*4882a593Smuzhiyun PIN_FIELD(91, 102, 0xb70, 0x10, 18, 1),
113*4882a593Smuzhiyun };
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_tdsel_range[] = {
116*4882a593Smuzhiyun PIN_FIELD(0, 31, 0x980, 0x4, 0, 4),
117*4882a593Smuzhiyun PIN_FIELD(32, 50, 0xa80, 0x4, 0, 4),
118*4882a593Smuzhiyun PIN_FIELD(51, 70, 0x880, 0x4, 0, 4),
119*4882a593Smuzhiyun PIN_FIELD(71, 72, 0xb80, 0x4, 0, 4),
120*4882a593Smuzhiyun PIN_FIELD(73, 86, 0xb80, 0x4, 16, 4),
121*4882a593Smuzhiyun PIN_FIELD(87, 90, 0xc80, 0x4, 0, 4),
122*4882a593Smuzhiyun PIN_FIELD(91, 102, 0xb88, 0x4, 8, 4),
123*4882a593Smuzhiyun };
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun static const struct mtk_pin_field_calc mt7622_pin_rdsel_range[] = {
126*4882a593Smuzhiyun PIN_FIELD(0, 31, 0x990, 0x4, 0, 6),
127*4882a593Smuzhiyun PIN_FIELD(32, 50, 0xa90, 0x4, 0, 6),
128*4882a593Smuzhiyun PIN_FIELD(51, 58, 0x890, 0x4, 0, 6),
129*4882a593Smuzhiyun PIN_FIELD(59, 60, 0x894, 0x4, 28, 6),
130*4882a593Smuzhiyun PIN_FIELD(61, 62, 0x894, 0x4, 16, 6),
131*4882a593Smuzhiyun PIN_FIELD(63, 66, 0x898, 0x4, 8, 6),
132*4882a593Smuzhiyun PIN_FIELD(67, 68, 0x89c, 0x4, 12, 6),
133*4882a593Smuzhiyun PIN_FIELD(69, 70, 0x89c, 0x4, 0, 6),
134*4882a593Smuzhiyun PIN_FIELD(71, 72, 0xb90, 0x4, 0, 6),
135*4882a593Smuzhiyun PIN_FIELD(73, 86, 0xb90, 0x4, 24, 6),
136*4882a593Smuzhiyun PIN_FIELD(87, 90, 0xc90, 0x4, 0, 6),
137*4882a593Smuzhiyun PIN_FIELD(91, 102, 0xb9c, 0x4, 12, 6),
138*4882a593Smuzhiyun };
139*4882a593Smuzhiyun
140*4882a593Smuzhiyun static const struct mtk_pin_reg_calc mt7622_reg_cals[PINCTRL_PIN_REG_MAX] = {
141*4882a593Smuzhiyun [PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt7622_pin_mode_range),
142*4882a593Smuzhiyun [PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt7622_pin_dir_range),
143*4882a593Smuzhiyun [PINCTRL_PIN_REG_DI] = MTK_RANGE(mt7622_pin_di_range),
144*4882a593Smuzhiyun [PINCTRL_PIN_REG_DO] = MTK_RANGE(mt7622_pin_do_range),
145*4882a593Smuzhiyun [PINCTRL_PIN_REG_SR] = MTK_RANGE(mt7622_pin_sr_range),
146*4882a593Smuzhiyun [PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt7622_pin_smt_range),
147*4882a593Smuzhiyun [PINCTRL_PIN_REG_PU] = MTK_RANGE(mt7622_pin_pu_range),
148*4882a593Smuzhiyun [PINCTRL_PIN_REG_PD] = MTK_RANGE(mt7622_pin_pd_range),
149*4882a593Smuzhiyun [PINCTRL_PIN_REG_E4] = MTK_RANGE(mt7622_pin_e4_range),
150*4882a593Smuzhiyun [PINCTRL_PIN_REG_E8] = MTK_RANGE(mt7622_pin_e8_range),
151*4882a593Smuzhiyun [PINCTRL_PIN_REG_TDSEL] = MTK_RANGE(mt7622_pin_tdsel_range),
152*4882a593Smuzhiyun [PINCTRL_PIN_REG_RDSEL] = MTK_RANGE(mt7622_pin_rdsel_range),
153*4882a593Smuzhiyun };
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun static const struct mtk_pin_desc mt7622_pins[] = {
156*4882a593Smuzhiyun MT7622_PIN(0, "GPIO_A"),
157*4882a593Smuzhiyun MT7622_PIN(1, "I2S1_IN"),
158*4882a593Smuzhiyun MT7622_PIN(2, "I2S1_OUT"),
159*4882a593Smuzhiyun MT7622_PIN(3, "I2S_BCLK"),
160*4882a593Smuzhiyun MT7622_PIN(4, "I2S_WS"),
161*4882a593Smuzhiyun MT7622_PIN(5, "I2S_MCLK"),
162*4882a593Smuzhiyun MT7622_PIN(6, "TXD0"),
163*4882a593Smuzhiyun MT7622_PIN(7, "RXD0"),
164*4882a593Smuzhiyun MT7622_PIN(8, "SPI_WP"),
165*4882a593Smuzhiyun MT7622_PIN(9, "SPI_HOLD"),
166*4882a593Smuzhiyun MT7622_PIN(10, "SPI_CLK"),
167*4882a593Smuzhiyun MT7622_PIN(11, "SPI_MOSI"),
168*4882a593Smuzhiyun MT7622_PIN(12, "SPI_MISO"),
169*4882a593Smuzhiyun MT7622_PIN(13, "SPI_CS"),
170*4882a593Smuzhiyun MT7622_PIN(14, "I2C_SDA"),
171*4882a593Smuzhiyun MT7622_PIN(15, "I2C_SCL"),
172*4882a593Smuzhiyun MT7622_PIN(16, "I2S2_IN"),
173*4882a593Smuzhiyun MT7622_PIN(17, "I2S3_IN"),
174*4882a593Smuzhiyun MT7622_PIN(18, "I2S4_IN"),
175*4882a593Smuzhiyun MT7622_PIN(19, "I2S2_OUT"),
176*4882a593Smuzhiyun MT7622_PIN(20, "I2S3_OUT"),
177*4882a593Smuzhiyun MT7622_PIN(21, "I2S4_OUT"),
178*4882a593Smuzhiyun MT7622_PIN(22, "GPIO_B"),
179*4882a593Smuzhiyun MT7622_PIN(23, "MDC"),
180*4882a593Smuzhiyun MT7622_PIN(24, "MDIO"),
181*4882a593Smuzhiyun MT7622_PIN(25, "G2_TXD0"),
182*4882a593Smuzhiyun MT7622_PIN(26, "G2_TXD1"),
183*4882a593Smuzhiyun MT7622_PIN(27, "G2_TXD2"),
184*4882a593Smuzhiyun MT7622_PIN(28, "G2_TXD3"),
185*4882a593Smuzhiyun MT7622_PIN(29, "G2_TXEN"),
186*4882a593Smuzhiyun MT7622_PIN(30, "G2_TXC"),
187*4882a593Smuzhiyun MT7622_PIN(31, "G2_RXD0"),
188*4882a593Smuzhiyun MT7622_PIN(32, "G2_RXD1"),
189*4882a593Smuzhiyun MT7622_PIN(33, "G2_RXD2"),
190*4882a593Smuzhiyun MT7622_PIN(34, "G2_RXD3"),
191*4882a593Smuzhiyun MT7622_PIN(35, "G2_RXDV"),
192*4882a593Smuzhiyun MT7622_PIN(36, "G2_RXC"),
193*4882a593Smuzhiyun MT7622_PIN(37, "NCEB"),
194*4882a593Smuzhiyun MT7622_PIN(38, "NWEB"),
195*4882a593Smuzhiyun MT7622_PIN(39, "NREB"),
196*4882a593Smuzhiyun MT7622_PIN(40, "NDL4"),
197*4882a593Smuzhiyun MT7622_PIN(41, "NDL5"),
198*4882a593Smuzhiyun MT7622_PIN(42, "NDL6"),
199*4882a593Smuzhiyun MT7622_PIN(43, "NDL7"),
200*4882a593Smuzhiyun MT7622_PIN(44, "NRB"),
201*4882a593Smuzhiyun MT7622_PIN(45, "NCLE"),
202*4882a593Smuzhiyun MT7622_PIN(46, "NALE"),
203*4882a593Smuzhiyun MT7622_PIN(47, "NDL0"),
204*4882a593Smuzhiyun MT7622_PIN(48, "NDL1"),
205*4882a593Smuzhiyun MT7622_PIN(49, "NDL2"),
206*4882a593Smuzhiyun MT7622_PIN(50, "NDL3"),
207*4882a593Smuzhiyun MT7622_PIN(51, "MDI_TP_P0"),
208*4882a593Smuzhiyun MT7622_PIN(52, "MDI_TN_P0"),
209*4882a593Smuzhiyun MT7622_PIN(53, "MDI_RP_P0"),
210*4882a593Smuzhiyun MT7622_PIN(54, "MDI_RN_P0"),
211*4882a593Smuzhiyun MT7622_PIN(55, "MDI_TP_P1"),
212*4882a593Smuzhiyun MT7622_PIN(56, "MDI_TN_P1"),
213*4882a593Smuzhiyun MT7622_PIN(57, "MDI_RP_P1"),
214*4882a593Smuzhiyun MT7622_PIN(58, "MDI_RN_P1"),
215*4882a593Smuzhiyun MT7622_PIN(59, "MDI_RP_P2"),
216*4882a593Smuzhiyun MT7622_PIN(60, "MDI_RN_P2"),
217*4882a593Smuzhiyun MT7622_PIN(61, "MDI_TP_P2"),
218*4882a593Smuzhiyun MT7622_PIN(62, "MDI_TN_P2"),
219*4882a593Smuzhiyun MT7622_PIN(63, "MDI_TP_P3"),
220*4882a593Smuzhiyun MT7622_PIN(64, "MDI_TN_P3"),
221*4882a593Smuzhiyun MT7622_PIN(65, "MDI_RP_P3"),
222*4882a593Smuzhiyun MT7622_PIN(66, "MDI_RN_P3"),
223*4882a593Smuzhiyun MT7622_PIN(67, "MDI_RP_P4"),
224*4882a593Smuzhiyun MT7622_PIN(68, "MDI_RN_P4"),
225*4882a593Smuzhiyun MT7622_PIN(69, "MDI_TP_P4"),
226*4882a593Smuzhiyun MT7622_PIN(70, "MDI_TN_P4"),
227*4882a593Smuzhiyun MT7622_PIN(71, "PMIC_SCL"),
228*4882a593Smuzhiyun MT7622_PIN(72, "PMIC_SDA"),
229*4882a593Smuzhiyun MT7622_PIN(73, "SPIC1_CLK"),
230*4882a593Smuzhiyun MT7622_PIN(74, "SPIC1_MOSI"),
231*4882a593Smuzhiyun MT7622_PIN(75, "SPIC1_MISO"),
232*4882a593Smuzhiyun MT7622_PIN(76, "SPIC1_CS"),
233*4882a593Smuzhiyun MT7622_PIN(77, "GPIO_D"),
234*4882a593Smuzhiyun MT7622_PIN(78, "WATCHDOG"),
235*4882a593Smuzhiyun MT7622_PIN(79, "RTS3_N"),
236*4882a593Smuzhiyun MT7622_PIN(80, "CTS3_N"),
237*4882a593Smuzhiyun MT7622_PIN(81, "TXD3"),
238*4882a593Smuzhiyun MT7622_PIN(82, "RXD3"),
239*4882a593Smuzhiyun MT7622_PIN(83, "PERST0_N"),
240*4882a593Smuzhiyun MT7622_PIN(84, "PERST1_N"),
241*4882a593Smuzhiyun MT7622_PIN(85, "WLED_N"),
242*4882a593Smuzhiyun MT7622_PIN(86, "EPHY_LED0_N"),
243*4882a593Smuzhiyun MT7622_PIN(87, "AUXIN0"),
244*4882a593Smuzhiyun MT7622_PIN(88, "AUXIN1"),
245*4882a593Smuzhiyun MT7622_PIN(89, "AUXIN2"),
246*4882a593Smuzhiyun MT7622_PIN(90, "AUXIN3"),
247*4882a593Smuzhiyun MT7622_PIN(91, "TXD4"),
248*4882a593Smuzhiyun MT7622_PIN(92, "RXD4"),
249*4882a593Smuzhiyun MT7622_PIN(93, "RTS4_N"),
250*4882a593Smuzhiyun MT7622_PIN(94, "CTS4_N"),
251*4882a593Smuzhiyun MT7622_PIN(95, "PWM1"),
252*4882a593Smuzhiyun MT7622_PIN(96, "PWM2"),
253*4882a593Smuzhiyun MT7622_PIN(97, "PWM3"),
254*4882a593Smuzhiyun MT7622_PIN(98, "PWM4"),
255*4882a593Smuzhiyun MT7622_PIN(99, "PWM5"),
256*4882a593Smuzhiyun MT7622_PIN(100, "PWM6"),
257*4882a593Smuzhiyun MT7622_PIN(101, "PWM7"),
258*4882a593Smuzhiyun MT7622_PIN(102, "GPIO_E"),
259*4882a593Smuzhiyun };
260*4882a593Smuzhiyun
261*4882a593Smuzhiyun /* List all groups consisting of these pins dedicated to the enablement of
262*4882a593Smuzhiyun * certain hardware block and the corresponding mode for all of the pins. The
263*4882a593Smuzhiyun * hardware probably has multiple combinations of these pinouts.
264*4882a593Smuzhiyun */
265*4882a593Smuzhiyun
266*4882a593Smuzhiyun /* ANTSEL */
267*4882a593Smuzhiyun static int mt7622_antsel0_pins[] = { 91, };
268*4882a593Smuzhiyun static int mt7622_antsel0_funcs[] = { 5, };
269*4882a593Smuzhiyun static int mt7622_antsel1_pins[] = { 92, };
270*4882a593Smuzhiyun static int mt7622_antsel1_funcs[] = { 5, };
271*4882a593Smuzhiyun static int mt7622_antsel2_pins[] = { 93, };
272*4882a593Smuzhiyun static int mt7622_antsel2_funcs[] = { 5, };
273*4882a593Smuzhiyun static int mt7622_antsel3_pins[] = { 94, };
274*4882a593Smuzhiyun static int mt7622_antsel3_funcs[] = { 5, };
275*4882a593Smuzhiyun static int mt7622_antsel4_pins[] = { 95, };
276*4882a593Smuzhiyun static int mt7622_antsel4_funcs[] = { 5, };
277*4882a593Smuzhiyun static int mt7622_antsel5_pins[] = { 96, };
278*4882a593Smuzhiyun static int mt7622_antsel5_funcs[] = { 5, };
279*4882a593Smuzhiyun static int mt7622_antsel6_pins[] = { 97, };
280*4882a593Smuzhiyun static int mt7622_antsel6_funcs[] = { 5, };
281*4882a593Smuzhiyun static int mt7622_antsel7_pins[] = { 98, };
282*4882a593Smuzhiyun static int mt7622_antsel7_funcs[] = { 5, };
283*4882a593Smuzhiyun static int mt7622_antsel8_pins[] = { 99, };
284*4882a593Smuzhiyun static int mt7622_antsel8_funcs[] = { 5, };
285*4882a593Smuzhiyun static int mt7622_antsel9_pins[] = { 100, };
286*4882a593Smuzhiyun static int mt7622_antsel9_funcs[] = { 5, };
287*4882a593Smuzhiyun static int mt7622_antsel10_pins[] = { 101, };
288*4882a593Smuzhiyun static int mt7622_antsel10_funcs[] = { 5, };
289*4882a593Smuzhiyun static int mt7622_antsel11_pins[] = { 102, };
290*4882a593Smuzhiyun static int mt7622_antsel11_funcs[] = { 5, };
291*4882a593Smuzhiyun static int mt7622_antsel12_pins[] = { 73, };
292*4882a593Smuzhiyun static int mt7622_antsel12_funcs[] = { 5, };
293*4882a593Smuzhiyun static int mt7622_antsel13_pins[] = { 74, };
294*4882a593Smuzhiyun static int mt7622_antsel13_funcs[] = { 5, };
295*4882a593Smuzhiyun static int mt7622_antsel14_pins[] = { 75, };
296*4882a593Smuzhiyun static int mt7622_antsel14_funcs[] = { 5, };
297*4882a593Smuzhiyun static int mt7622_antsel15_pins[] = { 76, };
298*4882a593Smuzhiyun static int mt7622_antsel15_funcs[] = { 5, };
299*4882a593Smuzhiyun static int mt7622_antsel16_pins[] = { 77, };
300*4882a593Smuzhiyun static int mt7622_antsel16_funcs[] = { 5, };
301*4882a593Smuzhiyun static int mt7622_antsel17_pins[] = { 22, };
302*4882a593Smuzhiyun static int mt7622_antsel17_funcs[] = { 5, };
303*4882a593Smuzhiyun static int mt7622_antsel18_pins[] = { 79, };
304*4882a593Smuzhiyun static int mt7622_antsel18_funcs[] = { 5, };
305*4882a593Smuzhiyun static int mt7622_antsel19_pins[] = { 80, };
306*4882a593Smuzhiyun static int mt7622_antsel19_funcs[] = { 5, };
307*4882a593Smuzhiyun static int mt7622_antsel20_pins[] = { 81, };
308*4882a593Smuzhiyun static int mt7622_antsel20_funcs[] = { 5, };
309*4882a593Smuzhiyun static int mt7622_antsel21_pins[] = { 82, };
310*4882a593Smuzhiyun static int mt7622_antsel21_funcs[] = { 5, };
311*4882a593Smuzhiyun static int mt7622_antsel22_pins[] = { 14, };
312*4882a593Smuzhiyun static int mt7622_antsel22_funcs[] = { 5, };
313*4882a593Smuzhiyun static int mt7622_antsel23_pins[] = { 15, };
314*4882a593Smuzhiyun static int mt7622_antsel23_funcs[] = { 5, };
315*4882a593Smuzhiyun static int mt7622_antsel24_pins[] = { 16, };
316*4882a593Smuzhiyun static int mt7622_antsel24_funcs[] = { 5, };
317*4882a593Smuzhiyun static int mt7622_antsel25_pins[] = { 17, };
318*4882a593Smuzhiyun static int mt7622_antsel25_funcs[] = { 5, };
319*4882a593Smuzhiyun static int mt7622_antsel26_pins[] = { 18, };
320*4882a593Smuzhiyun static int mt7622_antsel26_funcs[] = { 5, };
321*4882a593Smuzhiyun static int mt7622_antsel27_pins[] = { 19, };
322*4882a593Smuzhiyun static int mt7622_antsel27_funcs[] = { 5, };
323*4882a593Smuzhiyun static int mt7622_antsel28_pins[] = { 20, };
324*4882a593Smuzhiyun static int mt7622_antsel28_funcs[] = { 5, };
325*4882a593Smuzhiyun static int mt7622_antsel29_pins[] = { 21, };
326*4882a593Smuzhiyun static int mt7622_antsel29_funcs[] = { 5, };
327*4882a593Smuzhiyun
328*4882a593Smuzhiyun /* EMMC */
329*4882a593Smuzhiyun static int mt7622_emmc_pins[] = { 40, 41, 42, 43, 44, 45, 47, 48, 49, 50, };
330*4882a593Smuzhiyun static int mt7622_emmc_funcs[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, };
331*4882a593Smuzhiyun
332*4882a593Smuzhiyun static int mt7622_emmc_rst_pins[] = { 37, };
333*4882a593Smuzhiyun static int mt7622_emmc_rst_funcs[] = { 1, };
334*4882a593Smuzhiyun
335*4882a593Smuzhiyun /* LED for EPHY */
336*4882a593Smuzhiyun static int mt7622_ephy_leds_pins[] = { 86, 91, 92, 93, 94, };
337*4882a593Smuzhiyun static int mt7622_ephy_leds_funcs[] = { 0, 0, 0, 0, 0, };
338*4882a593Smuzhiyun static int mt7622_ephy0_led_pins[] = { 86, };
339*4882a593Smuzhiyun static int mt7622_ephy0_led_funcs[] = { 0, };
340*4882a593Smuzhiyun static int mt7622_ephy1_led_pins[] = { 91, };
341*4882a593Smuzhiyun static int mt7622_ephy1_led_funcs[] = { 2, };
342*4882a593Smuzhiyun static int mt7622_ephy2_led_pins[] = { 92, };
343*4882a593Smuzhiyun static int mt7622_ephy2_led_funcs[] = { 2, };
344*4882a593Smuzhiyun static int mt7622_ephy3_led_pins[] = { 93, };
345*4882a593Smuzhiyun static int mt7622_ephy3_led_funcs[] = { 2, };
346*4882a593Smuzhiyun static int mt7622_ephy4_led_pins[] = { 94, };
347*4882a593Smuzhiyun static int mt7622_ephy4_led_funcs[] = { 2, };
348*4882a593Smuzhiyun
349*4882a593Smuzhiyun /* Embedded Switch */
350*4882a593Smuzhiyun static int mt7622_esw_pins[] = { 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
351*4882a593Smuzhiyun 62, 63, 64, 65, 66, 67, 68, 69, 70, };
352*4882a593Smuzhiyun static int mt7622_esw_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
353*4882a593Smuzhiyun 0, 0, 0, 0, 0, 0, 0, 0, 0, };
354*4882a593Smuzhiyun static int mt7622_esw_p0_p1_pins[] = { 51, 52, 53, 54, 55, 56, 57, 58, };
355*4882a593Smuzhiyun static int mt7622_esw_p0_p1_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, };
356*4882a593Smuzhiyun static int mt7622_esw_p2_p3_p4_pins[] = { 59, 60, 61, 62, 63, 64, 65, 66, 67,
357*4882a593Smuzhiyun 68, 69, 70, };
358*4882a593Smuzhiyun static int mt7622_esw_p2_p3_p4_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
359*4882a593Smuzhiyun 0, 0, 0, };
360*4882a593Smuzhiyun /* RGMII via ESW */
361*4882a593Smuzhiyun static int mt7622_rgmii_via_esw_pins[] = { 59, 60, 61, 62, 63, 64, 65, 66,
362*4882a593Smuzhiyun 67, 68, 69, 70, };
363*4882a593Smuzhiyun static int mt7622_rgmii_via_esw_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
364*4882a593Smuzhiyun 0, };
365*4882a593Smuzhiyun
366*4882a593Smuzhiyun /* RGMII via GMAC1 */
367*4882a593Smuzhiyun static int mt7622_rgmii_via_gmac1_pins[] = { 59, 60, 61, 62, 63, 64, 65, 66,
368*4882a593Smuzhiyun 67, 68, 69, 70, };
369*4882a593Smuzhiyun static int mt7622_rgmii_via_gmac1_funcs[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
370*4882a593Smuzhiyun 2, };
371*4882a593Smuzhiyun
372*4882a593Smuzhiyun /* RGMII via GMAC2 */
373*4882a593Smuzhiyun static int mt7622_rgmii_via_gmac2_pins[] = { 25, 26, 27, 28, 29, 30, 31, 32,
374*4882a593Smuzhiyun 33, 34, 35, 36, };
375*4882a593Smuzhiyun static int mt7622_rgmii_via_gmac2_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
376*4882a593Smuzhiyun 0, };
377*4882a593Smuzhiyun
378*4882a593Smuzhiyun /* I2C */
379*4882a593Smuzhiyun static int mt7622_i2c0_pins[] = { 14, 15, };
380*4882a593Smuzhiyun static int mt7622_i2c0_funcs[] = { 0, 0, };
381*4882a593Smuzhiyun static int mt7622_i2c1_0_pins[] = { 55, 56, };
382*4882a593Smuzhiyun static int mt7622_i2c1_0_funcs[] = { 0, 0, };
383*4882a593Smuzhiyun static int mt7622_i2c1_1_pins[] = { 73, 74, };
384*4882a593Smuzhiyun static int mt7622_i2c1_1_funcs[] = { 3, 3, };
385*4882a593Smuzhiyun static int mt7622_i2c1_2_pins[] = { 87, 88, };
386*4882a593Smuzhiyun static int mt7622_i2c1_2_funcs[] = { 0, 0, };
387*4882a593Smuzhiyun static int mt7622_i2c2_0_pins[] = { 57, 58, };
388*4882a593Smuzhiyun static int mt7622_i2c2_0_funcs[] = { 0, 0, };
389*4882a593Smuzhiyun static int mt7622_i2c2_1_pins[] = { 75, 76, };
390*4882a593Smuzhiyun static int mt7622_i2c2_1_funcs[] = { 3, 3, };
391*4882a593Smuzhiyun static int mt7622_i2c2_2_pins[] = { 89, 90, };
392*4882a593Smuzhiyun static int mt7622_i2c2_2_funcs[] = { 0, 0, };
393*4882a593Smuzhiyun
394*4882a593Smuzhiyun /* I2S */
395*4882a593Smuzhiyun static int mt7622_i2s_in_mclk_bclk_ws_pins[] = { 3, 4, 5, };
396*4882a593Smuzhiyun static int mt7622_i2s_in_mclk_bclk_ws_funcs[] = { 3, 3, 0, };
397*4882a593Smuzhiyun static int mt7622_i2s1_in_data_pins[] = { 1, };
398*4882a593Smuzhiyun static int mt7622_i2s1_in_data_funcs[] = { 0, };
399*4882a593Smuzhiyun static int mt7622_i2s2_in_data_pins[] = { 16, };
400*4882a593Smuzhiyun static int mt7622_i2s2_in_data_funcs[] = { 0, };
401*4882a593Smuzhiyun static int mt7622_i2s3_in_data_pins[] = { 17, };
402*4882a593Smuzhiyun static int mt7622_i2s3_in_data_funcs[] = { 0, };
403*4882a593Smuzhiyun static int mt7622_i2s4_in_data_pins[] = { 18, };
404*4882a593Smuzhiyun static int mt7622_i2s4_in_data_funcs[] = { 0, };
405*4882a593Smuzhiyun static int mt7622_i2s_out_mclk_bclk_ws_pins[] = { 3, 4, 5, };
406*4882a593Smuzhiyun static int mt7622_i2s_out_mclk_bclk_ws_funcs[] = { 0, 0, 0, };
407*4882a593Smuzhiyun static int mt7622_i2s1_out_data_pins[] = { 2, };
408*4882a593Smuzhiyun static int mt7622_i2s1_out_data_funcs[] = { 0, };
409*4882a593Smuzhiyun static int mt7622_i2s2_out_data_pins[] = { 19, };
410*4882a593Smuzhiyun static int mt7622_i2s2_out_data_funcs[] = { 0, };
411*4882a593Smuzhiyun static int mt7622_i2s3_out_data_pins[] = { 20, };
412*4882a593Smuzhiyun static int mt7622_i2s3_out_data_funcs[] = { 0, };
413*4882a593Smuzhiyun static int mt7622_i2s4_out_data_pins[] = { 21, };
414*4882a593Smuzhiyun static int mt7622_i2s4_out_data_funcs[] = { 0, };
415*4882a593Smuzhiyun
416*4882a593Smuzhiyun /* IR */
417*4882a593Smuzhiyun static int mt7622_ir_0_tx_pins[] = { 16, };
418*4882a593Smuzhiyun static int mt7622_ir_0_tx_funcs[] = { 4, };
419*4882a593Smuzhiyun static int mt7622_ir_1_tx_pins[] = { 59, };
420*4882a593Smuzhiyun static int mt7622_ir_1_tx_funcs[] = { 5, };
421*4882a593Smuzhiyun static int mt7622_ir_2_tx_pins[] = { 99, };
422*4882a593Smuzhiyun static int mt7622_ir_2_tx_funcs[] = { 3, };
423*4882a593Smuzhiyun static int mt7622_ir_0_rx_pins[] = { 17, };
424*4882a593Smuzhiyun static int mt7622_ir_0_rx_funcs[] = { 4, };
425*4882a593Smuzhiyun static int mt7622_ir_1_rx_pins[] = { 60, };
426*4882a593Smuzhiyun static int mt7622_ir_1_rx_funcs[] = { 5, };
427*4882a593Smuzhiyun static int mt7622_ir_2_rx_pins[] = { 100, };
428*4882a593Smuzhiyun static int mt7622_ir_2_rx_funcs[] = { 3, };
429*4882a593Smuzhiyun
430*4882a593Smuzhiyun /* MDIO */
431*4882a593Smuzhiyun static int mt7622_mdc_mdio_pins[] = { 23, 24, };
432*4882a593Smuzhiyun static int mt7622_mdc_mdio_funcs[] = { 0, 0, };
433*4882a593Smuzhiyun
434*4882a593Smuzhiyun /* PCIE */
435*4882a593Smuzhiyun static int mt7622_pcie0_0_waken_pins[] = { 14, };
436*4882a593Smuzhiyun static int mt7622_pcie0_0_waken_funcs[] = { 2, };
437*4882a593Smuzhiyun static int mt7622_pcie0_0_clkreq_pins[] = { 15, };
438*4882a593Smuzhiyun static int mt7622_pcie0_0_clkreq_funcs[] = { 2, };
439*4882a593Smuzhiyun static int mt7622_pcie0_1_waken_pins[] = { 79, };
440*4882a593Smuzhiyun static int mt7622_pcie0_1_waken_funcs[] = { 4, };
441*4882a593Smuzhiyun static int mt7622_pcie0_1_clkreq_pins[] = { 80, };
442*4882a593Smuzhiyun static int mt7622_pcie0_1_clkreq_funcs[] = { 4, };
443*4882a593Smuzhiyun static int mt7622_pcie1_0_waken_pins[] = { 14, };
444*4882a593Smuzhiyun static int mt7622_pcie1_0_waken_funcs[] = { 3, };
445*4882a593Smuzhiyun static int mt7622_pcie1_0_clkreq_pins[] = { 15, };
446*4882a593Smuzhiyun static int mt7622_pcie1_0_clkreq_funcs[] = { 3, };
447*4882a593Smuzhiyun
448*4882a593Smuzhiyun static int mt7622_pcie0_pad_perst_pins[] = { 83, };
449*4882a593Smuzhiyun static int mt7622_pcie0_pad_perst_funcs[] = { 0, };
450*4882a593Smuzhiyun static int mt7622_pcie1_pad_perst_pins[] = { 84, };
451*4882a593Smuzhiyun static int mt7622_pcie1_pad_perst_funcs[] = { 0, };
452*4882a593Smuzhiyun
453*4882a593Smuzhiyun /* PMIC bus */
454*4882a593Smuzhiyun static int mt7622_pmic_bus_pins[] = { 71, 72, };
455*4882a593Smuzhiyun static int mt7622_pmic_bus_funcs[] = { 0, 0, };
456*4882a593Smuzhiyun
457*4882a593Smuzhiyun /* Parallel NAND */
458*4882a593Smuzhiyun static int mt7622_pnand_pins[] = { 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
459*4882a593Smuzhiyun 48, 49, 50, };
460*4882a593Smuzhiyun static int mt7622_pnand_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
461*4882a593Smuzhiyun 0, };
462*4882a593Smuzhiyun
463*4882a593Smuzhiyun /* PWM */
464*4882a593Smuzhiyun static int mt7622_pwm_ch1_0_pins[] = { 51, };
465*4882a593Smuzhiyun static int mt7622_pwm_ch1_0_funcs[] = { 3, };
466*4882a593Smuzhiyun static int mt7622_pwm_ch1_1_pins[] = { 73, };
467*4882a593Smuzhiyun static int mt7622_pwm_ch1_1_funcs[] = { 4, };
468*4882a593Smuzhiyun static int mt7622_pwm_ch1_2_pins[] = { 95, };
469*4882a593Smuzhiyun static int mt7622_pwm_ch1_2_funcs[] = { 0, };
470*4882a593Smuzhiyun static int mt7622_pwm_ch2_0_pins[] = { 52, };
471*4882a593Smuzhiyun static int mt7622_pwm_ch2_0_funcs[] = { 3, };
472*4882a593Smuzhiyun static int mt7622_pwm_ch2_1_pins[] = { 74, };
473*4882a593Smuzhiyun static int mt7622_pwm_ch2_1_funcs[] = { 4, };
474*4882a593Smuzhiyun static int mt7622_pwm_ch2_2_pins[] = { 96, };
475*4882a593Smuzhiyun static int mt7622_pwm_ch2_2_funcs[] = { 0, };
476*4882a593Smuzhiyun static int mt7622_pwm_ch3_0_pins[] = { 53, };
477*4882a593Smuzhiyun static int mt7622_pwm_ch3_0_funcs[] = { 3, };
478*4882a593Smuzhiyun static int mt7622_pwm_ch3_1_pins[] = { 75, };
479*4882a593Smuzhiyun static int mt7622_pwm_ch3_1_funcs[] = { 4, };
480*4882a593Smuzhiyun static int mt7622_pwm_ch3_2_pins[] = { 97, };
481*4882a593Smuzhiyun static int mt7622_pwm_ch3_2_funcs[] = { 0, };
482*4882a593Smuzhiyun static int mt7622_pwm_ch4_0_pins[] = { 54, };
483*4882a593Smuzhiyun static int mt7622_pwm_ch4_0_funcs[] = { 3, };
484*4882a593Smuzhiyun static int mt7622_pwm_ch4_1_pins[] = { 67, };
485*4882a593Smuzhiyun static int mt7622_pwm_ch4_1_funcs[] = { 3, };
486*4882a593Smuzhiyun static int mt7622_pwm_ch4_2_pins[] = { 76, };
487*4882a593Smuzhiyun static int mt7622_pwm_ch4_2_funcs[] = { 4, };
488*4882a593Smuzhiyun static int mt7622_pwm_ch4_3_pins[] = { 98, };
489*4882a593Smuzhiyun static int mt7622_pwm_ch4_3_funcs[] = { 0, };
490*4882a593Smuzhiyun static int mt7622_pwm_ch5_0_pins[] = { 68, };
491*4882a593Smuzhiyun static int mt7622_pwm_ch5_0_funcs[] = { 3, };
492*4882a593Smuzhiyun static int mt7622_pwm_ch5_1_pins[] = { 77, };
493*4882a593Smuzhiyun static int mt7622_pwm_ch5_1_funcs[] = { 4, };
494*4882a593Smuzhiyun static int mt7622_pwm_ch5_2_pins[] = { 99, };
495*4882a593Smuzhiyun static int mt7622_pwm_ch5_2_funcs[] = { 0, };
496*4882a593Smuzhiyun static int mt7622_pwm_ch6_0_pins[] = { 69, };
497*4882a593Smuzhiyun static int mt7622_pwm_ch6_0_funcs[] = { 3, };
498*4882a593Smuzhiyun static int mt7622_pwm_ch6_1_pins[] = { 78, };
499*4882a593Smuzhiyun static int mt7622_pwm_ch6_1_funcs[] = { 4, };
500*4882a593Smuzhiyun static int mt7622_pwm_ch6_2_pins[] = { 81, };
501*4882a593Smuzhiyun static int mt7622_pwm_ch6_2_funcs[] = { 4, };
502*4882a593Smuzhiyun static int mt7622_pwm_ch6_3_pins[] = { 100, };
503*4882a593Smuzhiyun static int mt7622_pwm_ch6_3_funcs[] = { 0, };
504*4882a593Smuzhiyun static int mt7622_pwm_ch7_0_pins[] = { 70, };
505*4882a593Smuzhiyun static int mt7622_pwm_ch7_0_funcs[] = { 3, };
506*4882a593Smuzhiyun static int mt7622_pwm_ch7_1_pins[] = { 82, };
507*4882a593Smuzhiyun static int mt7622_pwm_ch7_1_funcs[] = { 4, };
508*4882a593Smuzhiyun static int mt7622_pwm_ch7_2_pins[] = { 101, };
509*4882a593Smuzhiyun static int mt7622_pwm_ch7_2_funcs[] = { 0, };
510*4882a593Smuzhiyun
511*4882a593Smuzhiyun /* SD */
512*4882a593Smuzhiyun static int mt7622_sd_0_pins[] = { 16, 17, 18, 19, 20, 21, };
513*4882a593Smuzhiyun static int mt7622_sd_0_funcs[] = { 2, 2, 2, 2, 2, 2, };
514*4882a593Smuzhiyun static int mt7622_sd_1_pins[] = { 25, 26, 27, 28, 29, 30, };
515*4882a593Smuzhiyun static int mt7622_sd_1_funcs[] = { 2, 2, 2, 2, 2, 2, };
516*4882a593Smuzhiyun
517*4882a593Smuzhiyun /* Serial NAND */
518*4882a593Smuzhiyun static int mt7622_snfi_pins[] = { 8, 9, 10, 11, 12, 13, };
519*4882a593Smuzhiyun static int mt7622_snfi_funcs[] = { 2, 2, 2, 2, 2, 2, };
520*4882a593Smuzhiyun
521*4882a593Smuzhiyun /* SPI NOR */
522*4882a593Smuzhiyun static int mt7622_spi_pins[] = { 8, 9, 10, 11, 12, 13 };
523*4882a593Smuzhiyun static int mt7622_spi_funcs[] = { 0, 0, 0, 0, 0, 0, };
524*4882a593Smuzhiyun
525*4882a593Smuzhiyun /* SPIC */
526*4882a593Smuzhiyun static int mt7622_spic0_0_pins[] = { 63, 64, 65, 66, };
527*4882a593Smuzhiyun static int mt7622_spic0_0_funcs[] = { 4, 4, 4, 4, };
528*4882a593Smuzhiyun static int mt7622_spic0_1_pins[] = { 79, 80, 81, 82, };
529*4882a593Smuzhiyun static int mt7622_spic0_1_funcs[] = { 3, 3, 3, 3, };
530*4882a593Smuzhiyun static int mt7622_spic1_0_pins[] = { 67, 68, 69, 70, };
531*4882a593Smuzhiyun static int mt7622_spic1_0_funcs[] = { 4, 4, 4, 4, };
532*4882a593Smuzhiyun static int mt7622_spic1_1_pins[] = { 73, 74, 75, 76, };
533*4882a593Smuzhiyun static int mt7622_spic1_1_funcs[] = { 0, 0, 0, 0, };
534*4882a593Smuzhiyun static int mt7622_spic2_0_pins[] = { 10, 11, 12, 13, };
535*4882a593Smuzhiyun static int mt7622_spic2_0_funcs[] = { 0, 0, 0, 0, };
536*4882a593Smuzhiyun static int mt7622_spic2_0_wp_hold_pins[] = { 8, 9, };
537*4882a593Smuzhiyun static int mt7622_spic2_0_wp_hold_funcs[] = { 0, 0, };
538*4882a593Smuzhiyun
539*4882a593Smuzhiyun /* TDM */
540*4882a593Smuzhiyun static int mt7622_tdm_0_out_mclk_bclk_ws_pins[] = { 8, 9, 10, };
541*4882a593Smuzhiyun static int mt7622_tdm_0_out_mclk_bclk_ws_funcs[] = { 3, 3, 3, };
542*4882a593Smuzhiyun static int mt7622_tdm_0_in_mclk_bclk_ws_pins[] = { 11, 12, 13, };
543*4882a593Smuzhiyun static int mt7622_tdm_0_in_mclk_bclk_ws_funcs[] = { 3, 3, 3, };
544*4882a593Smuzhiyun static int mt7622_tdm_0_out_data_pins[] = { 20, };
545*4882a593Smuzhiyun static int mt7622_tdm_0_out_data_funcs[] = { 3, };
546*4882a593Smuzhiyun static int mt7622_tdm_0_in_data_pins[] = { 21, };
547*4882a593Smuzhiyun static int mt7622_tdm_0_in_data_funcs[] = { 3, };
548*4882a593Smuzhiyun static int mt7622_tdm_1_out_mclk_bclk_ws_pins[] = { 57, 58, 59, };
549*4882a593Smuzhiyun static int mt7622_tdm_1_out_mclk_bclk_ws_funcs[] = { 3, 3, 3, };
550*4882a593Smuzhiyun static int mt7622_tdm_1_in_mclk_bclk_ws_pins[] = { 60, 61, 62, };
551*4882a593Smuzhiyun static int mt7622_tdm_1_in_mclk_bclk_ws_funcs[] = { 3, 3, 3, };
552*4882a593Smuzhiyun static int mt7622_tdm_1_out_data_pins[] = { 55, };
553*4882a593Smuzhiyun static int mt7622_tdm_1_out_data_funcs[] = { 3, };
554*4882a593Smuzhiyun static int mt7622_tdm_1_in_data_pins[] = { 56, };
555*4882a593Smuzhiyun static int mt7622_tdm_1_in_data_funcs[] = { 3, };
556*4882a593Smuzhiyun
557*4882a593Smuzhiyun /* UART */
558*4882a593Smuzhiyun static int mt7622_uart0_0_tx_rx_pins[] = { 6, 7, };
559*4882a593Smuzhiyun static int mt7622_uart0_0_tx_rx_funcs[] = { 0, 0, };
560*4882a593Smuzhiyun static int mt7622_uart1_0_tx_rx_pins[] = { 55, 56, };
561*4882a593Smuzhiyun static int mt7622_uart1_0_tx_rx_funcs[] = { 2, 2, };
562*4882a593Smuzhiyun static int mt7622_uart1_0_rts_cts_pins[] = { 57, 58, };
563*4882a593Smuzhiyun static int mt7622_uart1_0_rts_cts_funcs[] = { 2, 2, };
564*4882a593Smuzhiyun static int mt7622_uart1_1_tx_rx_pins[] = { 73, 74, };
565*4882a593Smuzhiyun static int mt7622_uart1_1_tx_rx_funcs[] = { 2, 2, };
566*4882a593Smuzhiyun static int mt7622_uart1_1_rts_cts_pins[] = { 75, 76, };
567*4882a593Smuzhiyun static int mt7622_uart1_1_rts_cts_funcs[] = { 2, 2, };
568*4882a593Smuzhiyun static int mt7622_uart2_0_tx_rx_pins[] = { 3, 4, };
569*4882a593Smuzhiyun static int mt7622_uart2_0_tx_rx_funcs[] = { 2, 2, };
570*4882a593Smuzhiyun static int mt7622_uart2_0_rts_cts_pins[] = { 1, 2, };
571*4882a593Smuzhiyun static int mt7622_uart2_0_rts_cts_funcs[] = { 2, 2, };
572*4882a593Smuzhiyun static int mt7622_uart2_1_tx_rx_pins[] = { 51, 52, };
573*4882a593Smuzhiyun static int mt7622_uart2_1_tx_rx_funcs[] = { 0, 0, };
574*4882a593Smuzhiyun static int mt7622_uart2_1_rts_cts_pins[] = { 53, 54, };
575*4882a593Smuzhiyun static int mt7622_uart2_1_rts_cts_funcs[] = { 0, 0, };
576*4882a593Smuzhiyun static int mt7622_uart2_2_tx_rx_pins[] = { 59, 60, };
577*4882a593Smuzhiyun static int mt7622_uart2_2_tx_rx_funcs[] = { 4, 4, };
578*4882a593Smuzhiyun static int mt7622_uart2_2_rts_cts_pins[] = { 61, 62, };
579*4882a593Smuzhiyun static int mt7622_uart2_2_rts_cts_funcs[] = { 4, 4, };
580*4882a593Smuzhiyun static int mt7622_uart2_3_tx_rx_pins[] = { 95, 96, };
581*4882a593Smuzhiyun static int mt7622_uart2_3_tx_rx_funcs[] = { 3, 3, };
582*4882a593Smuzhiyun static int mt7622_uart3_0_tx_rx_pins[] = { 57, 58, };
583*4882a593Smuzhiyun static int mt7622_uart3_0_tx_rx_funcs[] = { 5, 5, };
584*4882a593Smuzhiyun static int mt7622_uart3_1_tx_rx_pins[] = { 81, 82, };
585*4882a593Smuzhiyun static int mt7622_uart3_1_tx_rx_funcs[] = { 0, 0, };
586*4882a593Smuzhiyun static int mt7622_uart3_1_rts_cts_pins[] = { 79, 80, };
587*4882a593Smuzhiyun static int mt7622_uart3_1_rts_cts_funcs[] = { 0, 0, };
588*4882a593Smuzhiyun static int mt7622_uart4_0_tx_rx_pins[] = { 61, 62, };
589*4882a593Smuzhiyun static int mt7622_uart4_0_tx_rx_funcs[] = { 5, 5, };
590*4882a593Smuzhiyun static int mt7622_uart4_1_tx_rx_pins[] = { 91, 92, };
591*4882a593Smuzhiyun static int mt7622_uart4_1_tx_rx_funcs[] = { 0, 0, };
592*4882a593Smuzhiyun static int mt7622_uart4_1_rts_cts_pins[] = { 93, 94 };
593*4882a593Smuzhiyun static int mt7622_uart4_1_rts_cts_funcs[] = { 0, 0, };
594*4882a593Smuzhiyun static int mt7622_uart4_2_tx_rx_pins[] = { 97, 98, };
595*4882a593Smuzhiyun static int mt7622_uart4_2_tx_rx_funcs[] = { 2, 2, };
596*4882a593Smuzhiyun static int mt7622_uart4_2_rts_cts_pins[] = { 95, 96 };
597*4882a593Smuzhiyun static int mt7622_uart4_2_rts_cts_funcs[] = { 2, 2, };
598*4882a593Smuzhiyun
599*4882a593Smuzhiyun /* Watchdog */
600*4882a593Smuzhiyun static int mt7622_watchdog_pins[] = { 78, };
601*4882a593Smuzhiyun static int mt7622_watchdog_funcs[] = { 0, };
602*4882a593Smuzhiyun
603*4882a593Smuzhiyun /* WLAN LED */
604*4882a593Smuzhiyun static int mt7622_wled_pins[] = { 85, };
605*4882a593Smuzhiyun static int mt7622_wled_funcs[] = { 0, };
606*4882a593Smuzhiyun
607*4882a593Smuzhiyun static const struct group_desc mt7622_groups[] = {
608*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel0", mt7622_antsel0),
609*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel1", mt7622_antsel1),
610*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel2", mt7622_antsel2),
611*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel3", mt7622_antsel3),
612*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel4", mt7622_antsel4),
613*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel5", mt7622_antsel5),
614*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel6", mt7622_antsel6),
615*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel7", mt7622_antsel7),
616*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel8", mt7622_antsel8),
617*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel9", mt7622_antsel9),
618*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel10", mt7622_antsel10),
619*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel11", mt7622_antsel11),
620*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel12", mt7622_antsel12),
621*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel13", mt7622_antsel13),
622*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel14", mt7622_antsel14),
623*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel15", mt7622_antsel15),
624*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel16", mt7622_antsel16),
625*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel17", mt7622_antsel17),
626*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel18", mt7622_antsel18),
627*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel19", mt7622_antsel19),
628*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel20", mt7622_antsel20),
629*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel21", mt7622_antsel21),
630*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel22", mt7622_antsel22),
631*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel23", mt7622_antsel23),
632*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel24", mt7622_antsel24),
633*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel25", mt7622_antsel25),
634*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel26", mt7622_antsel26),
635*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel27", mt7622_antsel27),
636*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel28", mt7622_antsel28),
637*4882a593Smuzhiyun PINCTRL_PIN_GROUP("antsel29", mt7622_antsel29),
638*4882a593Smuzhiyun PINCTRL_PIN_GROUP("emmc", mt7622_emmc),
639*4882a593Smuzhiyun PINCTRL_PIN_GROUP("emmc_rst", mt7622_emmc_rst),
640*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ephy_leds", mt7622_ephy_leds),
641*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ephy0_led", mt7622_ephy0_led),
642*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ephy1_led", mt7622_ephy1_led),
643*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ephy2_led", mt7622_ephy2_led),
644*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ephy3_led", mt7622_ephy3_led),
645*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ephy4_led", mt7622_ephy4_led),
646*4882a593Smuzhiyun PINCTRL_PIN_GROUP("esw", mt7622_esw),
647*4882a593Smuzhiyun PINCTRL_PIN_GROUP("esw_p0_p1", mt7622_esw_p0_p1),
648*4882a593Smuzhiyun PINCTRL_PIN_GROUP("esw_p2_p3_p4", mt7622_esw_p2_p3_p4),
649*4882a593Smuzhiyun PINCTRL_PIN_GROUP("rgmii_via_esw", mt7622_rgmii_via_esw),
650*4882a593Smuzhiyun PINCTRL_PIN_GROUP("rgmii_via_gmac1", mt7622_rgmii_via_gmac1),
651*4882a593Smuzhiyun PINCTRL_PIN_GROUP("rgmii_via_gmac2", mt7622_rgmii_via_gmac2),
652*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2c0", mt7622_i2c0),
653*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2c1_0", mt7622_i2c1_0),
654*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2c1_1", mt7622_i2c1_1),
655*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2c1_2", mt7622_i2c1_2),
656*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2c2_0", mt7622_i2c2_0),
657*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2c2_1", mt7622_i2c2_1),
658*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2c2_2", mt7622_i2c2_2),
659*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2s_out_mclk_bclk_ws", mt7622_i2s_out_mclk_bclk_ws),
660*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2s_in_mclk_bclk_ws", mt7622_i2s_in_mclk_bclk_ws),
661*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2s1_in_data", mt7622_i2s1_in_data),
662*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2s2_in_data", mt7622_i2s2_in_data),
663*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2s3_in_data", mt7622_i2s3_in_data),
664*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2s4_in_data", mt7622_i2s4_in_data),
665*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2s1_out_data", mt7622_i2s1_out_data),
666*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2s2_out_data", mt7622_i2s2_out_data),
667*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2s3_out_data", mt7622_i2s3_out_data),
668*4882a593Smuzhiyun PINCTRL_PIN_GROUP("i2s4_out_data", mt7622_i2s4_out_data),
669*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ir_0_tx", mt7622_ir_0_tx),
670*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ir_1_tx", mt7622_ir_1_tx),
671*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ir_2_tx", mt7622_ir_2_tx),
672*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ir_0_rx", mt7622_ir_0_rx),
673*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ir_1_rx", mt7622_ir_1_rx),
674*4882a593Smuzhiyun PINCTRL_PIN_GROUP("ir_2_rx", mt7622_ir_2_rx),
675*4882a593Smuzhiyun PINCTRL_PIN_GROUP("mdc_mdio", mt7622_mdc_mdio),
676*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pcie0_0_waken", mt7622_pcie0_0_waken),
677*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pcie0_0_clkreq", mt7622_pcie0_0_clkreq),
678*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pcie0_1_waken", mt7622_pcie0_1_waken),
679*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pcie0_1_clkreq", mt7622_pcie0_1_clkreq),
680*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pcie1_0_waken", mt7622_pcie1_0_waken),
681*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pcie1_0_clkreq", mt7622_pcie1_0_clkreq),
682*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pcie0_pad_perst", mt7622_pcie0_pad_perst),
683*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pcie1_pad_perst", mt7622_pcie1_pad_perst),
684*4882a593Smuzhiyun PINCTRL_PIN_GROUP("par_nand", mt7622_pnand),
685*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pmic_bus", mt7622_pmic_bus),
686*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch1_0", mt7622_pwm_ch1_0),
687*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch1_1", mt7622_pwm_ch1_1),
688*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch1_2", mt7622_pwm_ch1_2),
689*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch2_0", mt7622_pwm_ch2_0),
690*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch2_1", mt7622_pwm_ch2_1),
691*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch2_2", mt7622_pwm_ch2_2),
692*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch3_0", mt7622_pwm_ch3_0),
693*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch3_1", mt7622_pwm_ch3_1),
694*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch3_2", mt7622_pwm_ch3_2),
695*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch4_0", mt7622_pwm_ch4_0),
696*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch4_1", mt7622_pwm_ch4_1),
697*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch4_2", mt7622_pwm_ch4_2),
698*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch4_3", mt7622_pwm_ch4_3),
699*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch5_0", mt7622_pwm_ch5_0),
700*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch5_1", mt7622_pwm_ch5_1),
701*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch5_2", mt7622_pwm_ch5_2),
702*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch6_0", mt7622_pwm_ch6_0),
703*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch6_1", mt7622_pwm_ch6_1),
704*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch6_2", mt7622_pwm_ch6_2),
705*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch6_3", mt7622_pwm_ch6_3),
706*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch7_0", mt7622_pwm_ch7_0),
707*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch7_1", mt7622_pwm_ch7_1),
708*4882a593Smuzhiyun PINCTRL_PIN_GROUP("pwm_ch7_2", mt7622_pwm_ch7_2),
709*4882a593Smuzhiyun PINCTRL_PIN_GROUP("sd_0", mt7622_sd_0),
710*4882a593Smuzhiyun PINCTRL_PIN_GROUP("sd_1", mt7622_sd_1),
711*4882a593Smuzhiyun PINCTRL_PIN_GROUP("snfi", mt7622_snfi),
712*4882a593Smuzhiyun PINCTRL_PIN_GROUP("spi_nor", mt7622_spi),
713*4882a593Smuzhiyun PINCTRL_PIN_GROUP("spic0_0", mt7622_spic0_0),
714*4882a593Smuzhiyun PINCTRL_PIN_GROUP("spic0_1", mt7622_spic0_1),
715*4882a593Smuzhiyun PINCTRL_PIN_GROUP("spic1_0", mt7622_spic1_0),
716*4882a593Smuzhiyun PINCTRL_PIN_GROUP("spic1_1", mt7622_spic1_1),
717*4882a593Smuzhiyun PINCTRL_PIN_GROUP("spic2_0", mt7622_spic2_0),
718*4882a593Smuzhiyun PINCTRL_PIN_GROUP("spic2_0_wp_hold", mt7622_spic2_0_wp_hold),
719*4882a593Smuzhiyun PINCTRL_PIN_GROUP("tdm_0_out_mclk_bclk_ws",
720*4882a593Smuzhiyun mt7622_tdm_0_out_mclk_bclk_ws),
721*4882a593Smuzhiyun PINCTRL_PIN_GROUP("tdm_0_in_mclk_bclk_ws",
722*4882a593Smuzhiyun mt7622_tdm_0_in_mclk_bclk_ws),
723*4882a593Smuzhiyun PINCTRL_PIN_GROUP("tdm_0_out_data", mt7622_tdm_0_out_data),
724*4882a593Smuzhiyun PINCTRL_PIN_GROUP("tdm_0_in_data", mt7622_tdm_0_in_data),
725*4882a593Smuzhiyun PINCTRL_PIN_GROUP("tdm_1_out_mclk_bclk_ws",
726*4882a593Smuzhiyun mt7622_tdm_1_out_mclk_bclk_ws),
727*4882a593Smuzhiyun PINCTRL_PIN_GROUP("tdm_1_in_mclk_bclk_ws",
728*4882a593Smuzhiyun mt7622_tdm_1_in_mclk_bclk_ws),
729*4882a593Smuzhiyun PINCTRL_PIN_GROUP("tdm_1_out_data", mt7622_tdm_1_out_data),
730*4882a593Smuzhiyun PINCTRL_PIN_GROUP("tdm_1_in_data", mt7622_tdm_1_in_data),
731*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart0_0_tx_rx", mt7622_uart0_0_tx_rx),
732*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart1_0_tx_rx", mt7622_uart1_0_tx_rx),
733*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart1_0_rts_cts", mt7622_uart1_0_rts_cts),
734*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart1_1_tx_rx", mt7622_uart1_1_tx_rx),
735*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart1_1_rts_cts", mt7622_uart1_1_rts_cts),
736*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart2_0_tx_rx", mt7622_uart2_0_tx_rx),
737*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart2_0_rts_cts", mt7622_uart2_0_rts_cts),
738*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart2_1_tx_rx", mt7622_uart2_1_tx_rx),
739*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart2_1_rts_cts", mt7622_uart2_1_rts_cts),
740*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart2_2_tx_rx", mt7622_uart2_2_tx_rx),
741*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart2_2_rts_cts", mt7622_uart2_2_rts_cts),
742*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart2_3_tx_rx", mt7622_uart2_3_tx_rx),
743*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart3_0_tx_rx", mt7622_uart3_0_tx_rx),
744*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart3_1_tx_rx", mt7622_uart3_1_tx_rx),
745*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart3_1_rts_cts", mt7622_uart3_1_rts_cts),
746*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart4_0_tx_rx", mt7622_uart4_0_tx_rx),
747*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart4_1_tx_rx", mt7622_uart4_1_tx_rx),
748*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart4_1_rts_cts", mt7622_uart4_1_rts_cts),
749*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart4_2_tx_rx", mt7622_uart4_2_tx_rx),
750*4882a593Smuzhiyun PINCTRL_PIN_GROUP("uart4_2_rts_cts", mt7622_uart4_2_rts_cts),
751*4882a593Smuzhiyun PINCTRL_PIN_GROUP("watchdog", mt7622_watchdog),
752*4882a593Smuzhiyun PINCTRL_PIN_GROUP("wled", mt7622_wled),
753*4882a593Smuzhiyun };
754*4882a593Smuzhiyun
755*4882a593Smuzhiyun /* Joint those groups owning the same capability in user point of view which
756*4882a593Smuzhiyun * allows that people tend to use through the device tree.
757*4882a593Smuzhiyun */
758*4882a593Smuzhiyun static const char *mt7622_antsel_groups[] = { "antsel0", "antsel1", "antsel2",
759*4882a593Smuzhiyun "antsel3", "antsel4", "antsel5",
760*4882a593Smuzhiyun "antsel6", "antsel7", "antsel8",
761*4882a593Smuzhiyun "antsel9", "antsel10", "antsel11",
762*4882a593Smuzhiyun "antsel12", "antsel13", "antsel14",
763*4882a593Smuzhiyun "antsel15", "antsel16", "antsel17",
764*4882a593Smuzhiyun "antsel18", "antsel19", "antsel20",
765*4882a593Smuzhiyun "antsel21", "antsel22", "antsel23",
766*4882a593Smuzhiyun "antsel24", "antsel25", "antsel26",
767*4882a593Smuzhiyun "antsel27", "antsel28", "antsel29",};
768*4882a593Smuzhiyun static const char *mt7622_emmc_groups[] = { "emmc", "emmc_rst", };
769*4882a593Smuzhiyun static const char *mt7622_ethernet_groups[] = { "esw", "esw_p0_p1",
770*4882a593Smuzhiyun "esw_p2_p3_p4", "mdc_mdio",
771*4882a593Smuzhiyun "rgmii_via_gmac1",
772*4882a593Smuzhiyun "rgmii_via_gmac2",
773*4882a593Smuzhiyun "rgmii_via_esw", };
774*4882a593Smuzhiyun static const char *mt7622_i2c_groups[] = { "i2c0", "i2c1_0", "i2c1_1",
775*4882a593Smuzhiyun "i2c1_2", "i2c2_0", "i2c2_1",
776*4882a593Smuzhiyun "i2c2_2", };
777*4882a593Smuzhiyun static const char *mt7622_i2s_groups[] = { "i2s_out_mclk_bclk_ws",
778*4882a593Smuzhiyun "i2s_in_mclk_bclk_ws",
779*4882a593Smuzhiyun "i2s1_in_data", "i2s2_in_data",
780*4882a593Smuzhiyun "i2s3_in_data", "i2s4_in_data",
781*4882a593Smuzhiyun "i2s1_out_data", "i2s2_out_data",
782*4882a593Smuzhiyun "i2s3_out_data", "i2s4_out_data", };
783*4882a593Smuzhiyun static const char *mt7622_ir_groups[] = { "ir_0_tx", "ir_1_tx", "ir_2_tx",
784*4882a593Smuzhiyun "ir_0_rx", "ir_1_rx", "ir_2_rx"};
785*4882a593Smuzhiyun static const char *mt7622_led_groups[] = { "ephy_leds", "ephy0_led",
786*4882a593Smuzhiyun "ephy1_led", "ephy2_led",
787*4882a593Smuzhiyun "ephy3_led", "ephy4_led",
788*4882a593Smuzhiyun "wled", };
789*4882a593Smuzhiyun static const char *mt7622_flash_groups[] = { "par_nand", "snfi", "spi_nor"};
790*4882a593Smuzhiyun static const char *mt7622_pcie_groups[] = { "pcie0_0_waken", "pcie0_0_clkreq",
791*4882a593Smuzhiyun "pcie0_1_waken", "pcie0_1_clkreq",
792*4882a593Smuzhiyun "pcie1_0_waken", "pcie1_0_clkreq",
793*4882a593Smuzhiyun "pcie0_pad_perst",
794*4882a593Smuzhiyun "pcie1_pad_perst", };
795*4882a593Smuzhiyun static const char *mt7622_pmic_bus_groups[] = { "pmic_bus", };
796*4882a593Smuzhiyun static const char *mt7622_pwm_groups[] = { "pwm_ch1_0", "pwm_ch1_1",
797*4882a593Smuzhiyun "pwm_ch1_2", "pwm_ch2_0",
798*4882a593Smuzhiyun "pwm_ch2_1", "pwm_ch2_2",
799*4882a593Smuzhiyun "pwm_ch3_0", "pwm_ch3_1",
800*4882a593Smuzhiyun "pwm_ch3_2", "pwm_ch4_0",
801*4882a593Smuzhiyun "pwm_ch4_1", "pwm_ch4_2",
802*4882a593Smuzhiyun "pwm_ch4_3", "pwm_ch5_0",
803*4882a593Smuzhiyun "pwm_ch5_1", "pwm_ch5_2",
804*4882a593Smuzhiyun "pwm_ch6_0", "pwm_ch6_1",
805*4882a593Smuzhiyun "pwm_ch6_2", "pwm_ch6_3",
806*4882a593Smuzhiyun "pwm_ch7_0", "pwm_ch7_1",
807*4882a593Smuzhiyun "pwm_ch7_2", };
808*4882a593Smuzhiyun static const char *mt7622_sd_groups[] = { "sd_0", "sd_1", };
809*4882a593Smuzhiyun static const char *mt7622_spic_groups[] = { "spic0_0", "spic0_1", "spic1_0",
810*4882a593Smuzhiyun "spic1_1", "spic2_0",
811*4882a593Smuzhiyun "spic2_0_wp_hold", };
812*4882a593Smuzhiyun static const char *mt7622_tdm_groups[] = { "tdm_0_out_mclk_bclk_ws",
813*4882a593Smuzhiyun "tdm_0_in_mclk_bclk_ws",
814*4882a593Smuzhiyun "tdm_0_out_data",
815*4882a593Smuzhiyun "tdm_0_in_data",
816*4882a593Smuzhiyun "tdm_1_out_mclk_bclk_ws",
817*4882a593Smuzhiyun "tdm_1_in_mclk_bclk_ws",
818*4882a593Smuzhiyun "tdm_1_out_data",
819*4882a593Smuzhiyun "tdm_1_in_data", };
820*4882a593Smuzhiyun
821*4882a593Smuzhiyun static const char *mt7622_uart_groups[] = { "uart0_0_tx_rx",
822*4882a593Smuzhiyun "uart1_0_tx_rx", "uart1_0_rts_cts",
823*4882a593Smuzhiyun "uart1_1_tx_rx", "uart1_1_rts_cts",
824*4882a593Smuzhiyun "uart2_0_tx_rx", "uart2_0_rts_cts",
825*4882a593Smuzhiyun "uart2_1_tx_rx", "uart2_1_rts_cts",
826*4882a593Smuzhiyun "uart2_2_tx_rx", "uart2_2_rts_cts",
827*4882a593Smuzhiyun "uart2_3_tx_rx",
828*4882a593Smuzhiyun "uart3_0_tx_rx",
829*4882a593Smuzhiyun "uart3_1_tx_rx", "uart3_1_rts_cts",
830*4882a593Smuzhiyun "uart4_0_tx_rx",
831*4882a593Smuzhiyun "uart4_1_tx_rx", "uart4_1_rts_cts",
832*4882a593Smuzhiyun "uart4_2_tx_rx",
833*4882a593Smuzhiyun "uart4_2_rts_cts",};
834*4882a593Smuzhiyun static const char *mt7622_wdt_groups[] = { "watchdog", };
835*4882a593Smuzhiyun
836*4882a593Smuzhiyun static const struct function_desc mt7622_functions[] = {
837*4882a593Smuzhiyun {"antsel", mt7622_antsel_groups, ARRAY_SIZE(mt7622_antsel_groups)},
838*4882a593Smuzhiyun {"emmc", mt7622_emmc_groups, ARRAY_SIZE(mt7622_emmc_groups)},
839*4882a593Smuzhiyun {"eth", mt7622_ethernet_groups, ARRAY_SIZE(mt7622_ethernet_groups)},
840*4882a593Smuzhiyun {"i2c", mt7622_i2c_groups, ARRAY_SIZE(mt7622_i2c_groups)},
841*4882a593Smuzhiyun {"i2s", mt7622_i2s_groups, ARRAY_SIZE(mt7622_i2s_groups)},
842*4882a593Smuzhiyun {"ir", mt7622_ir_groups, ARRAY_SIZE(mt7622_ir_groups)},
843*4882a593Smuzhiyun {"led", mt7622_led_groups, ARRAY_SIZE(mt7622_led_groups)},
844*4882a593Smuzhiyun {"flash", mt7622_flash_groups, ARRAY_SIZE(mt7622_flash_groups)},
845*4882a593Smuzhiyun {"pcie", mt7622_pcie_groups, ARRAY_SIZE(mt7622_pcie_groups)},
846*4882a593Smuzhiyun {"pmic", mt7622_pmic_bus_groups, ARRAY_SIZE(mt7622_pmic_bus_groups)},
847*4882a593Smuzhiyun {"pwm", mt7622_pwm_groups, ARRAY_SIZE(mt7622_pwm_groups)},
848*4882a593Smuzhiyun {"sd", mt7622_sd_groups, ARRAY_SIZE(mt7622_sd_groups)},
849*4882a593Smuzhiyun {"spi", mt7622_spic_groups, ARRAY_SIZE(mt7622_spic_groups)},
850*4882a593Smuzhiyun {"tdm", mt7622_tdm_groups, ARRAY_SIZE(mt7622_tdm_groups)},
851*4882a593Smuzhiyun {"uart", mt7622_uart_groups, ARRAY_SIZE(mt7622_uart_groups)},
852*4882a593Smuzhiyun {"watchdog", mt7622_wdt_groups, ARRAY_SIZE(mt7622_wdt_groups)},
853*4882a593Smuzhiyun };
854*4882a593Smuzhiyun
855*4882a593Smuzhiyun static const struct mtk_eint_hw mt7622_eint_hw = {
856*4882a593Smuzhiyun .port_mask = 7,
857*4882a593Smuzhiyun .ports = 7,
858*4882a593Smuzhiyun .ap_num = ARRAY_SIZE(mt7622_pins),
859*4882a593Smuzhiyun .db_cnt = 20,
860*4882a593Smuzhiyun };
861*4882a593Smuzhiyun
862*4882a593Smuzhiyun static const struct mtk_pin_soc mt7622_data = {
863*4882a593Smuzhiyun .reg_cal = mt7622_reg_cals,
864*4882a593Smuzhiyun .pins = mt7622_pins,
865*4882a593Smuzhiyun .npins = ARRAY_SIZE(mt7622_pins),
866*4882a593Smuzhiyun .grps = mt7622_groups,
867*4882a593Smuzhiyun .ngrps = ARRAY_SIZE(mt7622_groups),
868*4882a593Smuzhiyun .funcs = mt7622_functions,
869*4882a593Smuzhiyun .nfuncs = ARRAY_SIZE(mt7622_functions),
870*4882a593Smuzhiyun .eint_hw = &mt7622_eint_hw,
871*4882a593Smuzhiyun .gpio_m = 1,
872*4882a593Smuzhiyun .ies_present = false,
873*4882a593Smuzhiyun .base_names = mtk_default_register_base_names,
874*4882a593Smuzhiyun .nbase_names = ARRAY_SIZE(mtk_default_register_base_names),
875*4882a593Smuzhiyun .bias_disable_set = mtk_pinconf_bias_disable_set,
876*4882a593Smuzhiyun .bias_disable_get = mtk_pinconf_bias_disable_get,
877*4882a593Smuzhiyun .bias_set = mtk_pinconf_bias_set,
878*4882a593Smuzhiyun .bias_get = mtk_pinconf_bias_get,
879*4882a593Smuzhiyun .drive_set = mtk_pinconf_drive_set,
880*4882a593Smuzhiyun .drive_get = mtk_pinconf_drive_get,
881*4882a593Smuzhiyun };
882*4882a593Smuzhiyun
883*4882a593Smuzhiyun static const struct of_device_id mt7622_pinctrl_of_match[] = {
884*4882a593Smuzhiyun { .compatible = "mediatek,mt7622-pinctrl", },
885*4882a593Smuzhiyun { }
886*4882a593Smuzhiyun };
887*4882a593Smuzhiyun
mt7622_pinctrl_probe(struct platform_device * pdev)888*4882a593Smuzhiyun static int mt7622_pinctrl_probe(struct platform_device *pdev)
889*4882a593Smuzhiyun {
890*4882a593Smuzhiyun return mtk_moore_pinctrl_probe(pdev, &mt7622_data);
891*4882a593Smuzhiyun }
892*4882a593Smuzhiyun
893*4882a593Smuzhiyun static struct platform_driver mt7622_pinctrl_driver = {
894*4882a593Smuzhiyun .driver = {
895*4882a593Smuzhiyun .name = "mt7622-pinctrl",
896*4882a593Smuzhiyun .of_match_table = mt7622_pinctrl_of_match,
897*4882a593Smuzhiyun },
898*4882a593Smuzhiyun .probe = mt7622_pinctrl_probe,
899*4882a593Smuzhiyun };
900*4882a593Smuzhiyun
mt7622_pinctrl_init(void)901*4882a593Smuzhiyun static int __init mt7622_pinctrl_init(void)
902*4882a593Smuzhiyun {
903*4882a593Smuzhiyun return platform_driver_register(&mt7622_pinctrl_driver);
904*4882a593Smuzhiyun }
905*4882a593Smuzhiyun arch_initcall(mt7622_pinctrl_init);
906