GNU Linux-libre 4.4.297-gnu1
[releases.git] / drivers / pinctrl / mediatek / pinctrl-mtk-mt6397.h
1 #ifndef __PINCTRL_MTK_MT6397_H
2 #define __PINCTRL_MTK_MT6397_H
3
4 #include <linux/pinctrl/pinctrl.h>
5 #include "pinctrl-mtk-common.h"
6
7 static const struct mtk_desc_pin mtk_pins_mt6397[] = {
8         MTK_PIN(
9                 PINCTRL_PIN(0, "INT"),
10                 "N2", "mt6397",
11                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
12                 MTK_FUNCTION(0, "GPIO0"),
13                 MTK_FUNCTION(1, "INT")
14         ),
15         MTK_PIN(
16                 PINCTRL_PIN(1, "SRCVOLTEN"),
17                 "M4", "mt6397",
18                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
19                 MTK_FUNCTION(0, "GPIO1"),
20                 MTK_FUNCTION(1, "SRCVOLTEN"),
21                 MTK_FUNCTION(6, "TEST_CK1")
22         ),
23         MTK_PIN(
24                 PINCTRL_PIN(2, "SRCLKEN_PERI"),
25                 "M2", "mt6397",
26                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
27                 MTK_FUNCTION(0, "GPIO2"),
28                 MTK_FUNCTION(1, "SRCLKEN_PERI"),
29                 MTK_FUNCTION(6, "TEST_CK2")
30         ),
31         MTK_PIN(
32                 PINCTRL_PIN(3, "RTC_32K1V8"),
33                 "K3", "mt6397",
34                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
35                 MTK_FUNCTION(0, "GPIO3"),
36                 MTK_FUNCTION(1, "RTC_32K1V8"),
37                 MTK_FUNCTION(6, "TEST_CK3")
38         ),
39         MTK_PIN(
40                 PINCTRL_PIN(4, "WRAP_EVENT"),
41                 "J2", "mt6397",
42                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
43                 MTK_FUNCTION(0, "GPIO4"),
44                 MTK_FUNCTION(1, "WRAP_EVENT")
45         ),
46         MTK_PIN(
47                 PINCTRL_PIN(5, "SPI_CLK"),
48                 "L4", "mt6397",
49                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
50                 MTK_FUNCTION(0, "GPIO5"),
51                 MTK_FUNCTION(1, "SPI_CLK")
52         ),
53         MTK_PIN(
54                 PINCTRL_PIN(6, "SPI_CSN"),
55                 "J3", "mt6397",
56                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
57                 MTK_FUNCTION(0, "GPIO6"),
58                 MTK_FUNCTION(1, "SPI_CSN")
59         ),
60         MTK_PIN(
61                 PINCTRL_PIN(7, "SPI_MOSI"),
62                 "J1", "mt6397",
63                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
64                 MTK_FUNCTION(0, "GPIO7"),
65                 MTK_FUNCTION(1, "SPI_MOSI")
66         ),
67         MTK_PIN(
68                 PINCTRL_PIN(8, "SPI_MISO"),
69                 "L3", "mt6397",
70                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
71                 MTK_FUNCTION(0, "GPIO8"),
72                 MTK_FUNCTION(1, "SPI_MISO")
73         ),
74         MTK_PIN(
75                 PINCTRL_PIN(9, "AUD_CLK_MOSI"),
76                 "H2", "mt6397",
77                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
78                 MTK_FUNCTION(0, "GPIO9"),
79                 MTK_FUNCTION(1, "AUD_CLK"),
80                 MTK_FUNCTION(6, "TEST_IN0"),
81                 MTK_FUNCTION(7, "TEST_OUT0")
82         ),
83         MTK_PIN(
84                 PINCTRL_PIN(10, "AUD_DAT_MISO"),
85                 "H3", "mt6397",
86                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
87                 MTK_FUNCTION(0, "GPIO10"),
88                 MTK_FUNCTION(1, "AUD_MISO"),
89                 MTK_FUNCTION(6, "TEST_IN1"),
90                 MTK_FUNCTION(7, "TEST_OUT1")
91         ),
92         MTK_PIN(
93                 PINCTRL_PIN(11, "AUD_DAT_MOSI"),
94                 "H1", "mt6397",
95                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
96                 MTK_FUNCTION(0, "GPIO11"),
97                 MTK_FUNCTION(1, "AUD_MOSI"),
98                 MTK_FUNCTION(6, "TEST_IN2"),
99                 MTK_FUNCTION(7, "TEST_OUT2")
100         ),
101         MTK_PIN(
102                 PINCTRL_PIN(12, "COL0"),
103                 "F3", "mt6397",
104                 MTK_EINT_FUNCTION(2, 10),
105                 MTK_FUNCTION(0, "GPIO12"),
106                 MTK_FUNCTION(1, "COL0_USBDL"),
107                 MTK_FUNCTION(2, "EINT10_1X"),
108                 MTK_FUNCTION(3, "PWM1_3X"),
109                 MTK_FUNCTION(6, "TEST_IN3"),
110                 MTK_FUNCTION(7, "TEST_OUT3")
111         ),
112         MTK_PIN(
113                 PINCTRL_PIN(13, "COL1"),
114                 "G8", "mt6397",
115                 MTK_EINT_FUNCTION(2, 11),
116                 MTK_FUNCTION(0, "GPIO13"),
117                 MTK_FUNCTION(1, "COL1"),
118                 MTK_FUNCTION(2, "EINT11_1X"),
119                 MTK_FUNCTION(3, "SCL0_2X"),
120                 MTK_FUNCTION(6, "TEST_IN4"),
121                 MTK_FUNCTION(7, "TEST_OUT4")
122         ),
123         MTK_PIN(
124                 PINCTRL_PIN(14, "COL2"),
125                 "H4", "mt6397",
126                 MTK_EINT_FUNCTION(2, 12),
127                 MTK_FUNCTION(0, "GPIO14"),
128                 MTK_FUNCTION(1, "COL2"),
129                 MTK_FUNCTION(2, "EINT12_1X"),
130                 MTK_FUNCTION(3, "SDA0_2X"),
131                 MTK_FUNCTION(6, "TEST_IN5"),
132                 MTK_FUNCTION(7, "TEST_OUT5")
133         ),
134         MTK_PIN(
135                 PINCTRL_PIN(15, "COL3"),
136                 "G2", "mt6397",
137                 MTK_EINT_FUNCTION(2, 13),
138                 MTK_FUNCTION(0, "GPIO15"),
139                 MTK_FUNCTION(1, "COL3"),
140                 MTK_FUNCTION(2, "EINT13_1X"),
141                 MTK_FUNCTION(3, "SCL1_2X"),
142                 MTK_FUNCTION(6, "TEST_IN6"),
143                 MTK_FUNCTION(7, "TEST_OUT6")
144         ),
145         MTK_PIN(
146                 PINCTRL_PIN(16, "COL4"),
147                 "F2", "mt6397",
148                 MTK_EINT_FUNCTION(2, 14),
149                 MTK_FUNCTION(0, "GPIO16"),
150                 MTK_FUNCTION(1, "COL4"),
151                 MTK_FUNCTION(2, "EINT14_1X"),
152                 MTK_FUNCTION(3, "SDA1_2X"),
153                 MTK_FUNCTION(6, "TEST_IN7"),
154                 MTK_FUNCTION(7, "TEST_OUT7")
155         ),
156         MTK_PIN(
157                 PINCTRL_PIN(17, "COL5"),
158                 "G7", "mt6397",
159                 MTK_EINT_FUNCTION(2, 15),
160                 MTK_FUNCTION(0, "GPIO17"),
161                 MTK_FUNCTION(1, "COL5"),
162                 MTK_FUNCTION(2, "EINT15_1X"),
163                 MTK_FUNCTION(3, "SCL2_2X"),
164                 MTK_FUNCTION(6, "TEST_IN8"),
165                 MTK_FUNCTION(7, "TEST_OUT8")
166         ),
167         MTK_PIN(
168                 PINCTRL_PIN(18, "COL6"),
169                 "J6", "mt6397",
170                 MTK_EINT_FUNCTION(2, 16),
171                 MTK_FUNCTION(0, "GPIO18"),
172                 MTK_FUNCTION(1, "COL6"),
173                 MTK_FUNCTION(2, "EINT16_1X"),
174                 MTK_FUNCTION(3, "SDA2_2X"),
175                 MTK_FUNCTION(4, "GPIO32K_0"),
176                 MTK_FUNCTION(5, "GPIO26M_0"),
177                 MTK_FUNCTION(6, "TEST_IN9"),
178                 MTK_FUNCTION(7, "TEST_OUT9")
179         ),
180         MTK_PIN(
181                 PINCTRL_PIN(19, "COL7"),
182                 "J5", "mt6397",
183                 MTK_EINT_FUNCTION(2, 17),
184                 MTK_FUNCTION(0, "GPIO19"),
185                 MTK_FUNCTION(1, "COL7"),
186                 MTK_FUNCTION(2, "EINT17_1X"),
187                 MTK_FUNCTION(3, "PWM2_3X"),
188                 MTK_FUNCTION(4, "GPIO32K_1"),
189                 MTK_FUNCTION(5, "GPIO26M_1"),
190                 MTK_FUNCTION(6, "TEST_IN10"),
191                 MTK_FUNCTION(7, "TEST_OUT10")
192         ),
193         MTK_PIN(
194                 PINCTRL_PIN(20, "ROW0"),
195                 "L7", "mt6397",
196                 MTK_EINT_FUNCTION(2, 18),
197                 MTK_FUNCTION(0, "GPIO20"),
198                 MTK_FUNCTION(1, "ROW0"),
199                 MTK_FUNCTION(2, "EINT18_1X"),
200                 MTK_FUNCTION(3, "SCL0_3X"),
201                 MTK_FUNCTION(6, "TEST_IN11"),
202                 MTK_FUNCTION(7, "TEST_OUT11")
203         ),
204         MTK_PIN(
205                 PINCTRL_PIN(21, "ROW1"),
206                 "P1", "mt6397",
207                 MTK_EINT_FUNCTION(2, 19),
208                 MTK_FUNCTION(0, "GPIO21"),
209                 MTK_FUNCTION(1, "ROW1"),
210                 MTK_FUNCTION(2, "EINT19_1X"),
211                 MTK_FUNCTION(3, "SDA0_3X"),
212                 MTK_FUNCTION(4, "AUD_TSTCK"),
213                 MTK_FUNCTION(6, "TEST_IN12"),
214                 MTK_FUNCTION(7, "TEST_OUT12")
215         ),
216         MTK_PIN(
217                 PINCTRL_PIN(22, "ROW2"),
218                 "J8", "mt6397",
219                 MTK_EINT_FUNCTION(2, 20),
220                 MTK_FUNCTION(0, "GPIO22"),
221                 MTK_FUNCTION(1, "ROW2"),
222                 MTK_FUNCTION(2, "EINT20_1X"),
223                 MTK_FUNCTION(3, "SCL1_3X"),
224                 MTK_FUNCTION(6, "TEST_IN13"),
225                 MTK_FUNCTION(7, "TEST_OUT13")
226         ),
227         MTK_PIN(
228                 PINCTRL_PIN(23, "ROW3"),
229                 "J7", "mt6397",
230                 MTK_EINT_FUNCTION(2, 21),
231                 MTK_FUNCTION(0, "GPIO23"),
232                 MTK_FUNCTION(1, "ROW3"),
233                 MTK_FUNCTION(2, "EINT21_1X"),
234                 MTK_FUNCTION(3, "SDA1_3X"),
235                 MTK_FUNCTION(6, "TEST_IN14"),
236                 MTK_FUNCTION(7, "TEST_OUT14")
237         ),
238         MTK_PIN(
239                 PINCTRL_PIN(24, "ROW4"),
240                 "L5", "mt6397",
241                 MTK_EINT_FUNCTION(2, 22),
242                 MTK_FUNCTION(0, "GPIO24"),
243                 MTK_FUNCTION(1, "ROW4"),
244                 MTK_FUNCTION(2, "EINT22_1X"),
245                 MTK_FUNCTION(3, "SCL2_3X"),
246                 MTK_FUNCTION(6, "TEST_IN15"),
247                 MTK_FUNCTION(7, "TEST_OUT15")
248         ),
249         MTK_PIN(
250                 PINCTRL_PIN(25, "ROW5"),
251                 "N6", "mt6397",
252                 MTK_EINT_FUNCTION(2, 23),
253                 MTK_FUNCTION(0, "GPIO25"),
254                 MTK_FUNCTION(1, "ROW5"),
255                 MTK_FUNCTION(2, "EINT23_1X"),
256                 MTK_FUNCTION(3, "SDA2_3X"),
257                 MTK_FUNCTION(6, "TEST_IN16"),
258                 MTK_FUNCTION(7, "TEST_OUT16")
259         ),
260         MTK_PIN(
261                 PINCTRL_PIN(26, "ROW6"),
262                 "L6", "mt6397",
263                 MTK_EINT_FUNCTION(2, 24),
264                 MTK_FUNCTION(0, "GPIO26"),
265                 MTK_FUNCTION(1, "ROW6"),
266                 MTK_FUNCTION(2, "EINT24_1X"),
267                 MTK_FUNCTION(3, "PWM3_3X"),
268                 MTK_FUNCTION(4, "GPIO32K_2"),
269                 MTK_FUNCTION(5, "GPIO26M_2"),
270                 MTK_FUNCTION(6, "TEST_IN17"),
271                 MTK_FUNCTION(7, "TEST_OUT17")
272         ),
273         MTK_PIN(
274                 PINCTRL_PIN(27, "ROW7"),
275                 "P2", "mt6397",
276                 MTK_EINT_FUNCTION(2, 3),
277                 MTK_FUNCTION(0, "GPIO27"),
278                 MTK_FUNCTION(1, "ROW7"),
279                 MTK_FUNCTION(2, "EINT3_1X"),
280                 MTK_FUNCTION(3, "CBUS"),
281                 MTK_FUNCTION(4, "GPIO32K_3"),
282                 MTK_FUNCTION(5, "GPIO26M_3"),
283                 MTK_FUNCTION(6, "TEST_IN18"),
284                 MTK_FUNCTION(7, "TEST_OUT18")
285         ),
286         MTK_PIN(
287                 PINCTRL_PIN(28, "PWM1(VMSEL1)"),
288                 "J4", "mt6397",
289                 MTK_EINT_FUNCTION(2, 4),
290                 MTK_FUNCTION(0, "GPIO28"),
291                 MTK_FUNCTION(1, "PWM1"),
292                 MTK_FUNCTION(2, "EINT4_1X"),
293                 MTK_FUNCTION(4, "GPIO32K_4"),
294                 MTK_FUNCTION(5, "GPIO26M_4"),
295                 MTK_FUNCTION(6, "TEST_IN19"),
296                 MTK_FUNCTION(7, "TEST_OUT19")
297         ),
298         MTK_PIN(
299                 PINCTRL_PIN(29, "PWM2(VMSEL2)"),
300                 "N5", "mt6397",
301                 MTK_EINT_FUNCTION(2, 5),
302                 MTK_FUNCTION(0, "GPIO29"),
303                 MTK_FUNCTION(1, "PWM2"),
304                 MTK_FUNCTION(2, "EINT5_1X"),
305                 MTK_FUNCTION(4, "GPIO32K_5"),
306                 MTK_FUNCTION(5, "GPIO26M_5"),
307                 MTK_FUNCTION(6, "TEST_IN20"),
308                 MTK_FUNCTION(7, "TEST_OUT20")
309         ),
310         MTK_PIN(
311                 PINCTRL_PIN(30, "PWM3(PWM)"),
312                 "R3", "mt6397",
313                 MTK_EINT_FUNCTION(2, 6),
314                 MTK_FUNCTION(0, "GPIO30"),
315                 MTK_FUNCTION(1, "PWM3"),
316                 MTK_FUNCTION(2, "EINT6_1X"),
317                 MTK_FUNCTION(3, "COL0"),
318                 MTK_FUNCTION(4, "GPIO32K_6"),
319                 MTK_FUNCTION(5, "GPIO26M_6"),
320                 MTK_FUNCTION(6, "TEST_IN21"),
321                 MTK_FUNCTION(7, "TEST_OUT21")
322         ),
323         MTK_PIN(
324                 PINCTRL_PIN(31, "SCL0"),
325                 "N1", "mt6397",
326                 MTK_EINT_FUNCTION(2, 7),
327                 MTK_FUNCTION(0, "GPIO31"),
328                 MTK_FUNCTION(1, "SCL0"),
329                 MTK_FUNCTION(2, "EINT7_1X"),
330                 MTK_FUNCTION(3, "PWM1_2X"),
331                 MTK_FUNCTION(6, "TEST_IN22"),
332                 MTK_FUNCTION(7, "TEST_OUT22")
333         ),
334         MTK_PIN(
335                 PINCTRL_PIN(32, "SDA0"),
336                 "N3", "mt6397",
337                 MTK_EINT_FUNCTION(2, 8),
338                 MTK_FUNCTION(0, "GPIO32"),
339                 MTK_FUNCTION(1, "SDA0"),
340                 MTK_FUNCTION(2, "EINT8_1X"),
341                 MTK_FUNCTION(6, "TEST_IN23"),
342                 MTK_FUNCTION(7, "TEST_OUT23")
343         ),
344         MTK_PIN(
345                 PINCTRL_PIN(33, "SCL1"),
346                 "T1", "mt6397",
347                 MTK_EINT_FUNCTION(2, 9),
348                 MTK_FUNCTION(0, "GPIO33"),
349                 MTK_FUNCTION(1, "SCL1"),
350                 MTK_FUNCTION(2, "EINT9_1X"),
351                 MTK_FUNCTION(3, "PWM2_2X"),
352                 MTK_FUNCTION(6, "TEST_IN24"),
353                 MTK_FUNCTION(7, "TEST_OUT24")
354         ),
355         MTK_PIN(
356                 PINCTRL_PIN(34, "SDA1"),
357                 "T2", "mt6397",
358                 MTK_EINT_FUNCTION(2, 0),
359                 MTK_FUNCTION(0, "GPIO34"),
360                 MTK_FUNCTION(1, "SDA1"),
361                 MTK_FUNCTION(2, "EINT0_1X"),
362                 MTK_FUNCTION(6, "TEST_IN25"),
363                 MTK_FUNCTION(7, "TEST_OUT25")
364         ),
365         MTK_PIN(
366                 PINCTRL_PIN(35, "SCL2"),
367                 "T3", "mt6397",
368                 MTK_EINT_FUNCTION(2, 1),
369                 MTK_FUNCTION(0, "GPIO35"),
370                 MTK_FUNCTION(1, "SCL2"),
371                 MTK_FUNCTION(2, "EINT1_1X"),
372                 MTK_FUNCTION(3, "PWM3_2X"),
373                 MTK_FUNCTION(6, "TEST_IN26"),
374                 MTK_FUNCTION(7, "TEST_OUT26")
375         ),
376         MTK_PIN(
377                 PINCTRL_PIN(36, "SDA2"),
378                 "U2", "mt6397",
379                 MTK_EINT_FUNCTION(2, 2),
380                 MTK_FUNCTION(0, "GPIO36"),
381                 MTK_FUNCTION(1, "SDA2"),
382                 MTK_FUNCTION(2, "EINT2_1X"),
383                 MTK_FUNCTION(6, "TEST_IN27"),
384                 MTK_FUNCTION(7, "TEST_OUT27")
385         ),
386         MTK_PIN(
387                 PINCTRL_PIN(37, "HDMISD"),
388                 "H6", "mt6397",
389                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
390                 MTK_FUNCTION(0, "GPIO37"),
391                 MTK_FUNCTION(1, "HDMISD"),
392                 MTK_FUNCTION(6, "TEST_IN28"),
393                 MTK_FUNCTION(7, "TEST_OUT28")
394         ),
395         MTK_PIN(
396                 PINCTRL_PIN(38, "HDMISCK"),
397                 "H5", "mt6397",
398                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
399                 MTK_FUNCTION(0, "GPIO38"),
400                 MTK_FUNCTION(1, "HDMISCK"),
401                 MTK_FUNCTION(6, "TEST_IN29"),
402                 MTK_FUNCTION(7, "TEST_OUT29")
403         ),
404         MTK_PIN(
405                 PINCTRL_PIN(39, "HTPLG"),
406                 "H7", "mt6397",
407                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
408                 MTK_FUNCTION(0, "GPIO39"),
409                 MTK_FUNCTION(1, "HTPLG"),
410                 MTK_FUNCTION(6, "TEST_IN30"),
411                 MTK_FUNCTION(7, "TEST_OUT30")
412         ),
413         MTK_PIN(
414                 PINCTRL_PIN(40, "CEC"),
415                 "J9", "mt6397",
416                 MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
417                 MTK_FUNCTION(0, "GPIO40"),
418                 MTK_FUNCTION(1, "CEC"),
419                 MTK_FUNCTION(6, "TEST_IN31"),
420                 MTK_FUNCTION(7, "TEST_OUT31")
421         ),
422 };
423
424 #endif /* __PINCTRL_MTK_MT6397_H */