diff options
author | Hongzhou Yang <hongzhou.yang@mediatek.com> | 2015-01-21 00:28:15 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-03-17 21:02:14 -0400 |
commit | a6df410d420aa4ff316797d352f69e7ebae5ff98 (patch) | |
tree | 0dfeffd944810059bf7efa91b32e587c96446964 | |
parent | ddac96118f3d2c28813ba98cda79c1e29a902e02 (diff) |
pinctrl: mediatek: Add Pinctrl/GPIO driver for mt8135.
The mediatek SoCs have GPIO controller that handle both the muxing and GPIOs.
The GPIO controller have pinmux, pull enable, pull select, direction and output high/low control.
This driver include common driver and mt8135 part.
The common driver include the pinctrl driver and GPIO driver.
The mt8135 part contain its special device data.
Signed-off-by: Hongzhou Yang <hongzhou.yang@mediatek.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/Kconfig | 1 | ||||
-rw-r--r-- | drivers/pinctrl/Makefile | 1 | ||||
-rw-r--r-- | drivers/pinctrl/mediatek/Kconfig | 14 | ||||
-rw-r--r-- | drivers/pinctrl/mediatek/Makefile | 5 | ||||
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-mt8135.c | 350 | ||||
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 800 | ||||
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 185 | ||||
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-mtk-mt8135.h | 2114 | ||||
-rw-r--r-- | include/dt-bindings/pinctrl/mt65xx.h | 40 |
9 files changed, 3510 insertions, 0 deletions
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index adfe8546abc2..3d44b6cfffbf 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig | |||
@@ -205,6 +205,7 @@ source "drivers/pinctrl/sh-pfc/Kconfig" | |||
205 | source "drivers/pinctrl/spear/Kconfig" | 205 | source "drivers/pinctrl/spear/Kconfig" |
206 | source "drivers/pinctrl/sunxi/Kconfig" | 206 | source "drivers/pinctrl/sunxi/Kconfig" |
207 | source "drivers/pinctrl/vt8500/Kconfig" | 207 | source "drivers/pinctrl/vt8500/Kconfig" |
208 | source "drivers/pinctrl/mediatek/Kconfig" | ||
208 | 209 | ||
209 | config PINCTRL_XWAY | 210 | config PINCTRL_XWAY |
210 | bool | 211 | bool |
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index 3d62946f3f29..e54d2166bd09 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile | |||
@@ -49,3 +49,4 @@ obj-$(CONFIG_PINCTRL_SH_PFC) += sh-pfc/ | |||
49 | obj-$(CONFIG_PLAT_SPEAR) += spear/ | 49 | obj-$(CONFIG_PLAT_SPEAR) += spear/ |
50 | obj-$(CONFIG_ARCH_SUNXI) += sunxi/ | 50 | obj-$(CONFIG_ARCH_SUNXI) += sunxi/ |
51 | obj-$(CONFIG_ARCH_VT8500) += vt8500/ | 51 | obj-$(CONFIG_ARCH_VT8500) += vt8500/ |
52 | obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/ | ||
diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig new file mode 100644 index 000000000000..70bbf39379ae --- /dev/null +++ b/drivers/pinctrl/mediatek/Kconfig | |||
@@ -0,0 +1,14 @@ | |||
1 | if ARCH_MEDIATEK | ||
2 | |||
3 | config PINCTRL_MTK_COMMON | ||
4 | bool | ||
5 | select PINMUX | ||
6 | select GENERIC_PINCONF | ||
7 | select GPIOLIB | ||
8 | select OF_GPIO | ||
9 | |||
10 | config PINCTRL_MT8135 | ||
11 | def_bool MACH_MT8135 | ||
12 | select PINCTRL_MTK_COMMON | ||
13 | |||
14 | endif | ||
diff --git a/drivers/pinctrl/mediatek/Makefile b/drivers/pinctrl/mediatek/Makefile new file mode 100644 index 000000000000..8157dad9d51d --- /dev/null +++ b/drivers/pinctrl/mediatek/Makefile | |||
@@ -0,0 +1,5 @@ | |||
1 | # Core | ||
2 | obj-$(CONFIG_PINCTRL_MTK_COMMON) += pinctrl-mtk-common.o | ||
3 | |||
4 | # SoC Drivers | ||
5 | obj-$(CONFIG_PINCTRL_MT8135) += pinctrl-mt8135.o | ||
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8135.c b/drivers/pinctrl/mediatek/pinctrl-mt8135.c new file mode 100644 index 000000000000..13694b8924c4 --- /dev/null +++ b/drivers/pinctrl/mediatek/pinctrl-mt8135.c | |||
@@ -0,0 +1,350 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014 MediaTek Inc. | ||
3 | * Author: Hongzhou.Yang <hongzhou.yang@mediatek.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | */ | ||
14 | |||
15 | #include <linux/module.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/of.h> | ||
18 | #include <linux/of_device.h> | ||
19 | #include <linux/pinctrl/pinctrl.h> | ||
20 | #include <linux/regmap.h> | ||
21 | #include <dt-bindings/pinctrl/mt65xx.h> | ||
22 | |||
23 | #include "pinctrl-mtk-common.h" | ||
24 | #include "pinctrl-mtk-mt8135.h" | ||
25 | |||
26 | #define DRV_BASE1 0x500 | ||
27 | #define DRV_BASE2 0x510 | ||
28 | #define PUPD_BASE1 0x400 | ||
29 | #define PUPD_BASE2 0x450 | ||
30 | #define R0_BASE1 0x4d0 | ||
31 | #define R1_BASE1 0x200 | ||
32 | #define R1_BASE2 0x250 | ||
33 | |||
34 | struct mtk_spec_pull_set { | ||
35 | unsigned int pin; | ||
36 | unsigned int pupd_offset; | ||
37 | unsigned char pupd_bit; | ||
38 | unsigned int r0_offset; | ||
39 | unsigned char r0_bit; | ||
40 | unsigned int r1_offset; | ||
41 | unsigned char r1_bit; | ||
42 | }; | ||
43 | |||
44 | #define SPEC_PULL(_pin, _pupd_offset, _pupd_bit, _r0_offset, \ | ||
45 | _r0_bit, _r1_offset, _r1_bit) \ | ||
46 | { \ | ||
47 | .pin = _pin, \ | ||
48 | .pupd_offset = _pupd_offset, \ | ||
49 | .pupd_bit = _pupd_bit, \ | ||
50 | .r0_offset = _r0_offset, \ | ||
51 | .r0_bit = _r0_bit, \ | ||
52 | .r1_offset = _r1_offset, \ | ||
53 | .r1_bit = _r1_bit, \ | ||
54 | } | ||
55 | |||
56 | static const struct mtk_drv_group_desc mt8135_drv_grp[] = { | ||
57 | /* E8E4E2 2/4/6/8/10/12/14/16 */ | ||
58 | MTK_DRV_GRP(2, 16, 0, 2, 2), | ||
59 | /* E8E4 4/8/12/16 */ | ||
60 | MTK_DRV_GRP(4, 16, 1, 2, 4), | ||
61 | /* E4E2 2/4/6/8 */ | ||
62 | MTK_DRV_GRP(2, 8, 0, 1, 2), | ||
63 | /* E16E8E4 4/8/12/16/20/24/28/32 */ | ||
64 | MTK_DRV_GRP(4, 32, 0, 2, 4) | ||
65 | }; | ||
66 | |||
67 | static const struct mtk_pin_drv_grp mt8135_pin_drv[] = { | ||
68 | MTK_PIN_DRV_GRP(0, DRV_BASE1, 0, 0), | ||
69 | MTK_PIN_DRV_GRP(1, DRV_BASE1, 0, 0), | ||
70 | MTK_PIN_DRV_GRP(2, DRV_BASE1, 0, 0), | ||
71 | MTK_PIN_DRV_GRP(3, DRV_BASE1, 0, 0), | ||
72 | MTK_PIN_DRV_GRP(4, DRV_BASE1, 4, 0), | ||
73 | MTK_PIN_DRV_GRP(5, DRV_BASE1, 8, 0), | ||
74 | MTK_PIN_DRV_GRP(6, DRV_BASE1, 0, 0), | ||
75 | MTK_PIN_DRV_GRP(7, DRV_BASE1, 0, 0), | ||
76 | MTK_PIN_DRV_GRP(8, DRV_BASE1, 0, 0), | ||
77 | MTK_PIN_DRV_GRP(9, DRV_BASE1, 0, 0), | ||
78 | |||
79 | MTK_PIN_DRV_GRP(10, DRV_BASE1, 12, 1), | ||
80 | MTK_PIN_DRV_GRP(11, DRV_BASE1, 12, 1), | ||
81 | MTK_PIN_DRV_GRP(12, DRV_BASE1, 12, 1), | ||
82 | MTK_PIN_DRV_GRP(13, DRV_BASE1, 12, 1), | ||
83 | MTK_PIN_DRV_GRP(14, DRV_BASE1, 12, 1), | ||
84 | MTK_PIN_DRV_GRP(15, DRV_BASE1, 12, 1), | ||
85 | MTK_PIN_DRV_GRP(16, DRV_BASE1, 12, 1), | ||
86 | MTK_PIN_DRV_GRP(17, DRV_BASE1, 16, 1), | ||
87 | MTK_PIN_DRV_GRP(18, DRV_BASE1, 16, 1), | ||
88 | MTK_PIN_DRV_GRP(19, DRV_BASE1, 16, 1), | ||
89 | MTK_PIN_DRV_GRP(20, DRV_BASE1, 16, 1), | ||
90 | MTK_PIN_DRV_GRP(21, DRV_BASE1, 16, 1), | ||
91 | MTK_PIN_DRV_GRP(22, DRV_BASE1, 16, 1), | ||
92 | MTK_PIN_DRV_GRP(23, DRV_BASE1, 16, 1), | ||
93 | MTK_PIN_DRV_GRP(24, DRV_BASE1, 16, 1), | ||
94 | MTK_PIN_DRV_GRP(33, DRV_BASE1, 24, 1), | ||
95 | MTK_PIN_DRV_GRP(34, DRV_BASE2, 12, 2), | ||
96 | MTK_PIN_DRV_GRP(37, DRV_BASE2, 20, 1), | ||
97 | MTK_PIN_DRV_GRP(38, DRV_BASE2, 20, 1), | ||
98 | MTK_PIN_DRV_GRP(39, DRV_BASE2, 20, 1), | ||
99 | MTK_PIN_DRV_GRP(40, DRV_BASE2, 24, 1), | ||
100 | MTK_PIN_DRV_GRP(41, DRV_BASE2, 24, 1), | ||
101 | MTK_PIN_DRV_GRP(42, DRV_BASE2, 24, 1), | ||
102 | MTK_PIN_DRV_GRP(43, DRV_BASE2, 28, 1), | ||
103 | MTK_PIN_DRV_GRP(44, DRV_BASE2, 28, 1), | ||
104 | MTK_PIN_DRV_GRP(45, DRV_BASE2, 28, 1), | ||
105 | MTK_PIN_DRV_GRP(46, DRV_BASE2, 28, 1), | ||
106 | MTK_PIN_DRV_GRP(47, DRV_BASE2, 28, 1), | ||
107 | |||
108 | MTK_PIN_DRV_GRP(49, DRV_BASE2+0x10, 0, 1), | ||
109 | MTK_PIN_DRV_GRP(50, DRV_BASE2+0x10, 4, 1), | ||
110 | MTK_PIN_DRV_GRP(51, DRV_BASE2+0x10, 8, 1), | ||
111 | MTK_PIN_DRV_GRP(52, DRV_BASE2+0x10, 12, 2), | ||
112 | MTK_PIN_DRV_GRP(53, DRV_BASE2+0x10, 16, 1), | ||
113 | MTK_PIN_DRV_GRP(54, DRV_BASE2+0x10, 20, 1), | ||
114 | MTK_PIN_DRV_GRP(55, DRV_BASE2+0x10, 24, 1), | ||
115 | MTK_PIN_DRV_GRP(56, DRV_BASE2+0x10, 28, 1), | ||
116 | |||
117 | MTK_PIN_DRV_GRP(57, DRV_BASE2+0x20, 0, 1), | ||
118 | MTK_PIN_DRV_GRP(58, DRV_BASE2+0x20, 0, 1), | ||
119 | MTK_PIN_DRV_GRP(59, DRV_BASE2+0x20, 0, 1), | ||
120 | MTK_PIN_DRV_GRP(60, DRV_BASE2+0x20, 0, 1), | ||
121 | MTK_PIN_DRV_GRP(61, DRV_BASE2+0x20, 0, 1), | ||
122 | MTK_PIN_DRV_GRP(62, DRV_BASE2+0x20, 0, 1), | ||
123 | MTK_PIN_DRV_GRP(63, DRV_BASE2+0x20, 4, 1), | ||
124 | MTK_PIN_DRV_GRP(64, DRV_BASE2+0x20, 8, 1), | ||
125 | MTK_PIN_DRV_GRP(65, DRV_BASE2+0x20, 12, 1), | ||
126 | MTK_PIN_DRV_GRP(66, DRV_BASE2+0x20, 16, 1), | ||
127 | MTK_PIN_DRV_GRP(67, DRV_BASE2+0x20, 20, 1), | ||
128 | MTK_PIN_DRV_GRP(68, DRV_BASE2+0x20, 24, 1), | ||
129 | MTK_PIN_DRV_GRP(69, DRV_BASE2+0x20, 28, 1), | ||
130 | |||
131 | MTK_PIN_DRV_GRP(70, DRV_BASE2+0x30, 0, 1), | ||
132 | MTK_PIN_DRV_GRP(71, DRV_BASE2+0x30, 4, 1), | ||
133 | MTK_PIN_DRV_GRP(72, DRV_BASE2+0x30, 8, 1), | ||
134 | MTK_PIN_DRV_GRP(73, DRV_BASE2+0x30, 12, 1), | ||
135 | MTK_PIN_DRV_GRP(74, DRV_BASE2+0x30, 16, 1), | ||
136 | MTK_PIN_DRV_GRP(75, DRV_BASE2+0x30, 20, 1), | ||
137 | MTK_PIN_DRV_GRP(76, DRV_BASE2+0x30, 24, 1), | ||
138 | MTK_PIN_DRV_GRP(77, DRV_BASE2+0x30, 28, 3), | ||
139 | MTK_PIN_DRV_GRP(78, DRV_BASE2+0x30, 28, 3), | ||
140 | |||
141 | MTK_PIN_DRV_GRP(79, DRV_BASE2+0x40, 0, 3), | ||
142 | MTK_PIN_DRV_GRP(80, DRV_BASE2+0x40, 4, 3), | ||
143 | |||
144 | MTK_PIN_DRV_GRP(81, DRV_BASE2+0x30, 28, 3), | ||
145 | MTK_PIN_DRV_GRP(82, DRV_BASE2+0x30, 28, 3), | ||
146 | |||
147 | MTK_PIN_DRV_GRP(83, DRV_BASE2+0x40, 8, 3), | ||
148 | MTK_PIN_DRV_GRP(84, DRV_BASE2+0x40, 8, 3), | ||
149 | MTK_PIN_DRV_GRP(85, DRV_BASE2+0x40, 12, 3), | ||
150 | MTK_PIN_DRV_GRP(86, DRV_BASE2+0x40, 16, 3), | ||
151 | MTK_PIN_DRV_GRP(87, DRV_BASE2+0x40, 8, 3), | ||
152 | MTK_PIN_DRV_GRP(88, DRV_BASE2+0x40, 8, 3), | ||
153 | |||
154 | MTK_PIN_DRV_GRP(89, DRV_BASE2+0x50, 12, 0), | ||
155 | MTK_PIN_DRV_GRP(90, DRV_BASE2+0x50, 12, 0), | ||
156 | MTK_PIN_DRV_GRP(91, DRV_BASE2+0x50, 12, 0), | ||
157 | MTK_PIN_DRV_GRP(92, DRV_BASE2+0x50, 12, 0), | ||
158 | MTK_PIN_DRV_GRP(93, DRV_BASE2+0x50, 12, 0), | ||
159 | MTK_PIN_DRV_GRP(94, DRV_BASE2+0x50, 12, 0), | ||
160 | MTK_PIN_DRV_GRP(95, DRV_BASE2+0x50, 12, 0), | ||
161 | |||
162 | MTK_PIN_DRV_GRP(96, DRV_BASE1+0xb0, 28, 0), | ||
163 | |||
164 | MTK_PIN_DRV_GRP(97, DRV_BASE2+0x50, 12, 0), | ||
165 | MTK_PIN_DRV_GRP(98, DRV_BASE2+0x50, 16, 0), | ||
166 | MTK_PIN_DRV_GRP(99, DRV_BASE2+0x50, 20, 1), | ||
167 | MTK_PIN_DRV_GRP(102, DRV_BASE2+0x50, 24, 1), | ||
168 | MTK_PIN_DRV_GRP(103, DRV_BASE2+0x50, 28, 1), | ||
169 | |||
170 | |||
171 | MTK_PIN_DRV_GRP(104, DRV_BASE2+0x60, 0, 1), | ||
172 | MTK_PIN_DRV_GRP(105, DRV_BASE2+0x60, 4, 1), | ||
173 | MTK_PIN_DRV_GRP(106, DRV_BASE2+0x60, 4, 1), | ||
174 | MTK_PIN_DRV_GRP(107, DRV_BASE2+0x60, 4, 1), | ||
175 | MTK_PIN_DRV_GRP(108, DRV_BASE2+0x60, 4, 1), | ||
176 | MTK_PIN_DRV_GRP(109, DRV_BASE2+0x60, 8, 2), | ||
177 | MTK_PIN_DRV_GRP(110, DRV_BASE2+0x60, 12, 2), | ||
178 | MTK_PIN_DRV_GRP(111, DRV_BASE2+0x60, 16, 2), | ||
179 | MTK_PIN_DRV_GRP(112, DRV_BASE2+0x60, 20, 2), | ||
180 | MTK_PIN_DRV_GRP(113, DRV_BASE2+0x60, 24, 2), | ||
181 | MTK_PIN_DRV_GRP(114, DRV_BASE2+0x60, 28, 2), | ||
182 | |||
183 | MTK_PIN_DRV_GRP(115, DRV_BASE2+0x70, 0, 2), | ||
184 | MTK_PIN_DRV_GRP(116, DRV_BASE2+0x70, 4, 2), | ||
185 | MTK_PIN_DRV_GRP(117, DRV_BASE2+0x70, 8, 2), | ||
186 | MTK_PIN_DRV_GRP(118, DRV_BASE2+0x70, 12, 2), | ||
187 | MTK_PIN_DRV_GRP(119, DRV_BASE2+0x70, 16, 2), | ||
188 | MTK_PIN_DRV_GRP(120, DRV_BASE2+0x70, 20, 2), | ||
189 | |||
190 | MTK_PIN_DRV_GRP(181, DRV_BASE1+0xa0, 12, 1), | ||
191 | MTK_PIN_DRV_GRP(182, DRV_BASE1+0xa0, 16, 1), | ||
192 | MTK_PIN_DRV_GRP(183, DRV_BASE1+0xa0, 20, 1), | ||
193 | MTK_PIN_DRV_GRP(184, DRV_BASE1+0xa0, 24, 1), | ||
194 | MTK_PIN_DRV_GRP(185, DRV_BASE1+0xa0, 28, 1), | ||
195 | |||
196 | MTK_PIN_DRV_GRP(186, DRV_BASE1+0xb0, 0, 2), | ||
197 | MTK_PIN_DRV_GRP(187, DRV_BASE1+0xb0, 0, 2), | ||
198 | MTK_PIN_DRV_GRP(188, DRV_BASE1+0xb0, 0, 2), | ||
199 | MTK_PIN_DRV_GRP(189, DRV_BASE1+0xb0, 0, 2), | ||
200 | MTK_PIN_DRV_GRP(190, DRV_BASE1+0xb0, 4, 1), | ||
201 | MTK_PIN_DRV_GRP(191, DRV_BASE1+0xb0, 8, 1), | ||
202 | MTK_PIN_DRV_GRP(192, DRV_BASE1+0xb0, 12, 1), | ||
203 | |||
204 | MTK_PIN_DRV_GRP(197, DRV_BASE1+0xb0, 16, 0), | ||
205 | MTK_PIN_DRV_GRP(198, DRV_BASE1+0xb0, 16, 0), | ||
206 | MTK_PIN_DRV_GRP(199, DRV_BASE1+0xb0, 20, 0), | ||
207 | MTK_PIN_DRV_GRP(200, DRV_BASE1+0xb0, 24, 0), | ||
208 | MTK_PIN_DRV_GRP(201, DRV_BASE1+0xb0, 16, 0), | ||
209 | MTK_PIN_DRV_GRP(202, DRV_BASE1+0xb0, 16, 0) | ||
210 | }; | ||
211 | |||
212 | static const struct mtk_spec_pull_set spec_pupd[] = { | ||
213 | SPEC_PULL(0, PUPD_BASE1, 0, R0_BASE1, 9, R1_BASE1, 0), | ||
214 | SPEC_PULL(1, PUPD_BASE1, 1, R0_BASE1, 8, R1_BASE1, 1), | ||
215 | SPEC_PULL(2, PUPD_BASE1, 2, R0_BASE1, 7, R1_BASE1, 2), | ||
216 | SPEC_PULL(3, PUPD_BASE1, 3, R0_BASE1, 6, R1_BASE1, 3), | ||
217 | SPEC_PULL(4, PUPD_BASE1, 4, R0_BASE1, 1, R1_BASE1, 4), | ||
218 | SPEC_PULL(5, PUPD_BASE1, 5, R0_BASE1, 0, R1_BASE1, 5), | ||
219 | SPEC_PULL(6, PUPD_BASE1, 6, R0_BASE1, 5, R1_BASE1, 6), | ||
220 | SPEC_PULL(7, PUPD_BASE1, 7, R0_BASE1, 4, R1_BASE1, 7), | ||
221 | SPEC_PULL(8, PUPD_BASE1, 8, R0_BASE1, 3, R1_BASE1, 8), | ||
222 | SPEC_PULL(9, PUPD_BASE1, 9, R0_BASE1, 2, R1_BASE1, 9), | ||
223 | SPEC_PULL(89, PUPD_BASE2, 9, R0_BASE1, 18, R1_BASE2, 9), | ||
224 | SPEC_PULL(90, PUPD_BASE2, 10, R0_BASE1, 19, R1_BASE2, 10), | ||
225 | SPEC_PULL(91, PUPD_BASE2, 11, R0_BASE1, 23, R1_BASE2, 11), | ||
226 | SPEC_PULL(92, PUPD_BASE2, 12, R0_BASE1, 24, R1_BASE2, 12), | ||
227 | SPEC_PULL(93, PUPD_BASE2, 13, R0_BASE1, 25, R1_BASE2, 13), | ||
228 | SPEC_PULL(94, PUPD_BASE2, 14, R0_BASE1, 22, R1_BASE2, 14), | ||
229 | SPEC_PULL(95, PUPD_BASE2, 15, R0_BASE1, 20, R1_BASE2, 15), | ||
230 | SPEC_PULL(96, PUPD_BASE2+0x10, 0, R0_BASE1, 16, R1_BASE2+0x10, 0), | ||
231 | SPEC_PULL(97, PUPD_BASE2+0x10, 1, R0_BASE1, 21, R1_BASE2+0x10, 1), | ||
232 | SPEC_PULL(98, PUPD_BASE2+0x10, 2, R0_BASE1, 17, R1_BASE2+0x10, 2), | ||
233 | SPEC_PULL(197, PUPD_BASE1+0xc0, 5, R0_BASE1, 13, R1_BASE2+0xc0, 5), | ||
234 | SPEC_PULL(198, PUPD_BASE2+0xc0, 6, R0_BASE1, 14, R1_BASE2+0xc0, 6), | ||
235 | SPEC_PULL(199, PUPD_BASE2+0xc0, 7, R0_BASE1, 11, R1_BASE2+0xc0, 7), | ||
236 | SPEC_PULL(200, PUPD_BASE2+0xc0, 8, R0_BASE1, 10, R1_BASE2+0xc0, 8), | ||
237 | SPEC_PULL(201, PUPD_BASE2+0xc0, 9, R0_BASE1, 13, R1_BASE2+0xc0, 9), | ||
238 | SPEC_PULL(202, PUPD_BASE2+0xc0, 10, R0_BASE1, 12, R1_BASE2+0xc0, 10) | ||
239 | }; | ||
240 | |||
241 | static int spec_pull_set(struct regmap *regmap, unsigned int pin, | ||
242 | unsigned char align, bool isup, unsigned int r1r0) | ||
243 | { | ||
244 | unsigned int i; | ||
245 | unsigned int reg_pupd, reg_set_r0, reg_set_r1; | ||
246 | unsigned int reg_rst_r0, reg_rst_r1; | ||
247 | bool find = false; | ||
248 | |||
249 | for (i = 0; i < ARRAY_SIZE(spec_pupd); i++) { | ||
250 | if (pin == spec_pupd[i].pin) { | ||
251 | find = true; | ||
252 | break; | ||
253 | } | ||
254 | } | ||
255 | |||
256 | if (!find) | ||
257 | return -EINVAL; | ||
258 | |||
259 | if (isup) | ||
260 | reg_pupd = spec_pupd[i].pupd_offset + align; | ||
261 | else | ||
262 | reg_pupd = spec_pupd[i].pupd_offset + (align << 1); | ||
263 | |||
264 | regmap_write(regmap, reg_pupd, spec_pupd[i].pupd_bit); | ||
265 | |||
266 | reg_set_r0 = spec_pupd[i].r0_offset + align; | ||
267 | reg_rst_r0 = spec_pupd[i].r0_offset + (align << 1); | ||
268 | reg_set_r1 = spec_pupd[i].r1_offset + align; | ||
269 | reg_rst_r1 = spec_pupd[i].r1_offset + (align << 1); | ||
270 | |||
271 | switch (r1r0) { | ||
272 | case MTK_PUPD_SET_R1R0_00: | ||
273 | regmap_write(regmap, reg_rst_r0, spec_pupd[i].r0_bit); | ||
274 | regmap_write(regmap, reg_rst_r1, spec_pupd[i].r1_bit); | ||
275 | break; | ||
276 | case MTK_PUPD_SET_R1R0_01: | ||
277 | regmap_write(regmap, reg_set_r0, spec_pupd[i].r0_bit); | ||
278 | regmap_write(regmap, reg_rst_r1, spec_pupd[i].r1_bit); | ||
279 | break; | ||
280 | case MTK_PUPD_SET_R1R0_10: | ||
281 | regmap_write(regmap, reg_rst_r0, spec_pupd[i].r0_bit); | ||
282 | regmap_write(regmap, reg_set_r1, spec_pupd[i].r1_bit); | ||
283 | break; | ||
284 | case MTK_PUPD_SET_R1R0_11: | ||
285 | regmap_write(regmap, reg_set_r0, spec_pupd[i].r0_bit); | ||
286 | regmap_write(regmap, reg_set_r1, spec_pupd[i].r1_bit); | ||
287 | break; | ||
288 | default: | ||
289 | return -EINVAL; | ||
290 | } | ||
291 | |||
292 | return 0; | ||
293 | } | ||
294 | |||
295 | static const struct mtk_pinctrl_devdata mt8135_pinctrl_data = { | ||
296 | .pins = mtk_pins_mt8135, | ||
297 | .npins = ARRAY_SIZE(mtk_pins_mt8135), | ||
298 | .grp_desc = mt8135_drv_grp, | ||
299 | .n_grp_cls = ARRAY_SIZE(mt8135_drv_grp), | ||
300 | .pin_drv_grp = mt8135_pin_drv, | ||
301 | .n_pin_drv_grps = ARRAY_SIZE(mt8135_pin_drv), | ||
302 | .spec_pull_set = spec_pull_set, | ||
303 | .dir_offset = 0x0000, | ||
304 | .ies_offset = 0x0100, | ||
305 | .pullen_offset = 0x0200, | ||
306 | .smt_offset = 0x0300, | ||
307 | .pullsel_offset = 0x0400, | ||
308 | .invser_offset = 0x0600, | ||
309 | .dout_offset = 0x0800, | ||
310 | .din_offset = 0x0A00, | ||
311 | .pinmux_offset = 0x0C00, | ||
312 | .type1_start = 34, | ||
313 | .type1_end = 149, | ||
314 | .port_shf = 4, | ||
315 | .port_mask = 0xf, | ||
316 | .port_align = 4, | ||
317 | }; | ||
318 | |||
319 | static int mt8135_pinctrl_probe(struct platform_device *pdev) | ||
320 | { | ||
321 | return mtk_pctrl_init(pdev, &mt8135_pinctrl_data); | ||
322 | } | ||
323 | |||
324 | static struct of_device_id mt8135_pctrl_match[] = { | ||
325 | { | ||
326 | .compatible = "mediatek,mt8135-pinctrl", | ||
327 | }, { | ||
328 | } | ||
329 | }; | ||
330 | MODULE_DEVICE_TABLE(of, mt8135_pctrl_match); | ||
331 | |||
332 | static struct platform_driver mtk_pinctrl_driver = { | ||
333 | .probe = mt8135_pinctrl_probe, | ||
334 | .driver = { | ||
335 | .name = "mediatek-mt8135-pinctrl", | ||
336 | .owner = THIS_MODULE, | ||
337 | .of_match_table = mt8135_pctrl_match, | ||
338 | }, | ||
339 | }; | ||
340 | |||
341 | static int __init mtk_pinctrl_init(void) | ||
342 | { | ||
343 | return platform_driver_register(&mtk_pinctrl_driver); | ||
344 | } | ||
345 | |||
346 | module_init(mtk_pinctrl_init); | ||
347 | |||
348 | MODULE_LICENSE("GPL"); | ||
349 | MODULE_DESCRIPTION("MediaTek Pinctrl Driver"); | ||
350 | MODULE_AUTHOR("Hongzhou Yang <hongzhou.yang@mediatek.com>"); | ||
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c new file mode 100644 index 000000000000..5d680c89b5d8 --- /dev/null +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c | |||
@@ -0,0 +1,800 @@ | |||
1 | /* | ||
2 | * mt65xx pinctrl driver based on Allwinner A1X pinctrl driver. | ||
3 | * Copyright (c) 2014 MediaTek Inc. | ||
4 | * Author: Hongzhou.Yang <hongzhou.yang@mediatek.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #include <linux/io.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/of.h> | ||
20 | #include <linux/of_address.h> | ||
21 | #include <linux/of_device.h> | ||
22 | #include <linux/of_irq.h> | ||
23 | #include <linux/pinctrl/consumer.h> | ||
24 | #include <linux/pinctrl/machine.h> | ||
25 | #include <linux/pinctrl/pinconf.h> | ||
26 | #include <linux/pinctrl/pinconf-generic.h> | ||
27 | #include <linux/pinctrl/pinctrl.h> | ||
28 | #include <linux/pinctrl/pinmux.h> | ||
29 | #include <linux/platform_device.h> | ||
30 | #include <linux/slab.h> | ||
31 | #include <linux/bitops.h> | ||
32 | #include <linux/regmap.h> | ||
33 | #include <linux/mfd/syscon.h> | ||
34 | #include <dt-bindings/pinctrl/mt65xx.h> | ||
35 | |||
36 | #include "../core.h" | ||
37 | #include "../pinconf.h" | ||
38 | #include "../pinctrl-utils.h" | ||
39 | #include "pinctrl-mtk-common.h" | ||
40 | |||
41 | #define MAX_GPIO_MODE_PER_REG 5 | ||
42 | #define GPIO_MODE_BITS 3 | ||
43 | |||
44 | static const char * const mtk_gpio_functions[] = { | ||
45 | "func0", "func1", "func2", "func3", | ||
46 | "func4", "func5", "func6", "func7", | ||
47 | }; | ||
48 | |||
49 | /* | ||
50 | * There are two base address for pull related configuration | ||
51 | * in mt8135, and different GPIO pins use different base address. | ||
52 | * When pin number greater than type1_start and less than type1_end, | ||
53 | * should use the second base address. | ||
54 | */ | ||
55 | static struct regmap *mtk_get_regmap(struct mtk_pinctrl *pctl, | ||
56 | unsigned long pin) | ||
57 | { | ||
58 | if (pin >= pctl->devdata->type1_start && pin < pctl->devdata->type1_end) | ||
59 | return pctl->regmap2; | ||
60 | return pctl->regmap1; | ||
61 | } | ||
62 | |||
63 | static unsigned int mtk_get_port(struct mtk_pinctrl *pctl, unsigned long pin) | ||
64 | { | ||
65 | /* Different SoC has different mask and port shift. */ | ||
66 | return ((pin >> 4) & pctl->devdata->port_mask) | ||
67 | << pctl->devdata->port_shf; | ||
68 | } | ||
69 | |||
70 | static int mtk_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, | ||
71 | struct pinctrl_gpio_range *range, unsigned offset, | ||
72 | bool input) | ||
73 | { | ||
74 | unsigned int reg_addr; | ||
75 | unsigned int bit; | ||
76 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
77 | |||
78 | reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset; | ||
79 | bit = BIT(offset & 0xf); | ||
80 | |||
81 | if (input) | ||
82 | /* Different SoC has different alignment offset. */ | ||
83 | reg_addr = CLR_ADDR(reg_addr, pctl); | ||
84 | else | ||
85 | reg_addr = SET_ADDR(reg_addr, pctl); | ||
86 | |||
87 | regmap_write(mtk_get_regmap(pctl, offset), reg_addr, bit); | ||
88 | return 0; | ||
89 | } | ||
90 | |||
91 | static void mtk_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | ||
92 | { | ||
93 | unsigned int reg_addr; | ||
94 | unsigned int bit; | ||
95 | struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); | ||
96 | |||
97 | reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dout_offset; | ||
98 | bit = BIT(offset & 0xf); | ||
99 | |||
100 | if (value) | ||
101 | reg_addr = SET_ADDR(reg_addr, pctl); | ||
102 | else | ||
103 | reg_addr = CLR_ADDR(reg_addr, pctl); | ||
104 | |||
105 | regmap_write(mtk_get_regmap(pctl, offset), reg_addr, bit); | ||
106 | } | ||
107 | |||
108 | static void mtk_pconf_set_ies_smt(struct mtk_pinctrl *pctl, unsigned pin, | ||
109 | int value, enum pin_config_param param) | ||
110 | { | ||
111 | unsigned int reg_addr, offset; | ||
112 | unsigned int bit; | ||
113 | |||
114 | bit = BIT(pin & 0xf); | ||
115 | |||
116 | if (param == PIN_CONFIG_INPUT_ENABLE) | ||
117 | offset = pctl->devdata->ies_offset; | ||
118 | else | ||
119 | offset = pctl->devdata->smt_offset; | ||
120 | |||
121 | if (value) | ||
122 | reg_addr = SET_ADDR(mtk_get_port(pctl, pin) + offset, pctl); | ||
123 | else | ||
124 | reg_addr = CLR_ADDR(mtk_get_port(pctl, pin) + offset, pctl); | ||
125 | |||
126 | regmap_write(mtk_get_regmap(pctl, pin), reg_addr, bit); | ||
127 | } | ||
128 | |||
129 | static const struct mtk_pin_drv_grp *mtk_find_pin_drv_grp_by_pin( | ||
130 | struct mtk_pinctrl *pctl, unsigned long pin) { | ||
131 | int i; | ||
132 | |||
133 | for (i = 0; i < pctl->devdata->n_pin_drv_grps; i++) { | ||
134 | const struct mtk_pin_drv_grp *pin_drv = | ||
135 | pctl->devdata->pin_drv_grp + i; | ||
136 | if (pin == pin_drv->pin) | ||
137 | return pin_drv; | ||
138 | } | ||
139 | |||
140 | return NULL; | ||
141 | } | ||
142 | |||
143 | static int mtk_pconf_set_driving(struct mtk_pinctrl *pctl, | ||
144 | unsigned int pin, unsigned char driving) | ||
145 | { | ||
146 | const struct mtk_pin_drv_grp *pin_drv; | ||
147 | unsigned int val; | ||
148 | unsigned int bits, mask, shift; | ||
149 | const struct mtk_drv_group_desc *drv_grp; | ||
150 | |||
151 | if (pin >= pctl->devdata->npins) | ||
152 | return -EINVAL; | ||
153 | |||
154 | pin_drv = mtk_find_pin_drv_grp_by_pin(pctl, pin); | ||
155 | if (!pin_drv || pin_drv->grp > pctl->devdata->n_grp_cls) | ||
156 | return -EINVAL; | ||
157 | |||
158 | drv_grp = pctl->devdata->grp_desc + pin_drv->grp; | ||
159 | if (driving >= drv_grp->min_drv && driving <= drv_grp->max_drv | ||
160 | && !(driving % drv_grp->step)) { | ||
161 | val = driving / drv_grp->step - 1; | ||
162 | bits = drv_grp->high_bit - drv_grp->low_bit + 1; | ||
163 | mask = BIT(bits) - 1; | ||
164 | shift = pin_drv->bit + drv_grp->low_bit; | ||
165 | mask <<= shift; | ||
166 | val <<= shift; | ||
167 | return regmap_update_bits(mtk_get_regmap(pctl, pin), | ||
168 | pin_drv->offset, mask, val); | ||
169 | } | ||
170 | |||
171 | return -EINVAL; | ||
172 | } | ||
173 | |||
174 | static int mtk_pconf_set_pull_select(struct mtk_pinctrl *pctl, | ||
175 | unsigned int pin, bool enable, bool isup, unsigned int arg) | ||
176 | { | ||
177 | unsigned int bit; | ||
178 | unsigned int reg_pullen, reg_pullsel; | ||
179 | int ret; | ||
180 | |||
181 | /* Some pins' pull setting are very different, | ||
182 | * they have separate pull up/down bit, R0 and R1 | ||
183 | * resistor bit, so we need this special handle. | ||
184 | */ | ||
185 | if (pctl->devdata->spec_pull_set) { | ||
186 | ret = pctl->devdata->spec_pull_set(mtk_get_regmap(pctl, pin), | ||
187 | pin, pctl->devdata->port_align, isup, arg); | ||
188 | if (!ret) | ||
189 | return 0; | ||
190 | } | ||
191 | |||
192 | /* For generic pull config, default arg value should be 0 or 1. */ | ||
193 | if (arg != 0 && arg != 1) { | ||
194 | dev_err(pctl->dev, "invalid pull-up argument %d on pin %d .\n", | ||
195 | arg, pin); | ||
196 | return -EINVAL; | ||
197 | } | ||
198 | |||
199 | bit = BIT(pin & 0xf); | ||
200 | if (enable) | ||
201 | reg_pullen = SET_ADDR(mtk_get_port(pctl, pin) + | ||
202 | pctl->devdata->pullen_offset, pctl); | ||
203 | else | ||
204 | reg_pullen = CLR_ADDR(mtk_get_port(pctl, pin) + | ||
205 | pctl->devdata->pullen_offset, pctl); | ||
206 | |||
207 | if (isup) | ||
208 | reg_pullsel = SET_ADDR(mtk_get_port(pctl, pin) + | ||
209 | pctl->devdata->pullsel_offset, pctl); | ||
210 | else | ||
211 | reg_pullsel = CLR_ADDR(mtk_get_port(pctl, pin) + | ||
212 | pctl->devdata->pullsel_offset, pctl); | ||
213 | |||
214 | regmap_write(mtk_get_regmap(pctl, pin), reg_pullen, bit); | ||
215 | regmap_write(mtk_get_regmap(pctl, pin), reg_pullsel, bit); | ||
216 | return 0; | ||
217 | } | ||
218 | |||
219 | static int mtk_pconf_parse_conf(struct pinctrl_dev *pctldev, | ||
220 | unsigned int pin, enum pin_config_param param, | ||
221 | enum pin_config_param arg) | ||
222 | { | ||
223 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
224 | |||
225 | switch (param) { | ||
226 | case PIN_CONFIG_BIAS_DISABLE: | ||
227 | mtk_pconf_set_pull_select(pctl, pin, false, false, arg); | ||
228 | break; | ||
229 | case PIN_CONFIG_BIAS_PULL_UP: | ||
230 | mtk_pconf_set_pull_select(pctl, pin, true, true, arg); | ||
231 | break; | ||
232 | case PIN_CONFIG_BIAS_PULL_DOWN: | ||
233 | mtk_pconf_set_pull_select(pctl, pin, true, false, arg); | ||
234 | break; | ||
235 | case PIN_CONFIG_INPUT_ENABLE: | ||
236 | mtk_pconf_set_ies_smt(pctl, pin, arg, param); | ||
237 | break; | ||
238 | case PIN_CONFIG_OUTPUT: | ||
239 | mtk_gpio_set(pctl->chip, pin, arg); | ||
240 | mtk_pmx_gpio_set_direction(pctldev, NULL, pin, false); | ||
241 | break; | ||
242 | case PIN_CONFIG_INPUT_SCHMITT_ENABLE: | ||
243 | mtk_pconf_set_ies_smt(pctl, pin, arg, param); | ||
244 | break; | ||
245 | case PIN_CONFIG_DRIVE_STRENGTH: | ||
246 | mtk_pconf_set_driving(pctl, pin, arg); | ||
247 | break; | ||
248 | default: | ||
249 | return -EINVAL; | ||
250 | } | ||
251 | |||
252 | return 0; | ||
253 | } | ||
254 | |||
255 | static int mtk_pconf_group_get(struct pinctrl_dev *pctldev, | ||
256 | unsigned group, | ||
257 | unsigned long *config) | ||
258 | { | ||
259 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
260 | |||
261 | *config = pctl->groups[group].config; | ||
262 | |||
263 | return 0; | ||
264 | } | ||
265 | |||
266 | static int mtk_pconf_group_set(struct pinctrl_dev *pctldev, unsigned group, | ||
267 | unsigned long *configs, unsigned num_configs) | ||
268 | { | ||
269 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
270 | struct mtk_pinctrl_group *g = &pctl->groups[group]; | ||
271 | int i; | ||
272 | |||
273 | for (i = 0; i < num_configs; i++) { | ||
274 | mtk_pconf_parse_conf(pctldev, g->pin, | ||
275 | pinconf_to_config_param(configs[i]), | ||
276 | pinconf_to_config_argument(configs[i])); | ||
277 | |||
278 | g->config = configs[i]; | ||
279 | } | ||
280 | |||
281 | return 0; | ||
282 | } | ||
283 | |||
284 | static const struct pinconf_ops mtk_pconf_ops = { | ||
285 | .pin_config_group_get = mtk_pconf_group_get, | ||
286 | .pin_config_group_set = mtk_pconf_group_set, | ||
287 | }; | ||
288 | |||
289 | static struct mtk_pinctrl_group * | ||
290 | mtk_pctrl_find_group_by_pin(struct mtk_pinctrl *pctl, u32 pin) | ||
291 | { | ||
292 | int i; | ||
293 | |||
294 | for (i = 0; i < pctl->ngroups; i++) { | ||
295 | struct mtk_pinctrl_group *grp = pctl->groups + i; | ||
296 | |||
297 | if (grp->pin == pin) | ||
298 | return grp; | ||
299 | } | ||
300 | |||
301 | return NULL; | ||
302 | } | ||
303 | |||
304 | static const struct mtk_desc_function *mtk_pctrl_find_function_by_pin( | ||
305 | struct mtk_pinctrl *pctl, u32 pin_num, u32 fnum) | ||
306 | { | ||
307 | const struct mtk_desc_pin *pin = pctl->devdata->pins + pin_num; | ||
308 | const struct mtk_desc_function *func = pin->functions; | ||
309 | |||
310 | while (func && func->name) { | ||
311 | if (func->muxval == fnum) | ||
312 | return func; | ||
313 | func++; | ||
314 | } | ||
315 | |||
316 | return NULL; | ||
317 | } | ||
318 | |||
319 | static bool mtk_pctrl_is_function_valid(struct mtk_pinctrl *pctl, | ||
320 | u32 pin_num, u32 fnum) | ||
321 | { | ||
322 | int i; | ||
323 | |||
324 | for (i = 0; i < pctl->devdata->npins; i++) { | ||
325 | const struct mtk_desc_pin *pin = pctl->devdata->pins + i; | ||
326 | |||
327 | if (pin->pin.number == pin_num) { | ||
328 | const struct mtk_desc_function *func = | ||
329 | pin->functions; | ||
330 | |||
331 | while (func && func->name) { | ||
332 | if (func->muxval == fnum) | ||
333 | return true; | ||
334 | func++; | ||
335 | } | ||
336 | |||
337 | break; | ||
338 | } | ||
339 | } | ||
340 | |||
341 | return false; | ||
342 | } | ||
343 | |||
344 | static int mtk_pctrl_dt_node_to_map_func(struct mtk_pinctrl *pctl, | ||
345 | u32 pin, u32 fnum, struct mtk_pinctrl_group *grp, | ||
346 | struct pinctrl_map **map, unsigned *reserved_maps, | ||
347 | unsigned *num_maps) | ||
348 | { | ||
349 | bool ret; | ||
350 | |||
351 | if (*num_maps == *reserved_maps) | ||
352 | return -ENOSPC; | ||
353 | |||
354 | (*map)[*num_maps].type = PIN_MAP_TYPE_MUX_GROUP; | ||
355 | (*map)[*num_maps].data.mux.group = grp->name; | ||
356 | |||
357 | ret = mtk_pctrl_is_function_valid(pctl, pin, fnum); | ||
358 | if (!ret) { | ||
359 | dev_err(pctl->dev, "invalid function %d on pin %d .\n", | ||
360 | fnum, pin); | ||
361 | return -EINVAL; | ||
362 | } | ||
363 | |||
364 | (*map)[*num_maps].data.mux.function = mtk_gpio_functions[fnum]; | ||
365 | (*num_maps)++; | ||
366 | |||
367 | return 0; | ||
368 | } | ||
369 | |||
370 | static int mtk_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev, | ||
371 | struct device_node *node, | ||
372 | struct pinctrl_map **map, | ||
373 | unsigned *reserved_maps, | ||
374 | unsigned *num_maps) | ||
375 | { | ||
376 | struct property *pins; | ||
377 | u32 pinfunc, pin, func; | ||
378 | int num_pins, num_funcs, maps_per_pin; | ||
379 | unsigned long *configs; | ||
380 | unsigned int num_configs; | ||
381 | bool has_config = 0; | ||
382 | int i, err; | ||
383 | unsigned reserve = 0; | ||
384 | struct mtk_pinctrl_group *grp; | ||
385 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
386 | |||
387 | pins = of_find_property(node, "pinmux", NULL); | ||
388 | if (!pins) { | ||
389 | dev_err(pctl->dev, "missing pins property in node %s .\n", | ||
390 | node->name); | ||
391 | return -EINVAL; | ||
392 | } | ||
393 | |||
394 | err = pinconf_generic_parse_dt_config(node, &configs, &num_configs); | ||
395 | if (num_configs) | ||
396 | has_config = 1; | ||
397 | |||
398 | num_pins = pins->length / sizeof(u32); | ||
399 | num_funcs = num_pins; | ||
400 | maps_per_pin = 0; | ||
401 | if (num_funcs) | ||
402 | maps_per_pin++; | ||
403 | if (has_config && num_pins >= 1) | ||
404 | maps_per_pin++; | ||
405 | |||
406 | if (!num_pins || !maps_per_pin) | ||
407 | return -EINVAL; | ||
408 | |||
409 | reserve = num_pins * maps_per_pin; | ||
410 | |||
411 | err = pinctrl_utils_reserve_map(pctldev, map, | ||
412 | reserved_maps, num_maps, reserve); | ||
413 | if (err < 0) | ||
414 | goto fail; | ||
415 | |||
416 | for (i = 0; i < num_pins; i++) { | ||
417 | err = of_property_read_u32_index(node, "pinmux", | ||
418 | i, &pinfunc); | ||
419 | if (err) | ||
420 | goto fail; | ||
421 | |||
422 | pin = MTK_GET_PIN_NO(pinfunc); | ||
423 | func = MTK_GET_PIN_FUNC(pinfunc); | ||
424 | |||
425 | if (pin >= pctl->devdata->npins || | ||
426 | func >= ARRAY_SIZE(mtk_gpio_functions)) { | ||
427 | dev_err(pctl->dev, "invalid pins value.\n"); | ||
428 | err = -EINVAL; | ||
429 | goto fail; | ||
430 | } | ||
431 | |||
432 | grp = mtk_pctrl_find_group_by_pin(pctl, pin); | ||
433 | if (!grp) { | ||
434 | dev_err(pctl->dev, "unable to match pin %d to group\n", | ||
435 | pin); | ||
436 | return -EINVAL; | ||
437 | } | ||
438 | |||
439 | err = mtk_pctrl_dt_node_to_map_func(pctl, pin, func, grp, map, | ||
440 | reserved_maps, num_maps); | ||
441 | if (err < 0) | ||
442 | goto fail; | ||
443 | |||
444 | if (has_config) { | ||
445 | err = pinctrl_utils_add_map_configs(pctldev, map, | ||
446 | reserved_maps, num_maps, grp->name, | ||
447 | configs, num_configs, | ||
448 | PIN_MAP_TYPE_CONFIGS_GROUP); | ||
449 | if (err < 0) | ||
450 | goto fail; | ||
451 | } | ||
452 | } | ||
453 | |||
454 | return 0; | ||
455 | |||
456 | fail: | ||
457 | return err; | ||
458 | } | ||
459 | |||
460 | static int mtk_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, | ||
461 | struct device_node *np_config, | ||
462 | struct pinctrl_map **map, unsigned *num_maps) | ||
463 | { | ||
464 | struct device_node *np; | ||
465 | unsigned reserved_maps; | ||
466 | int ret; | ||
467 | |||
468 | *map = NULL; | ||
469 | *num_maps = 0; | ||
470 | reserved_maps = 0; | ||
471 | |||
472 | for_each_child_of_node(np_config, np) { | ||
473 | ret = mtk_pctrl_dt_subnode_to_map(pctldev, np, map, | ||
474 | &reserved_maps, num_maps); | ||
475 | if (ret < 0) { | ||
476 | pinctrl_utils_dt_free_map(pctldev, *map, *num_maps); | ||
477 | return ret; | ||
478 | } | ||
479 | } | ||
480 | |||
481 | return 0; | ||
482 | } | ||
483 | |||
484 | static int mtk_pctrl_get_groups_count(struct pinctrl_dev *pctldev) | ||
485 | { | ||
486 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
487 | |||
488 | return pctl->ngroups; | ||
489 | } | ||
490 | |||
491 | static const char *mtk_pctrl_get_group_name(struct pinctrl_dev *pctldev, | ||
492 | unsigned group) | ||
493 | { | ||
494 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
495 | |||
496 | return pctl->groups[group].name; | ||
497 | } | ||
498 | |||
499 | static int mtk_pctrl_get_group_pins(struct pinctrl_dev *pctldev, | ||
500 | unsigned group, | ||
501 | const unsigned **pins, | ||
502 | unsigned *num_pins) | ||
503 | { | ||
504 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
505 | |||
506 | *pins = (unsigned *)&pctl->groups[group].pin; | ||
507 | *num_pins = 1; | ||
508 | |||
509 | return 0; | ||
510 | } | ||
511 | |||
512 | static const struct pinctrl_ops mtk_pctrl_ops = { | ||
513 | .dt_node_to_map = mtk_pctrl_dt_node_to_map, | ||
514 | .dt_free_map = pinctrl_utils_dt_free_map, | ||
515 | .get_groups_count = mtk_pctrl_get_groups_count, | ||
516 | .get_group_name = mtk_pctrl_get_group_name, | ||
517 | .get_group_pins = mtk_pctrl_get_group_pins, | ||
518 | }; | ||
519 | |||
520 | static int mtk_pmx_get_funcs_cnt(struct pinctrl_dev *pctldev) | ||
521 | { | ||
522 | return ARRAY_SIZE(mtk_gpio_functions); | ||
523 | } | ||
524 | |||
525 | static const char *mtk_pmx_get_func_name(struct pinctrl_dev *pctldev, | ||
526 | unsigned selector) | ||
527 | { | ||
528 | return mtk_gpio_functions[selector]; | ||
529 | } | ||
530 | |||
531 | static int mtk_pmx_get_func_groups(struct pinctrl_dev *pctldev, | ||
532 | unsigned function, | ||
533 | const char * const **groups, | ||
534 | unsigned * const num_groups) | ||
535 | { | ||
536 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
537 | |||
538 | *groups = pctl->grp_names; | ||
539 | *num_groups = pctl->ngroups; | ||
540 | |||
541 | return 0; | ||
542 | } | ||
543 | |||
544 | static int mtk_pmx_set_mode(struct pinctrl_dev *pctldev, | ||
545 | unsigned long pin, unsigned long mode) | ||
546 | { | ||
547 | unsigned int reg_addr; | ||
548 | unsigned char bit; | ||
549 | unsigned int val; | ||
550 | unsigned int mask = (1L << GPIO_MODE_BITS) - 1; | ||
551 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
552 | |||
553 | reg_addr = ((pin / MAX_GPIO_MODE_PER_REG) << pctl->devdata->port_shf) | ||
554 | + pctl->devdata->pinmux_offset; | ||
555 | |||
556 | bit = pin % MAX_GPIO_MODE_PER_REG; | ||
557 | mask <<= (GPIO_MODE_BITS * bit); | ||
558 | val = (mode << (GPIO_MODE_BITS * bit)); | ||
559 | return regmap_update_bits(mtk_get_regmap(pctl, pin), | ||
560 | reg_addr, mask, val); | ||
561 | } | ||
562 | |||
563 | static int mtk_pmx_set_mux(struct pinctrl_dev *pctldev, | ||
564 | unsigned function, | ||
565 | unsigned group) | ||
566 | { | ||
567 | bool ret; | ||
568 | const struct mtk_desc_function *desc; | ||
569 | struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); | ||
570 | struct mtk_pinctrl_group *g = pctl->groups + group; | ||
571 | |||
572 | ret = mtk_pctrl_is_function_valid(pctl, g->pin, function); | ||
573 | if (!ret) { | ||
574 | dev_err(pctl->dev, "invaild function %d on group %d .\n", | ||
575 | function, group); | ||
576 | return -EINVAL; | ||
577 | } | ||
578 | |||
579 | desc = mtk_pctrl_find_function_by_pin(pctl, g->pin, function); | ||
580 | if (!desc) | ||
581 | return -EINVAL; | ||
582 | mtk_pmx_set_mode(pctldev, g->pin, desc->muxval); | ||
583 | return 0; | ||
584 | } | ||
585 | |||
586 | static const struct pinmux_ops mtk_pmx_ops = { | ||
587 | .get_functions_count = mtk_pmx_get_funcs_cnt, | ||
588 | .get_function_name = mtk_pmx_get_func_name, | ||
589 | .get_function_groups = mtk_pmx_get_func_groups, | ||
590 | .set_mux = mtk_pmx_set_mux, | ||
591 | .gpio_set_direction = mtk_pmx_gpio_set_direction, | ||
592 | }; | ||
593 | |||
594 | static int mtk_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
595 | { | ||
596 | return pinctrl_request_gpio(chip->base + offset); | ||
597 | } | ||
598 | |||
599 | static void mtk_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
600 | { | ||
601 | pinctrl_free_gpio(chip->base + offset); | ||
602 | } | ||
603 | |||
604 | static int mtk_gpio_direction_input(struct gpio_chip *chip, | ||
605 | unsigned offset) | ||
606 | { | ||
607 | return pinctrl_gpio_direction_input(chip->base + offset); | ||
608 | } | ||
609 | |||
610 | static int mtk_gpio_direction_output(struct gpio_chip *chip, | ||
611 | unsigned offset, int value) | ||
612 | { | ||
613 | mtk_gpio_set(chip, offset, value); | ||
614 | return pinctrl_gpio_direction_output(chip->base + offset); | ||
615 | } | ||
616 | |||
617 | static int mtk_gpio_get_direction(struct gpio_chip *chip, unsigned offset) | ||
618 | { | ||
619 | unsigned int reg_addr; | ||
620 | unsigned int bit; | ||
621 | unsigned int read_val = 0; | ||
622 | |||
623 | struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); | ||
624 | |||
625 | reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset; | ||
626 | bit = BIT(offset & 0xf); | ||
627 | regmap_read(pctl->regmap1, reg_addr, &read_val); | ||
628 | return !!(read_val & bit); | ||
629 | } | ||
630 | |||
631 | static int mtk_gpio_get(struct gpio_chip *chip, unsigned offset) | ||
632 | { | ||
633 | unsigned int reg_addr; | ||
634 | unsigned int bit; | ||
635 | unsigned int read_val = 0; | ||
636 | struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); | ||
637 | |||
638 | if (mtk_gpio_get_direction(chip, offset)) | ||
639 | reg_addr = mtk_get_port(pctl, offset) + | ||
640 | pctl->devdata->dout_offset; | ||
641 | else | ||
642 | reg_addr = mtk_get_port(pctl, offset) + | ||
643 | pctl->devdata->din_offset; | ||
644 | |||
645 | bit = BIT(offset & 0xf); | ||
646 | regmap_read(pctl->regmap1, reg_addr, &read_val); | ||
647 | return !!(read_val & bit); | ||
648 | } | ||
649 | |||
650 | static struct gpio_chip mtk_gpio_chip = { | ||
651 | .owner = THIS_MODULE, | ||
652 | .request = mtk_gpio_request, | ||
653 | .free = mtk_gpio_free, | ||
654 | .direction_input = mtk_gpio_direction_input, | ||
655 | .direction_output = mtk_gpio_direction_output, | ||
656 | .get = mtk_gpio_get, | ||
657 | .set = mtk_gpio_set, | ||
658 | .of_gpio_n_cells = 2, | ||
659 | }; | ||
660 | |||
661 | static int mtk_pctrl_build_state(struct platform_device *pdev) | ||
662 | { | ||
663 | struct mtk_pinctrl *pctl = platform_get_drvdata(pdev); | ||
664 | int i; | ||
665 | |||
666 | pctl->ngroups = pctl->devdata->npins; | ||
667 | |||
668 | /* Allocate groups */ | ||
669 | pctl->groups = devm_kzalloc(&pdev->dev, | ||
670 | pctl->ngroups * sizeof(*pctl->groups), | ||
671 | GFP_KERNEL); | ||
672 | if (!pctl->groups) | ||
673 | return -ENOMEM; | ||
674 | |||
675 | /* We assume that one pin is one group, use pin name as group name. */ | ||
676 | pctl->grp_names = devm_kzalloc(&pdev->dev, | ||
677 | pctl->ngroups * sizeof(*pctl->grp_names), | ||
678 | GFP_KERNEL); | ||
679 | if (!pctl->grp_names) | ||
680 | return -ENOMEM; | ||
681 | |||
682 | for (i = 0; i < pctl->devdata->npins; i++) { | ||
683 | const struct mtk_desc_pin *pin = pctl->devdata->pins + i; | ||
684 | struct mtk_pinctrl_group *group = pctl->groups + i; | ||
685 | |||
686 | group->name = pin->pin.name; | ||
687 | group->pin = pin->pin.number; | ||
688 | |||
689 | pctl->grp_names[i] = pin->pin.name; | ||
690 | } | ||
691 | |||
692 | return 0; | ||
693 | } | ||
694 | |||
695 | static struct pinctrl_desc mtk_pctrl_desc = { | ||
696 | .confops = &mtk_pconf_ops, | ||
697 | .pctlops = &mtk_pctrl_ops, | ||
698 | .pmxops = &mtk_pmx_ops, | ||
699 | }; | ||
700 | |||
701 | int mtk_pctrl_init(struct platform_device *pdev, | ||
702 | const struct mtk_pinctrl_devdata *data) | ||
703 | { | ||
704 | struct pinctrl_pin_desc *pins; | ||
705 | struct mtk_pinctrl *pctl; | ||
706 | struct device_node *np = pdev->dev.of_node, *node; | ||
707 | struct property *prop; | ||
708 | int i, ret; | ||
709 | |||
710 | pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); | ||
711 | if (!pctl) | ||
712 | return -ENOMEM; | ||
713 | |||
714 | platform_set_drvdata(pdev, pctl); | ||
715 | |||
716 | prop = of_find_property(np, "pins-are-numbered", NULL); | ||
717 | if (!prop) { | ||
718 | dev_err(&pdev->dev, "only support pins-are-numbered format\n", ret); | ||
719 | return -EINVAL; | ||
720 | } | ||
721 | |||
722 | node = of_parse_phandle(np, "mediatek,pctl-regmap", 0); | ||
723 | if (node) { | ||
724 | pctl->regmap1 = syscon_node_to_regmap(node); | ||
725 | if (IS_ERR(pctl->regmap1)) | ||
726 | return PTR_ERR(pctl->regmap1); | ||
727 | } | ||
728 | |||
729 | /* Only 8135 has two base addr, other SoCs have only one. */ | ||
730 | node = of_parse_phandle(np, "mediatek,pctl-regmap", 1); | ||
731 | if (node) { | ||
732 | pctl->regmap2 = syscon_node_to_regmap(node); | ||
733 | if (IS_ERR(pctl->regmap2)) | ||
734 | return PTR_ERR(pctl->regmap2); | ||
735 | } | ||
736 | |||
737 | pctl->devdata = data; | ||
738 | ret = mtk_pctrl_build_state(pdev); | ||
739 | if (ret) { | ||
740 | dev_err(&pdev->dev, "build state failed: %d\n", ret); | ||
741 | return -EINVAL; | ||
742 | } | ||
743 | |||
744 | pins = devm_kzalloc(&pdev->dev, | ||
745 | pctl->devdata->npins * sizeof(*pins), | ||
746 | GFP_KERNEL); | ||
747 | if (!pins) | ||
748 | return -ENOMEM; | ||
749 | |||
750 | for (i = 0; i < pctl->devdata->npins; i++) | ||
751 | pins[i] = pctl->devdata->pins[i].pin; | ||
752 | mtk_pctrl_desc.name = dev_name(&pdev->dev); | ||
753 | mtk_pctrl_desc.owner = THIS_MODULE; | ||
754 | mtk_pctrl_desc.pins = pins; | ||
755 | mtk_pctrl_desc.npins = pctl->devdata->npins; | ||
756 | pctl->dev = &pdev->dev; | ||
757 | pctl->pctl_dev = pinctrl_register(&mtk_pctrl_desc, &pdev->dev, pctl); | ||
758 | if (!pctl->pctl_dev) { | ||
759 | dev_err(&pdev->dev, "couldn't register pinctrl driver\n"); | ||
760 | return -EINVAL; | ||
761 | } | ||
762 | |||
763 | pctl->chip = devm_kzalloc(&pdev->dev, sizeof(*pctl->chip), GFP_KERNEL); | ||
764 | if (!pctl->chip) { | ||
765 | ret = -ENOMEM; | ||
766 | goto pctrl_error; | ||
767 | } | ||
768 | |||
769 | pctl->chip = &mtk_gpio_chip; | ||
770 | pctl->chip->ngpio = pctl->devdata->npins; | ||
771 | pctl->chip->label = dev_name(&pdev->dev); | ||
772 | pctl->chip->dev = &pdev->dev; | ||
773 | pctl->chip->base = 0; | ||
774 | |||
775 | ret = gpiochip_add(pctl->chip); | ||
776 | if (ret) { | ||
777 | ret = -EINVAL; | ||
778 | goto pctrl_error; | ||
779 | } | ||
780 | |||
781 | /* Register the GPIO to pin mappings. */ | ||
782 | ret = gpiochip_add_pin_range(pctl->chip, dev_name(&pdev->dev), | ||
783 | 0, 0, pctl->devdata->npins); | ||
784 | if (ret) { | ||
785 | ret = -EINVAL; | ||
786 | goto chip_error; | ||
787 | } | ||
788 | |||
789 | return 0; | ||
790 | |||
791 | chip_error: | ||
792 | gpiochip_remove(pctl->chip); | ||
793 | pctrl_error: | ||
794 | pinctrl_unregister(pctl->pctl_dev); | ||
795 | return ret; | ||
796 | } | ||
797 | |||
798 | MODULE_LICENSE("GPL"); | ||
799 | MODULE_DESCRIPTION("MediaTek Pinctrl Driver"); | ||
800 | MODULE_AUTHOR("Hongzhou Yang <hongzhou.yang@mediatek.com>"); | ||
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h new file mode 100644 index 000000000000..95a9d57ca1fd --- /dev/null +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h | |||
@@ -0,0 +1,185 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014 MediaTek Inc. | ||
3 | * Author: Hongzhou.Yang <hongzhou.yang@mediatek.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef __PINCTRL_MTK_COMMON_H | ||
16 | #define __PINCTRL_MTK_COMMON_H | ||
17 | |||
18 | #include <linux/pinctrl/pinctrl.h> | ||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/regmap.h> | ||
21 | |||
22 | #define NO_EINT_SUPPORT 255 | ||
23 | |||
24 | struct mtk_desc_function { | ||
25 | const char *name; | ||
26 | unsigned char muxval; | ||
27 | }; | ||
28 | |||
29 | struct mtk_desc_eint { | ||
30 | unsigned char eintmux; | ||
31 | unsigned char eintnum; | ||
32 | }; | ||
33 | |||
34 | struct mtk_desc_pin { | ||
35 | struct pinctrl_pin_desc pin; | ||
36 | const char *chip; | ||
37 | const struct mtk_desc_eint eint; | ||
38 | const struct mtk_desc_function *functions; | ||
39 | }; | ||
40 | |||
41 | #define MTK_PIN(_pin, _pad, _chip, _eint, ...) \ | ||
42 | { \ | ||
43 | .pin = _pin, \ | ||
44 | .chip = _chip, \ | ||
45 | .eint = _eint, \ | ||
46 | .functions = (struct mtk_desc_function[]){ \ | ||
47 | __VA_ARGS__, { } }, \ | ||
48 | } | ||
49 | |||
50 | #define MTK_EINT_FUNCTION(_eintmux, _eintnum) \ | ||
51 | { \ | ||
52 | .eintmux = _eintmux, \ | ||
53 | .eintnum = _eintnum, \ | ||
54 | } | ||
55 | |||
56 | #define MTK_FUNCTION(_val, _name) \ | ||
57 | { \ | ||
58 | .muxval = _val, \ | ||
59 | .name = _name, \ | ||
60 | } | ||
61 | |||
62 | #define SET_ADDR(x, y) (x + (y->devdata->port_align)) | ||
63 | #define CLR_ADDR(x, y) (x + (y->devdata->port_align << 1)) | ||
64 | |||
65 | struct mtk_pinctrl_group { | ||
66 | const char *name; | ||
67 | unsigned long config; | ||
68 | unsigned pin; | ||
69 | }; | ||
70 | |||
71 | /** | ||
72 | * struct mtk_drv_group_desc - Provide driving group data. | ||
73 | * @max_drv: The maximum current of this group. | ||
74 | * @min_drv: The minimum current of this group. | ||
75 | * @low_bit: The lowest bit of this group. | ||
76 | * @high_bit: The highest bit of this group. | ||
77 | * @step: The step current of this group. | ||
78 | */ | ||
79 | struct mtk_drv_group_desc { | ||
80 | unsigned char min_drv; | ||
81 | unsigned char max_drv; | ||
82 | unsigned char low_bit; | ||
83 | unsigned char high_bit; | ||
84 | unsigned char step; | ||
85 | }; | ||
86 | |||
87 | #define MTK_DRV_GRP(_min, _max, _low, _high, _step) \ | ||
88 | { \ | ||
89 | .min_drv = _min, \ | ||
90 | .max_drv = _max, \ | ||
91 | .low_bit = _low, \ | ||
92 | .high_bit = _high, \ | ||
93 | .step = _step, \ | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | * struct mtk_pin_drv_grp - Provide each pin driving info. | ||
98 | * @pin: The pin number. | ||
99 | * @offset: The offset of driving register for this pin. | ||
100 | * @bit: The bit of driving register for this pin. | ||
101 | * @grp: The group for this pin belongs to. | ||
102 | */ | ||
103 | struct mtk_pin_drv_grp { | ||
104 | unsigned int pin; | ||
105 | unsigned int offset; | ||
106 | unsigned char bit; | ||
107 | unsigned char grp; | ||
108 | }; | ||
109 | |||
110 | #define MTK_PIN_DRV_GRP(_pin, _offset, _bit, _grp) \ | ||
111 | { \ | ||
112 | .pin = _pin, \ | ||
113 | .offset = _offset, \ | ||
114 | .bit = _bit, \ | ||
115 | .grp = _grp, \ | ||
116 | } | ||
117 | |||
118 | /** | ||
119 | * struct mtk_pinctrl_devdata - Provide HW GPIO related data. | ||
120 | * @pins: An array describing all pins the pin controller affects. | ||
121 | * @npins: The number of entries in @pins. | ||
122 | * | ||
123 | * @grp_desc: The driving group info. | ||
124 | * @pin_drv_grp: The driving group for all pins. | ||
125 | * @spec_pull_set: Each SoC may have special pins for pull up/down setting, | ||
126 | * these pins' pull setting are very different, they have separate pull | ||
127 | * up/down bit, R0 and R1 resistor bit, so they need special pull setting. | ||
128 | * If special setting is success, this should return 0, otherwise it should | ||
129 | * return non-zero value. | ||
130 | * | ||
131 | * @dir_offset: The direction register offset. | ||
132 | * @pullen_offset: The pull-up/pull-down enable register offset. | ||
133 | * @pinmux_offset: The pinmux register offset. | ||
134 | * | ||
135 | * @type1_start: Some chips have two base addresses for pull select register, | ||
136 | * that means some pins use the first address and others use the second. This | ||
137 | * member record the start of pin number to use the second address. | ||
138 | * @type1_end: The end of pin number to use the second address. | ||
139 | * | ||
140 | * @port_shf: The shift between two registers. | ||
141 | * @port_mask: The mask of register. | ||
142 | * @port_align: Provide clear register and set register step. | ||
143 | */ | ||
144 | struct mtk_pinctrl_devdata { | ||
145 | const struct mtk_desc_pin *pins; | ||
146 | unsigned int npins; | ||
147 | const struct mtk_drv_group_desc *grp_desc; | ||
148 | unsigned int n_grp_cls; | ||
149 | const struct mtk_pin_drv_grp *pin_drv_grp; | ||
150 | unsigned int n_pin_drv_grps; | ||
151 | int (*spec_pull_set)(struct regmap *reg, unsigned int pin, | ||
152 | unsigned char align, bool isup, unsigned int arg); | ||
153 | unsigned int dir_offset; | ||
154 | unsigned int ies_offset; | ||
155 | unsigned int smt_offset; | ||
156 | unsigned int pullen_offset; | ||
157 | unsigned int pullsel_offset; | ||
158 | unsigned int drv_offset; | ||
159 | unsigned int invser_offset; | ||
160 | unsigned int dout_offset; | ||
161 | unsigned int din_offset; | ||
162 | unsigned int pinmux_offset; | ||
163 | unsigned short type1_start; | ||
164 | unsigned short type1_end; | ||
165 | unsigned char port_shf; | ||
166 | unsigned char port_mask; | ||
167 | unsigned char port_align; | ||
168 | }; | ||
169 | |||
170 | struct mtk_pinctrl { | ||
171 | struct regmap *regmap1; | ||
172 | struct regmap *regmap2; | ||
173 | struct device *dev; | ||
174 | struct gpio_chip *chip; | ||
175 | struct mtk_pinctrl_group *groups; | ||
176 | unsigned ngroups; | ||
177 | const char **grp_names; | ||
178 | struct pinctrl_dev *pctl_dev; | ||
179 | const struct mtk_pinctrl_devdata *devdata; | ||
180 | }; | ||
181 | |||
182 | int mtk_pctrl_init(struct platform_device *pdev, | ||
183 | const struct mtk_pinctrl_devdata *data); | ||
184 | |||
185 | #endif /* __PINCTRL_MTK_COMMON_H */ | ||
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-mt8135.h b/drivers/pinctrl/mediatek/pinctrl-mtk-mt8135.h new file mode 100644 index 000000000000..5019cef132f3 --- /dev/null +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-mt8135.h | |||
@@ -0,0 +1,2114 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014 MediaTek Inc. | ||
3 | * Author: Hongzhou.Yang <hongzhou.yang@mediatek.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef __PINCTRL_MTK_MT8135_H | ||
16 | #define __PINCTRL_MTK_MT8135_H | ||
17 | |||
18 | #include <linux/pinctrl/pinctrl.h> | ||
19 | #include <pinctrl-mtk-common.h> | ||
20 | |||
21 | static const struct mtk_desc_pin mtk_pins_mt8135[] = { | ||
22 | MTK_PIN( | ||
23 | PINCTRL_PIN(0, "MSDC0_DAT7"), | ||
24 | "D21", "mt8135", | ||
25 | MTK_EINT_FUNCTION(2, 49), | ||
26 | MTK_FUNCTION(0, "GPIO0"), | ||
27 | MTK_FUNCTION(1, "MSDC0_DAT7"), | ||
28 | MTK_FUNCTION(2, "EINT49"), | ||
29 | MTK_FUNCTION(3, "I2SOUT_DAT"), | ||
30 | MTK_FUNCTION(4, "DAC_DAT_OUT"), | ||
31 | MTK_FUNCTION(5, "PCM1_DO"), | ||
32 | MTK_FUNCTION(6, "SPI1_MO"), | ||
33 | MTK_FUNCTION(7, "NALE") | ||
34 | ), | ||
35 | MTK_PIN( | ||
36 | PINCTRL_PIN(1, "MSDC0_DAT6"), | ||
37 | "D22", "mt8135", | ||
38 | MTK_EINT_FUNCTION(2, 48), | ||
39 | MTK_FUNCTION(0, "GPIO1"), | ||
40 | MTK_FUNCTION(1, "MSDC0_DAT6"), | ||
41 | MTK_FUNCTION(2, "EINT48"), | ||
42 | MTK_FUNCTION(3, "I2SIN_WS"), | ||
43 | MTK_FUNCTION(4, "DAC_WS"), | ||
44 | MTK_FUNCTION(5, "PCM1_WS"), | ||
45 | MTK_FUNCTION(6, "SPI1_CSN"), | ||
46 | MTK_FUNCTION(7, "NCLE") | ||
47 | ), | ||
48 | MTK_PIN( | ||
49 | PINCTRL_PIN(2, "MSDC0_DAT5"), | ||
50 | "E22", "mt8135", | ||
51 | MTK_EINT_FUNCTION(2, 47), | ||
52 | MTK_FUNCTION(0, "GPIO2"), | ||
53 | MTK_FUNCTION(1, "MSDC0_DAT5"), | ||
54 | MTK_FUNCTION(2, "EINT47"), | ||
55 | MTK_FUNCTION(3, "I2SIN_CK"), | ||
56 | MTK_FUNCTION(4, "DAC_CK"), | ||
57 | MTK_FUNCTION(5, "PCM1_CK"), | ||
58 | MTK_FUNCTION(6, "SPI1_CLK"), | ||
59 | MTK_FUNCTION(7, "NLD4") | ||
60 | ), | ||
61 | MTK_PIN( | ||
62 | PINCTRL_PIN(3, "MSDC0_DAT4"), | ||
63 | "F21", "mt8135", | ||
64 | MTK_EINT_FUNCTION(2, 46), | ||
65 | MTK_FUNCTION(0, "GPIO3"), | ||
66 | MTK_FUNCTION(1, "MSDC0_DAT4"), | ||
67 | MTK_FUNCTION(2, "EINT46"), | ||
68 | MTK_FUNCTION(3, "A_FUNC_CK"), | ||
69 | MTK_FUNCTION(6, "LSCE1B_2X"), | ||
70 | MTK_FUNCTION(7, "NLD5") | ||
71 | ), | ||
72 | MTK_PIN( | ||
73 | PINCTRL_PIN(4, "MSDC0_CMD"), | ||
74 | "F20", "mt8135", | ||
75 | MTK_EINT_FUNCTION(2, 41), | ||
76 | MTK_FUNCTION(0, "GPIO4"), | ||
77 | MTK_FUNCTION(1, "MSDC0_CMD"), | ||
78 | MTK_FUNCTION(2, "EINT41"), | ||
79 | MTK_FUNCTION(3, "A_FUNC_DOUT[0]"), | ||
80 | MTK_FUNCTION(5, "USB_TEST_IO[0]"), | ||
81 | MTK_FUNCTION(6, "LRSTB_2X"), | ||
82 | MTK_FUNCTION(7, "NRNB") | ||
83 | ), | ||
84 | MTK_PIN( | ||
85 | PINCTRL_PIN(5, "MSDC0_CLK"), | ||
86 | "G18", "mt8135", | ||
87 | MTK_EINT_FUNCTION(2, 40), | ||
88 | MTK_FUNCTION(0, "GPIO5"), | ||
89 | MTK_FUNCTION(1, "MSDC0_CLK"), | ||
90 | MTK_FUNCTION(2, "EINT40"), | ||
91 | MTK_FUNCTION(3, "A_FUNC_DOUT[1]"), | ||
92 | MTK_FUNCTION(5, "USB_TEST_IO[1]"), | ||
93 | MTK_FUNCTION(6, "LPTE"), | ||
94 | MTK_FUNCTION(7, "NREB") | ||
95 | ), | ||
96 | MTK_PIN( | ||
97 | PINCTRL_PIN(6, "MSDC0_DAT3"), | ||
98 | "G21", "mt8135", | ||
99 | MTK_EINT_FUNCTION(2, 45), | ||
100 | MTK_FUNCTION(0, "GPIO6"), | ||
101 | MTK_FUNCTION(1, "MSDC0_DAT3"), | ||
102 | MTK_FUNCTION(2, "EINT45"), | ||
103 | MTK_FUNCTION(3, "A_FUNC_DOUT[2]"), | ||
104 | MTK_FUNCTION(5, "USB_TEST_IO[2]"), | ||
105 | MTK_FUNCTION(6, "LSCE0B_2X"), | ||
106 | MTK_FUNCTION(7, "NLD7") | ||
107 | ), | ||
108 | MTK_PIN( | ||
109 | PINCTRL_PIN(7, "MSDC0_DAT2"), | ||
110 | "E21", "mt8135", | ||
111 | MTK_EINT_FUNCTION(2, 44), | ||
112 | MTK_FUNCTION(0, "GPIO7"), | ||
113 | MTK_FUNCTION(1, "MSDC0_DAT2"), | ||
114 | MTK_FUNCTION(2, "EINT44"), | ||
115 | MTK_FUNCTION(3, "A_FUNC_DOUT[3]"), | ||
116 | MTK_FUNCTION(5, "USB_TEST_IO[3]"), | ||
117 | MTK_FUNCTION(6, "LSA0_2X"), | ||
118 | MTK_FUNCTION(7, "NLD14") | ||
119 | ), | ||
120 | MTK_PIN( | ||
121 | PINCTRL_PIN(8, "MSDC0_DAT1"), | ||
122 | "E23", "mt8135", | ||
123 | MTK_EINT_FUNCTION(2, 43), | ||
124 | MTK_FUNCTION(0, "GPIO8"), | ||
125 | MTK_FUNCTION(1, "MSDC0_DAT1"), | ||
126 | MTK_FUNCTION(2, "EINT43"), | ||
127 | MTK_FUNCTION(5, "USB_TEST_IO[4]"), | ||
128 | MTK_FUNCTION(6, "LSCK_2X"), | ||
129 | MTK_FUNCTION(7, "NLD11") | ||
130 | ), | ||
131 | MTK_PIN( | ||
132 | PINCTRL_PIN(9, "MSDC0_DAT0"), | ||
133 | "F22", "mt8135", | ||
134 | MTK_EINT_FUNCTION(2, 42), | ||
135 | MTK_FUNCTION(0, "GPIO9"), | ||
136 | MTK_FUNCTION(1, "MSDC0_DAT0"), | ||
137 | MTK_FUNCTION(2, "EINT42"), | ||
138 | MTK_FUNCTION(5, "USB_TEST_IO[5]"), | ||
139 | MTK_FUNCTION(6, "LSDA_2X") | ||
140 | ), | ||
141 | MTK_PIN( | ||
142 | PINCTRL_PIN(10, "NCEB0"), | ||
143 | "G20", "mt8135", | ||
144 | MTK_EINT_FUNCTION(2, 139), | ||
145 | MTK_FUNCTION(0, "GPIO10"), | ||
146 | MTK_FUNCTION(1, "NCEB0"), | ||
147 | MTK_FUNCTION(2, "EINT139"), | ||
148 | MTK_FUNCTION(7, "TESTA_OUT4") | ||
149 | ), | ||
150 | MTK_PIN( | ||
151 | PINCTRL_PIN(11, "NCEB1"), | ||
152 | "L17", "mt8135", | ||
153 | MTK_EINT_FUNCTION(2, 140), | ||
154 | MTK_FUNCTION(0, "GPIO11"), | ||
155 | MTK_FUNCTION(1, "NCEB1"), | ||
156 | MTK_FUNCTION(2, "EINT140"), | ||
157 | MTK_FUNCTION(6, "USB_DRVVBUS"), | ||
158 | MTK_FUNCTION(7, "TESTA_OUT5") | ||
159 | ), | ||
160 | MTK_PIN( | ||
161 | PINCTRL_PIN(12, "NRNB"), | ||
162 | "G19", "mt8135", | ||
163 | MTK_EINT_FUNCTION(2, 141), | ||
164 | MTK_FUNCTION(0, "GPIO12"), | ||
165 | MTK_FUNCTION(1, "NRNB"), | ||
166 | MTK_FUNCTION(2, "EINT141"), | ||
167 | MTK_FUNCTION(3, "A_FUNC_DOUT[4]"), | ||
168 | MTK_FUNCTION(7, "TESTA_OUT6") | ||
169 | ), | ||
170 | MTK_PIN( | ||
171 | PINCTRL_PIN(13, "NCLE"), | ||
172 | "J18", "mt8135", | ||
173 | MTK_EINT_FUNCTION(2, 142), | ||
174 | MTK_FUNCTION(0, "GPIO13"), | ||
175 | MTK_FUNCTION(1, "NCLE"), | ||
176 | MTK_FUNCTION(2, "EINT142"), | ||
177 | MTK_FUNCTION(3, "A_FUNC_DOUT[5]"), | ||
178 | MTK_FUNCTION(4, "CM2PDN_1X"), | ||
179 | MTK_FUNCTION(6, "NALE"), | ||
180 | MTK_FUNCTION(7, "TESTA_OUT7") | ||
181 | ), | ||
182 | MTK_PIN( | ||
183 | PINCTRL_PIN(14, "NALE"), | ||
184 | "J19", "mt8135", | ||
185 | MTK_EINT_FUNCTION(2, 143), | ||
186 | MTK_FUNCTION(0, "GPIO14"), | ||
187 | MTK_FUNCTION(1, "NALE"), | ||
188 | MTK_FUNCTION(2, "EINT143"), | ||
189 | MTK_FUNCTION(3, "A_FUNC_DOUT[6]"), | ||
190 | MTK_FUNCTION(4, "CM2MCLK_1X"), | ||
191 | MTK_FUNCTION(5, "IRDA_RXD"), | ||
192 | MTK_FUNCTION(6, "NCLE"), | ||
193 | MTK_FUNCTION(7, "TESTA_OUT8") | ||
194 | ), | ||
195 | MTK_PIN( | ||
196 | PINCTRL_PIN(15, "NREB"), | ||
197 | "L18", "mt8135", | ||
198 | MTK_EINT_FUNCTION(2, 144), | ||
199 | MTK_FUNCTION(0, "GPIO15"), | ||
200 | MTK_FUNCTION(1, "NREB"), | ||
201 | MTK_FUNCTION(2, "EINT144"), | ||
202 | MTK_FUNCTION(3, "A_FUNC_DOUT[7]"), | ||
203 | MTK_FUNCTION(4, "CM2RST_1X"), | ||
204 | MTK_FUNCTION(5, "IRDA_TXD"), | ||
205 | MTK_FUNCTION(7, "TESTA_OUT9") | ||
206 | ), | ||
207 | MTK_PIN( | ||
208 | PINCTRL_PIN(16, "NWEB"), | ||
209 | "J20", "mt8135", | ||
210 | MTK_EINT_FUNCTION(2, 145), | ||
211 | MTK_FUNCTION(0, "GPIO16"), | ||
212 | MTK_FUNCTION(1, "NWEB"), | ||
213 | MTK_FUNCTION(2, "EINT145"), | ||
214 | MTK_FUNCTION(3, "A_FUNC_DIN[0]"), | ||
215 | MTK_FUNCTION(4, "CM2PCLK_1X"), | ||
216 | MTK_FUNCTION(5, "IRDA_PDN"), | ||
217 | MTK_FUNCTION(7, "TESTA_OUT10") | ||
218 | ), | ||
219 | MTK_PIN( | ||
220 | PINCTRL_PIN(17, "NLD0"), | ||
221 | "K21", "mt8135", | ||
222 | MTK_EINT_FUNCTION(2, 146), | ||
223 | MTK_FUNCTION(0, "GPIO17"), | ||
224 | MTK_FUNCTION(1, "NLD0"), | ||
225 | MTK_FUNCTION(2, "EINT146"), | ||
226 | MTK_FUNCTION(3, "A_FUNC_DIN[1]"), | ||
227 | MTK_FUNCTION(4, "CM2DAT_1X[0]"), | ||
228 | MTK_FUNCTION(5, "I2SIN_CK"), | ||
229 | MTK_FUNCTION(6, "DAC_CK"), | ||
230 | MTK_FUNCTION(7, "TESTA_OUT11") | ||
231 | ), | ||
232 | MTK_PIN( | ||
233 | PINCTRL_PIN(18, "NLD1"), | ||
234 | "K22", "mt8135", | ||
235 | MTK_EINT_FUNCTION(2, 147), | ||
236 | MTK_FUNCTION(0, "GPIO18"), | ||
237 | MTK_FUNCTION(1, "NLD1"), | ||
238 | MTK_FUNCTION(2, "EINT147"), | ||
239 | MTK_FUNCTION(3, "A_FUNC_DIN[2]"), | ||
240 | MTK_FUNCTION(4, "CM2DAT_1X[1]"), | ||
241 | MTK_FUNCTION(5, "I2SIN_WS"), | ||
242 | MTK_FUNCTION(6, "DAC_WS"), | ||
243 | MTK_FUNCTION(7, "TESTA_OUT12") | ||
244 | ), | ||
245 | MTK_PIN( | ||
246 | PINCTRL_PIN(19, "NLD2"), | ||
247 | "J21", "mt8135", | ||
248 | MTK_EINT_FUNCTION(2, 148), | ||
249 | MTK_FUNCTION(0, "GPIO19"), | ||
250 | MTK_FUNCTION(1, "NLD2"), | ||
251 | MTK_FUNCTION(2, "EINT148"), | ||
252 | MTK_FUNCTION(3, "A_FUNC_DIN[3]"), | ||
253 | MTK_FUNCTION(4, "CM2DAT_1X[2]"), | ||
254 | MTK_FUNCTION(5, "I2SOUT_DAT"), | ||
255 | MTK_FUNCTION(6, "DAC_DAT_OUT"), | ||
256 | MTK_FUNCTION(7, "TESTA_OUT13") | ||
257 | ), | ||
258 | MTK_PIN( | ||
259 | PINCTRL_PIN(20, "NLD3"), | ||
260 | "J23", "mt8135", | ||
261 | MTK_EINT_FUNCTION(2, 149), | ||
262 | MTK_FUNCTION(0, "GPIO20"), | ||
263 | MTK_FUNCTION(1, "NLD3"), | ||
264 | MTK_FUNCTION(2, "EINT149"), | ||
265 | MTK_FUNCTION(3, "A_FUNC_DIN[4]"), | ||
266 | MTK_FUNCTION(4, "CM2DAT_1X[3]"), | ||
267 | MTK_FUNCTION(7, "TESTA_OUT14") | ||
268 | ), | ||
269 | MTK_PIN( | ||
270 | PINCTRL_PIN(21, "NLD4"), | ||
271 | "J22", "mt8135", | ||
272 | MTK_EINT_FUNCTION(2, 150), | ||
273 | MTK_FUNCTION(0, "GPIO21"), | ||
274 | MTK_FUNCTION(1, "NLD4"), | ||
275 | MTK_FUNCTION(2, "EINT150"), | ||
276 | MTK_FUNCTION(3, "A_FUNC_DIN[5]"), | ||
277 | MTK_FUNCTION(4, "CM2DAT_1X[4]"), | ||
278 | MTK_FUNCTION(7, "TESTA_OUT15") | ||
279 | ), | ||
280 | MTK_PIN( | ||
281 | PINCTRL_PIN(22, "NLD5"), | ||
282 | "H21", "mt8135", | ||
283 | MTK_EINT_FUNCTION(2, 151), | ||
284 | MTK_FUNCTION(0, "GPIO22"), | ||
285 | MTK_FUNCTION(1, "NLD5"), | ||
286 | MTK_FUNCTION(2, "EINT151"), | ||
287 | MTK_FUNCTION(3, "A_FUNC_DIN[6]"), | ||
288 | MTK_FUNCTION(4, "CM2DAT_1X[5]"), | ||
289 | MTK_FUNCTION(7, "TESTA_OUT16") | ||
290 | ), | ||
291 | MTK_PIN( | ||
292 | PINCTRL_PIN(23, "NLD6"), | ||
293 | "H22", "mt8135", | ||
294 | MTK_EINT_FUNCTION(2, 152), | ||
295 | MTK_FUNCTION(0, "GPIO23"), | ||
296 | MTK_FUNCTION(1, "NLD6"), | ||
297 | MTK_FUNCTION(2, "EINT152"), | ||
298 | MTK_FUNCTION(3, "A_FUNC_DIN[7]"), | ||
299 | MTK_FUNCTION(4, "CM2DAT_1X[6]"), | ||
300 | MTK_FUNCTION(7, "TESTA_OUT17") | ||
301 | ), | ||
302 | MTK_PIN( | ||
303 | PINCTRL_PIN(24, "NLD7"), | ||
304 | "H20", "mt8135", | ||
305 | MTK_EINT_FUNCTION(2, 153), | ||
306 | MTK_FUNCTION(0, "GPIO24"), | ||
307 | MTK_FUNCTION(1, "NLD7"), | ||
308 | MTK_FUNCTION(2, "EINT153"), | ||
309 | MTK_FUNCTION(3, "A_FUNC_DIN[8]"), | ||
310 | MTK_FUNCTION(4, "CM2DAT_1X[7]"), | ||
311 | MTK_FUNCTION(7, "TESTA_OUT18") | ||
312 | ), | ||
313 | MTK_PIN( | ||
314 | PINCTRL_PIN(25, "NLD8"), | ||
315 | NULL, "mt8135", | ||
316 | MTK_EINT_FUNCTION(2, 154), | ||
317 | MTK_FUNCTION(0, "GPIO25"), | ||
318 | MTK_FUNCTION(1, "NLD8"), | ||
319 | MTK_FUNCTION(2, "EINT154"), | ||
320 | MTK_FUNCTION(4, "CM2DAT_1X[8]") | ||
321 | ), | ||
322 | MTK_PIN( | ||
323 | PINCTRL_PIN(26, "NLD9"), | ||
324 | NULL, "mt8135", | ||
325 | MTK_EINT_FUNCTION(2, 155), | ||
326 | MTK_FUNCTION(0, "GPIO26"), | ||
327 | MTK_FUNCTION(1, "NLD9"), | ||
328 | MTK_FUNCTION(2, "EINT155"), | ||
329 | MTK_FUNCTION(4, "CM2DAT_1X[9]"), | ||
330 | MTK_FUNCTION(5, "PWM1") | ||
331 | ), | ||
332 | MTK_PIN( | ||
333 | PINCTRL_PIN(27, "NLD10"), | ||
334 | NULL, "mt8135", | ||
335 | MTK_EINT_FUNCTION(2, 156), | ||
336 | MTK_FUNCTION(0, "GPIO27"), | ||
337 | MTK_FUNCTION(1, "NLD10"), | ||
338 | MTK_FUNCTION(2, "EINT156"), | ||
339 | MTK_FUNCTION(4, "CM2VSYNC_1X"), | ||
340 | MTK_FUNCTION(5, "PWM2") | ||
341 | ), | ||
342 | MTK_PIN( | ||
343 | PINCTRL_PIN(28, "NLD11"), | ||
344 | NULL, "mt8135", | ||
345 | MTK_EINT_FUNCTION(2, 157), | ||
346 | MTK_FUNCTION(0, "GPIO28"), | ||
347 | MTK_FUNCTION(1, "NLD11"), | ||
348 | MTK_FUNCTION(2, "EINT157"), | ||
349 | MTK_FUNCTION(4, "CM2HSYNC_1X"), | ||
350 | MTK_FUNCTION(5, "PWM3") | ||
351 | ), | ||
352 | MTK_PIN( | ||
353 | PINCTRL_PIN(29, "NLD12"), | ||
354 | NULL, "mt8135", | ||
355 | MTK_EINT_FUNCTION(2, 158), | ||
356 | MTK_FUNCTION(0, "GPIO29"), | ||
357 | MTK_FUNCTION(1, "NLD12"), | ||
358 | MTK_FUNCTION(2, "EINT158"), | ||
359 | MTK_FUNCTION(3, "I2SIN_CK"), | ||
360 | MTK_FUNCTION(4, "DAC_CK"), | ||
361 | MTK_FUNCTION(5, "PCM1_CK") | ||
362 | ), | ||
363 | MTK_PIN( | ||
364 | PINCTRL_PIN(30, "NLD13"), | ||
365 | NULL, "mt8135", | ||
366 | MTK_EINT_FUNCTION(2, 159), | ||
367 | MTK_FUNCTION(0, "GPIO30"), | ||
368 | MTK_FUNCTION(1, "NLD13"), | ||
369 | MTK_FUNCTION(2, "EINT159"), | ||
370 | MTK_FUNCTION(3, "I2SIN_WS"), | ||
371 | MTK_FUNCTION(4, "DAC_WS"), | ||
372 | MTK_FUNCTION(5, "PCM1_WS") | ||
373 | ), | ||
374 | MTK_PIN( | ||
375 | PINCTRL_PIN(31, "NLD14"), | ||
376 | NULL, "mt8135", | ||
377 | MTK_EINT_FUNCTION(2, 160), | ||
378 | MTK_FUNCTION(0, "GPIO31"), | ||
379 | MTK_FUNCTION(1, "NLD14"), | ||
380 | MTK_FUNCTION(2, "EINT160"), | ||
381 | MTK_FUNCTION(3, "I2SOUT_DAT"), | ||
382 | MTK_FUNCTION(4, "DAC_DAT_OUT"), | ||
383 | MTK_FUNCTION(5, "PCM1_DO") | ||
384 | ), | ||
385 | MTK_PIN( | ||
386 | PINCTRL_PIN(32, "NLD15"), | ||
387 | NULL, "mt8135", | ||
388 | MTK_EINT_FUNCTION(2, 161), | ||
389 | MTK_FUNCTION(0, "GPIO32"), | ||
390 | MTK_FUNCTION(1, "NLD15"), | ||
391 | MTK_FUNCTION(2, "EINT161"), | ||
392 | MTK_FUNCTION(3, "DISP_PWM"), | ||
393 | MTK_FUNCTION(4, "PWM4"), | ||
394 | MTK_FUNCTION(5, "PCM1_DI") | ||
395 | ), | ||
396 | MTK_PIN( | ||
397 | PINCTRL_PIN(33, "MSDC0_RSTB"), | ||
398 | "G22", "mt8135", | ||
399 | MTK_EINT_FUNCTION(2, 50), | ||
400 | MTK_FUNCTION(0, "GPIO33"), | ||
401 | MTK_FUNCTION(1, "MSDC0_RSTB"), | ||
402 | MTK_FUNCTION(2, "EINT50"), | ||
403 | MTK_FUNCTION(3, "I2SIN_DAT"), | ||
404 | MTK_FUNCTION(5, "PCM1_DI"), | ||
405 | MTK_FUNCTION(6, "SPI1_MI"), | ||
406 | MTK_FUNCTION(7, "NLD10") | ||
407 | ), | ||
408 | MTK_PIN( | ||
409 | PINCTRL_PIN(34, "IDDIG"), | ||
410 | "N17", "mt8135", | ||
411 | MTK_EINT_FUNCTION(2, 34), | ||
412 | MTK_FUNCTION(0, "GPIO34"), | ||
413 | MTK_FUNCTION(1, "IDDIG"), | ||
414 | MTK_FUNCTION(2, "EINT34") | ||
415 | ), | ||
416 | MTK_PIN( | ||
417 | PINCTRL_PIN(35, "SCL3"), | ||
418 | "L19", "mt8135", | ||
419 | MTK_EINT_FUNCTION(2, 96), | ||
420 | MTK_FUNCTION(0, "GPIO35"), | ||
421 | MTK_FUNCTION(1, "SCL3"), | ||
422 | MTK_FUNCTION(2, "EINT96"), | ||
423 | MTK_FUNCTION(3, "CLKM6"), | ||
424 | MTK_FUNCTION(4, "PWM6") | ||
425 | ), | ||
426 | MTK_PIN( | ||
427 | PINCTRL_PIN(36, "SDA3"), | ||
428 | "L20", "mt8135", | ||
429 | MTK_EINT_FUNCTION(2, 97), | ||
430 | MTK_FUNCTION(0, "GPIO36"), | ||
431 | MTK_FUNCTION(1, "SDA3"), | ||
432 | MTK_FUNCTION(2, "EINT97") | ||
433 | ), | ||
434 | MTK_PIN( | ||
435 | PINCTRL_PIN(37, "AUD_CLK_MOSI"), | ||
436 | "L21", "mt8135", | ||
437 | MTK_EINT_FUNCTION(4, 19), | ||
438 | MTK_FUNCTION(0, "GPIO37"), | ||
439 | MTK_FUNCTION(1, "AUD_CLK"), | ||
440 | MTK_FUNCTION(2, "ADC_CK"), | ||
441 | MTK_FUNCTION(3, " HDMI_SDATA0"), | ||
442 | MTK_FUNCTION(4, "EINT19"), | ||
443 | MTK_FUNCTION(5, "USB_TEST_IO[6]"), | ||
444 | MTK_FUNCTION(7, "TESTA_OUT19") | ||
445 | ), | ||
446 | MTK_PIN( | ||
447 | PINCTRL_PIN(38, "AUD_DAT_MOSI"), | ||
448 | "L23", "mt8135", | ||
449 | MTK_EINT_FUNCTION(4, 21), | ||
450 | MTK_FUNCTION(0, "GPIO38"), | ||
451 | MTK_FUNCTION(1, "AUD_DAT_MOSI"), | ||
452 | MTK_FUNCTION(2, "ADC_WS"), | ||
453 | MTK_FUNCTION(3, "AUD_DAT_MISO"), | ||
454 | MTK_FUNCTION(4, "EINT21"), | ||
455 | MTK_FUNCTION(5, "USB_TEST_IO[7]"), | ||
456 | MTK_FUNCTION(7, "TESTA_OUT20") | ||
457 | ), | ||
458 | MTK_PIN( | ||
459 | PINCTRL_PIN(39, "AUD_DAT_MISO"), | ||
460 | "L22", "mt8135", | ||
461 | MTK_EINT_FUNCTION(4, 20), | ||
462 | MTK_FUNCTION(0, "GPIO39"), | ||
463 | MTK_FUNCTION(1, "AUD_DAT_MISO"), | ||
464 | MTK_FUNCTION(2, "ADC_DAT_IN"), | ||
465 | MTK_FUNCTION(3, "AUD_DAT_MOSI"), | ||
466 | MTK_FUNCTION(4, "EINT20"), | ||
467 | MTK_FUNCTION(5, "USB_TEST_IO[8]"), | ||
468 | MTK_FUNCTION(7, "TESTA_OUT21") | ||
469 | ), | ||
470 | MTK_PIN( | ||
471 | PINCTRL_PIN(40, "DAC_CLK"), | ||
472 | "P21", "mt8135", | ||
473 | MTK_EINT_FUNCTION(2, 22), | ||
474 | MTK_FUNCTION(0, "GPIO40"), | ||
475 | MTK_FUNCTION(1, "DAC_CK"), | ||
476 | MTK_FUNCTION(2, "EINT22"), | ||
477 | MTK_FUNCTION(3, " HDMI_SDATA1"), | ||
478 | MTK_FUNCTION(5, "USB_TEST_IO[9]"), | ||
479 | MTK_FUNCTION(7, "TESTA_OUT22") | ||
480 | ), | ||
481 | MTK_PIN( | ||
482 | PINCTRL_PIN(41, "DAC_WS"), | ||
483 | "N18", "mt8135", | ||
484 | MTK_EINT_FUNCTION(2, 24), | ||
485 | MTK_FUNCTION(0, "GPIO41"), | ||
486 | MTK_FUNCTION(1, "DAC_WS"), | ||
487 | MTK_FUNCTION(2, "EINT24"), | ||
488 | MTK_FUNCTION(3, " HDMI_SDATA2"), | ||
489 | MTK_FUNCTION(5, "USB_TEST_IO[10]"), | ||
490 | MTK_FUNCTION(7, "TESTA_OUT23") | ||
491 | ), | ||
492 | MTK_PIN( | ||
493 | PINCTRL_PIN(42, "DAC_DAT_OUT"), | ||
494 | "N22", "mt8135", | ||
495 | MTK_EINT_FUNCTION(2, 23), | ||
496 | MTK_FUNCTION(0, "GPIO42"), | ||
497 | MTK_FUNCTION(1, "DAC_DAT_OUT"), | ||
498 | MTK_FUNCTION(2, "EINT23"), | ||
499 | MTK_FUNCTION(3, " HDMI_SDATA3"), | ||
500 | MTK_FUNCTION(5, "USB_TEST_IO[11]"), | ||
501 | MTK_FUNCTION(7, "TESTA_OUT24") | ||
502 | ), | ||
503 | MTK_PIN( | ||
504 | PINCTRL_PIN(43, "PWRAP_SPI0_MO"), | ||
505 | "M22", "mt8135", | ||
506 | MTK_EINT_FUNCTION(2, 29), | ||
507 | MTK_FUNCTION(0, "GPIO43"), | ||
508 | MTK_FUNCTION(1, "PWRAP_SPIDI"), | ||
509 | MTK_FUNCTION(2, "EINT29") | ||
510 | ), | ||
511 | MTK_PIN( | ||
512 | PINCTRL_PIN(44, "PWRAP_SPI0_MI"), | ||
513 | "P23", "mt8135", | ||
514 | MTK_EINT_FUNCTION(2, 28), | ||
515 | MTK_FUNCTION(0, "GPIO44"), | ||
516 | MTK_FUNCTION(1, "PWRAP_SPIDO"), | ||
517 | MTK_FUNCTION(2, "EINT28") | ||
518 | ), | ||
519 | MTK_PIN( | ||
520 | PINCTRL_PIN(45, "PWRAP_SPI0_CSN"), | ||
521 | "M21", "mt8135", | ||
522 | MTK_EINT_FUNCTION(2, 27), | ||
523 | MTK_FUNCTION(0, "GPIO45"), | ||
524 | MTK_FUNCTION(1, "PWRAP_SPICS_B_I"), | ||
525 | MTK_FUNCTION(2, "EINT27") | ||
526 | ), | ||
527 | MTK_PIN( | ||
528 | PINCTRL_PIN(46, "PWRAP_SPI0_CLK"), | ||
529 | "P22", "mt8135", | ||
530 | MTK_EINT_FUNCTION(2, 26), | ||
531 | MTK_FUNCTION(0, "GPIO46"), | ||
532 | MTK_FUNCTION(1, "PWRAP_SPICK_I"), | ||
533 | MTK_FUNCTION(2, "EINT26") | ||
534 | ), | ||
535 | MTK_PIN( | ||
536 | PINCTRL_PIN(47, "PWRAP_EVENT"), | ||
537 | "M23", "mt8135", | ||
538 | MTK_EINT_FUNCTION(2, 25), | ||
539 | MTK_FUNCTION(0, "GPIO47"), | ||
540 | MTK_FUNCTION(1, "PWRAP_EVENT_IN"), | ||
541 | MTK_FUNCTION(2, "EINT25"), | ||
542 | MTK_FUNCTION(7, "TESTA_OUT2") | ||
543 | ), | ||
544 | MTK_PIN( | ||
545 | PINCTRL_PIN(48, "RTC32K_CK"), | ||
546 | "N20", "mt8135", | ||
547 | MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT), | ||
548 | MTK_FUNCTION(0, "GPIO48"), | ||
549 | MTK_FUNCTION(1, "RTC32K_CK") | ||
550 | ), | ||
551 | MTK_PIN( | ||
552 | PINCTRL_PIN(49, "WATCHDOG"), | ||
553 | "R22", "mt8135", | ||
554 | MTK_EINT_FUNCTION(2, 36), | ||
555 | MTK_FUNCTION(0, "GPIO49"), | ||
556 | MTK_FUNCTION(1, "WATCHDOG"), | ||
557 | MTK_FUNCTION(2, "EINT36") | ||
558 | ), | ||
559 | MTK_PIN( | ||
560 | PINCTRL_PIN(50, "SRCLKENA"), | ||
561 | "T22", "mt8135", | ||
562 | MTK_EINT_FUNCTION(2, 38), | ||
563 | MTK_FUNCTION(0, "GPIO50"), | ||
564 | MTK_FUNCTION(1, "SRCLKENA"), | ||
565 | MTK_FUNCTION(2, "EINT38") | ||
566 | ), | ||
567 | MTK_PIN( | ||
568 | PINCTRL_PIN(51, "SRCVOLTEN"), | ||
569 | "T23", "mt8135", | ||
570 | MTK_EINT_FUNCTION(2, 37), | ||
571 | MTK_FUNCTION(0, "GPIO51"), | ||
572 | MTK_FUNCTION(1, "SRCVOLTEN"), | ||
573 | MTK_FUNCTION(2, "EINT37") | ||
574 | ), | ||
575 | MTK_PIN( | ||
576 | PINCTRL_PIN(52, "EINT0"), | ||
577 | "T21", "mt8135", | ||
578 | MTK_EINT_FUNCTION(1, 0), | ||
579 | MTK_FUNCTION(0, "GPIO52"), | ||
580 | MTK_FUNCTION(1, "EINT0"), | ||
581 | MTK_FUNCTION(2, "PWM1"), | ||
582 | MTK_FUNCTION(3, "CLKM0"), | ||
583 | MTK_FUNCTION(4, " SPDIF_OUT"), | ||
584 | MTK_FUNCTION(5, "USB_TEST_IO[12]"), | ||
585 | MTK_FUNCTION(7, "USB_SCL") | ||
586 | ), | ||
587 | MTK_PIN( | ||
588 | PINCTRL_PIN(53, "URXD2"), | ||
589 | "R18", "mt8135", | ||
590 | MTK_EINT_FUNCTION(2, 83), | ||
591 | MTK_FUNCTION(0, "GPIO53"), | ||
592 | MTK_FUNCTION(1, "URXD2"), | ||
593 | MTK_FUNCTION(2, "EINT83"), | ||
594 | MTK_FUNCTION(4, " HDMI_LRCK"), | ||
595 | MTK_FUNCTION(5, "CLKM3"), | ||
596 | MTK_FUNCTION(7, "UTXD2") | ||
597 | ), | ||
598 | MTK_PIN( | ||
599 | PINCTRL_PIN(54, "UTXD2"), | ||
600 | "R17", "mt8135", | ||
601 | MTK_EINT_FUNCTION(2, 82), | ||
602 | MTK_FUNCTION(0, "GPIO54"), | ||
603 | MTK_FUNCTION(1, "UTXD2"), | ||
604 | MTK_FUNCTION(2, "EINT82"), | ||
605 | MTK_FUNCTION(4, " HDMI_BCK_OUT"), | ||
606 | MTK_FUNCTION(5, "CLKM2"), | ||
607 | MTK_FUNCTION(7, "URXD2") | ||
608 | ), | ||
609 | MTK_PIN( | ||
610 | PINCTRL_PIN(55, "UCTS2"), | ||
611 | "R20", "mt8135", | ||
612 | MTK_EINT_FUNCTION(2, 84), | ||
613 | MTK_FUNCTION(0, "GPIO55"), | ||
614 | MTK_FUNCTION(1, "UCTS2"), | ||
615 | MTK_FUNCTION(2, "EINT84"), | ||
616 | MTK_FUNCTION(5, "PWM1"), | ||
617 | MTK_FUNCTION(7, "URTS2") | ||
618 | ), | ||
619 | MTK_PIN( | ||
620 | PINCTRL_PIN(56, "URTS2"), | ||
621 | "R19", "mt8135", | ||
622 | MTK_EINT_FUNCTION(2, 85), | ||
623 | MTK_FUNCTION(0, "GPIO56"), | ||
624 | MTK_FUNCTION(1, "URTS2"), | ||
625 | MTK_FUNCTION(2, "EINT85"), | ||
626 | MTK_FUNCTION(5, "PWM2"), | ||
627 | MTK_FUNCTION(7, "UCTS2") | ||
628 | ), | ||
629 | MTK_PIN( | ||
630 | PINCTRL_PIN(57, "JTCK"), | ||
631 | "V17", "mt8135", | ||
632 | MTK_EINT_FUNCTION(2, 188), | ||
633 | MTK_FUNCTION(0, "GPIO57"), | ||
634 | MTK_FUNCTION(1, "JTCK"), | ||
635 | MTK_FUNCTION(2, "EINT188"), | ||
636 | MTK_FUNCTION(3, "DSP1_ICK") | ||
637 | ), | ||
638 | MTK_PIN( | ||
639 | PINCTRL_PIN(58, "JTDO"), | ||
640 | "T16", "mt8135", | ||
641 | MTK_EINT_FUNCTION(2, 190), | ||
642 | MTK_FUNCTION(0, "GPIO58"), | ||
643 | MTK_FUNCTION(1, "JTDO"), | ||
644 | MTK_FUNCTION(2, "EINT190"), | ||
645 | MTK_FUNCTION(3, "DSP2_IMS") | ||
646 | ), | ||
647 | MTK_PIN( | ||
648 | PINCTRL_PIN(59, "JTRST_B"), | ||
649 | "T19", "mt8135", | ||
650 | MTK_EINT_FUNCTION(2, 0), | ||
651 | MTK_FUNCTION(0, "GPIO59"), | ||
652 | MTK_FUNCTION(1, "JTRST_B"), | ||
653 | MTK_FUNCTION(2, "EINT0"), | ||
654 | MTK_FUNCTION(3, "DSP2_ICK") | ||
655 | ), | ||
656 | MTK_PIN( | ||
657 | PINCTRL_PIN(60, "JTDI"), | ||
658 | "T18", "mt8135", | ||
659 | MTK_EINT_FUNCTION(2, 189), | ||
660 | MTK_FUNCTION(0, "GPIO60"), | ||
661 | MTK_FUNCTION(1, "JTDI"), | ||
662 | MTK_FUNCTION(2, "EINT189"), | ||
663 | MTK_FUNCTION(3, "DSP1_IMS") | ||
664 | ), | ||
665 | MTK_PIN( | ||
666 | PINCTRL_PIN(61, "JRTCK"), | ||
667 | "T20", "mt8135", | ||
668 | MTK_EINT_FUNCTION(2, 187), | ||
669 | MTK_FUNCTION(0, "GPIO61"), | ||
670 | MTK_FUNCTION(1, "JRTCK"), | ||
671 | MTK_FUNCTION(2, "EINT187"), | ||
672 | MTK_FUNCTION(3, "DSP1_ID") | ||
673 | ), | ||
674 | MTK_PIN( | ||
675 | PINCTRL_PIN(62, "JTMS"), | ||
676 | "T17", "mt8135", | ||
677 | MTK_EINT_FUNCTION(2, 191), | ||
678 | MTK_FUNCTION(0, "GPIO62"), | ||
679 | MTK_FUNCTION(1, "JTMS"), | ||
680 | MTK_FUNCTION(2, "EINT191"), | ||
681 | MTK_FUNCTION(3, "DSP2_ID") | ||
682 | ), | ||
683 | MTK_PIN( | ||
684 | PINCTRL_PIN(63, "MSDC1_INSI"), | ||
685 | "V18", "mt8135", | ||
686 | MTK_EINT_FUNCTION(1, 15), | ||
687 | MTK_FUNCTION(0, "GPIO63"), | ||
688 | MTK_FUNCTION(1, "MSDC1_INSI"), | ||
689 | MTK_FUNCTION(3, "SCL5"), | ||
690 | MTK_FUNCTION(4, "PWM6"), | ||
691 | MTK_FUNCTION(5, "CLKM5"), | ||
692 | MTK_FUNCTION(7, "TESTB_OUT6") | ||
693 | ), | ||
694 | MTK_PIN( | ||
695 | PINCTRL_PIN(64, "MSDC1_SDWPI"), | ||
696 | "W18", "mt8135", | ||
697 | MTK_EINT_FUNCTION(2, 58), | ||
698 | MTK_FUNCTION(0, "GPIO64"), | ||
699 | MTK_FUNCTION(1, "MSDC1_SDWPI"), | ||
700 | MTK_FUNCTION(2, "EINT58"), | ||
701 | MTK_FUNCTION(3, "SDA5"), | ||
702 | MTK_FUNCTION(4, "PWM7"), | ||
703 | MTK_FUNCTION(5, "CLKM6"), | ||
704 | MTK_FUNCTION(7, "TESTB_OUT7") | ||
705 | ), | ||
706 | MTK_PIN( | ||
707 | PINCTRL_PIN(65, "MSDC2_INSI"), | ||
708 | "U22", "mt8135", | ||
709 | MTK_EINT_FUNCTION(1, 14), | ||
710 | MTK_FUNCTION(0, "GPIO65"), | ||
711 | MTK_FUNCTION(1, "MSDC2_INSI"), | ||
712 | MTK_FUNCTION(5, "USB_TEST_IO[27]"), | ||
713 | MTK_FUNCTION(7, "TESTA_OUT3") | ||
714 | ), | ||
715 | MTK_PIN( | ||
716 | PINCTRL_PIN(66, "MSDC2_SDWPI"), | ||
717 | "U21", "mt8135", | ||
718 | MTK_EINT_FUNCTION(2, 66), | ||
719 | MTK_FUNCTION(0, "GPIO66"), | ||
720 | MTK_FUNCTION(1, "MSDC2_SDWPI"), | ||
721 | MTK_FUNCTION(2, "EINT66"), | ||
722 | MTK_FUNCTION(5, "USB_TEST_IO[28]") | ||
723 | ), | ||
724 | MTK_PIN( | ||
725 | PINCTRL_PIN(67, "URXD4"), | ||
726 | "V23", "mt8135", | ||
727 | MTK_EINT_FUNCTION(2, 89), | ||
728 | MTK_FUNCTION(0, "GPIO67"), | ||
729 | MTK_FUNCTION(1, "URXD4"), | ||
730 | MTK_FUNCTION(2, "EINT89"), | ||
731 | MTK_FUNCTION(3, "URXD1"), | ||
732 | MTK_FUNCTION(6, "UTXD4"), | ||
733 | MTK_FUNCTION(7, "TESTB_OUT10") | ||
734 | ), | ||
735 | MTK_PIN( | ||
736 | PINCTRL_PIN(68, "UTXD4"), | ||
737 | "V22", "mt8135", | ||
738 | MTK_EINT_FUNCTION(2, 88), | ||
739 | MTK_FUNCTION(0, "GPIO68"), | ||
740 | MTK_FUNCTION(1, "UTXD4"), | ||
741 | MTK_FUNCTION(2, "EINT88"), | ||
742 | MTK_FUNCTION(3, "UTXD1"), | ||
743 | MTK_FUNCTION(6, "URXD4"), | ||
744 | MTK_FUNCTION(7, "TESTB_OUT11") | ||
745 | ), | ||
746 | MTK_PIN( | ||
747 | PINCTRL_PIN(69, "URXD1"), | ||
748 | "W22", "mt8135", | ||
749 | MTK_EINT_FUNCTION(2, 79), | ||
750 | MTK_FUNCTION(0, "GPIO69"), | ||
751 | MTK_FUNCTION(1, "URXD1"), | ||
752 | MTK_FUNCTION(2, "EINT79"), | ||
753 | MTK_FUNCTION(3, "URXD4"), | ||
754 | MTK_FUNCTION(6, "UTXD1"), | ||
755 | MTK_FUNCTION(7, "TESTB_OUT24") | ||
756 | ), | ||
757 | MTK_PIN( | ||
758 | PINCTRL_PIN(70, "UTXD1"), | ||
759 | "V21", "mt8135", | ||
760 | MTK_EINT_FUNCTION(2, 78), | ||
761 | MTK_FUNCTION(0, "GPIO70"), | ||
762 | MTK_FUNCTION(1, "UTXD1"), | ||
763 | MTK_FUNCTION(2, "EINT78"), | ||
764 | MTK_FUNCTION(3, "UTXD4"), | ||
765 | MTK_FUNCTION(6, "URXD1"), | ||
766 | MTK_FUNCTION(7, "TESTB_OUT25") | ||
767 | ), | ||
768 | MTK_PIN( | ||
769 | PINCTRL_PIN(71, "UCTS1"), | ||
770 | "V19", "mt8135", | ||
771 | MTK_EINT_FUNCTION(2, 80), | ||
772 | MTK_FUNCTION(0, "GPIO71"), | ||
773 | MTK_FUNCTION(1, "UCTS1"), | ||
774 | MTK_FUNCTION(2, "EINT80"), | ||
775 | MTK_FUNCTION(5, "CLKM0"), | ||
776 | MTK_FUNCTION(6, "URTS1"), | ||
777 | MTK_FUNCTION(7, "TESTB_OUT31") | ||
778 | ), | ||
779 | MTK_PIN( | ||
780 | PINCTRL_PIN(72, "URTS1"), | ||
781 | "V20", "mt8135", | ||
782 | MTK_EINT_FUNCTION(2, 81), | ||
783 | MTK_FUNCTION(0, "GPIO72"), | ||
784 | MTK_FUNCTION(1, "URTS1"), | ||
785 | MTK_FUNCTION(2, "EINT81"), | ||
786 | MTK_FUNCTION(5, "CLKM1"), | ||
787 | MTK_FUNCTION(6, "UCTS1"), | ||
788 | MTK_FUNCTION(7, "TESTB_OUT21") | ||
789 | ), | ||
790 | MTK_PIN( | ||
791 | PINCTRL_PIN(73, "PWM1"), | ||
792 | "W17", "mt8135", | ||
793 | MTK_EINT_FUNCTION(2, 73), | ||
794 | MTK_FUNCTION(0, "GPIO73"), | ||
795 | MTK_FUNCTION(1, "PWM1"), | ||
796 | MTK_FUNCTION(2, "EINT73"), | ||
797 | MTK_FUNCTION(5, "USB_DRVVBUS"), | ||
798 | MTK_FUNCTION(6, "DISP_PWM"), | ||
799 | MTK_FUNCTION(7, "TESTB_OUT8") | ||
800 | ), | ||
801 | MTK_PIN( | ||
802 | PINCTRL_PIN(74, "PWM2"), | ||
803 | "Y17", "mt8135", | ||
804 | MTK_EINT_FUNCTION(2, 74), | ||
805 | MTK_FUNCTION(0, "GPIO74"), | ||
806 | MTK_FUNCTION(1, "PWM2"), | ||
807 | MTK_FUNCTION(2, "EINT74"), | ||
808 | MTK_FUNCTION(3, "DPI33_CK"), | ||
809 | MTK_FUNCTION(4, "PWM5"), | ||
810 | MTK_FUNCTION(5, "URXD2"), | ||
811 | MTK_FUNCTION(6, "DISP_PWM"), | ||
812 | MTK_FUNCTION(7, "TESTB_OUT9") | ||
813 | ), | ||
814 | MTK_PIN( | ||
815 | PINCTRL_PIN(75, "PWM3"), | ||
816 | "Y19", "mt8135", | ||
817 | MTK_EINT_FUNCTION(2, 75), | ||
818 | MTK_FUNCTION(0, "GPIO75"), | ||
819 | MTK_FUNCTION(1, "PWM3"), | ||
820 | MTK_FUNCTION(2, "EINT75"), | ||
821 | MTK_FUNCTION(3, "DPI33_D0"), | ||
822 | MTK_FUNCTION(4, "PWM6"), | ||
823 | MTK_FUNCTION(5, "UTXD2"), | ||
824 | MTK_FUNCTION(6, "DISP_PWM"), | ||
825 | MTK_FUNCTION(7, "TESTB_OUT12") | ||
826 | ), | ||
827 | MTK_PIN( | ||
828 | PINCTRL_PIN(76, "PWM4"), | ||
829 | "W19", "mt8135", | ||
830 | MTK_EINT_FUNCTION(2, 76), | ||
831 | MTK_FUNCTION(0, "GPIO76"), | ||
832 | MTK_FUNCTION(1, "PWM4"), | ||
833 | MTK_FUNCTION(2, "EINT76"), | ||
834 | MTK_FUNCTION(3, "DPI33_D1"), | ||
835 | MTK_FUNCTION(4, "PWM7"), | ||
836 | MTK_FUNCTION(6, "DISP_PWM"), | ||
837 | MTK_FUNCTION(7, "TESTB_OUT13") | ||
838 | ), | ||
839 | MTK_PIN( | ||
840 | PINCTRL_PIN(77, "MSDC2_DAT2"), | ||
841 | "W21", "mt8135", | ||
842 | MTK_EINT_FUNCTION(2, 63), | ||
843 | MTK_FUNCTION(0, "GPIO77"), | ||
844 | MTK_FUNCTION(1, "MSDC2_DAT2"), | ||
845 | MTK_FUNCTION(2, "EINT63"), | ||
846 | MTK_FUNCTION(4, "DSP2_IMS"), | ||
847 | MTK_FUNCTION(6, "DPI33_D6"), | ||
848 | MTK_FUNCTION(7, "TESTA_OUT25") | ||
849 | ), | ||
850 | MTK_PIN( | ||
851 | PINCTRL_PIN(78, "MSDC2_DAT3"), | ||
852 | "AA23", "mt8135", | ||
853 | MTK_EINT_FUNCTION(2, 64), | ||
854 | MTK_FUNCTION(0, "GPIO78"), | ||
855 | MTK_FUNCTION(1, "MSDC2_DAT3"), | ||
856 | MTK_FUNCTION(2, "EINT64"), | ||
857 | MTK_FUNCTION(4, "DSP2_ID"), | ||
858 | MTK_FUNCTION(6, "DPI33_D7"), | ||
859 | MTK_FUNCTION(7, "TESTA_OUT26") | ||
860 | ), | ||
861 | MTK_PIN( | ||
862 | PINCTRL_PIN(79, "MSDC2_CMD"), | ||
863 | "Y22", "mt8135", | ||
864 | MTK_EINT_FUNCTION(2, 60), | ||
865 | MTK_FUNCTION(0, "GPIO79"), | ||
866 | MTK_FUNCTION(1, "MSDC2_CMD"), | ||
867 | MTK_FUNCTION(2, "EINT60"), | ||
868 | MTK_FUNCTION(4, "DSP1_IMS"), | ||
869 | MTK_FUNCTION(5, "PCM1_WS"), | ||
870 | MTK_FUNCTION(6, "DPI33_D3"), | ||
871 | MTK_FUNCTION(7, "TESTA_OUT0") | ||
872 | ), | ||
873 | MTK_PIN( | ||
874 | PINCTRL_PIN(80, "MSDC2_CLK"), | ||
875 | "AA22", "mt8135", | ||
876 | MTK_EINT_FUNCTION(2, 59), | ||
877 | MTK_FUNCTION(0, "GPIO80"), | ||
878 | MTK_FUNCTION(1, "MSDC2_CLK"), | ||
879 | MTK_FUNCTION(2, "EINT59"), | ||
880 | MTK_FUNCTION(4, "DSP1_ICK"), | ||
881 | MTK_FUNCTION(5, "PCM1_CK"), | ||
882 | MTK_FUNCTION(6, "DPI33_D2"), | ||
883 | MTK_FUNCTION(7, "TESTA_OUT1") | ||
884 | ), | ||
885 | MTK_PIN( | ||
886 | PINCTRL_PIN(81, "MSDC2_DAT1"), | ||
887 | "Y21", "mt8135", | ||
888 | MTK_EINT_FUNCTION(2, 62), | ||
889 | MTK_FUNCTION(0, "GPIO81"), | ||
890 | MTK_FUNCTION(1, "MSDC2_DAT1"), | ||
891 | MTK_FUNCTION(2, "EINT62"), | ||
892 | MTK_FUNCTION(4, "DSP2_ICK"), | ||
893 | MTK_FUNCTION(5, "PCM1_DO"), | ||
894 | MTK_FUNCTION(6, "DPI33_D5") | ||
895 | ), | ||
896 | MTK_PIN( | ||
897 | PINCTRL_PIN(82, "MSDC2_DAT0"), | ||
898 | "AB22", "mt8135", | ||
899 | MTK_EINT_FUNCTION(2, 61), | ||
900 | MTK_FUNCTION(0, "GPIO82"), | ||
901 | MTK_FUNCTION(1, "MSDC2_DAT0"), | ||
902 | MTK_FUNCTION(2, "EINT61"), | ||
903 | MTK_FUNCTION(4, "DSP1_ID"), | ||
904 | MTK_FUNCTION(5, "PCM1_DI"), | ||
905 | MTK_FUNCTION(6, "DPI33_D4") | ||
906 | ), | ||
907 | MTK_PIN( | ||
908 | PINCTRL_PIN(83, "MSDC1_DAT0"), | ||
909 | "AC19", "mt8135", | ||
910 | MTK_EINT_FUNCTION(2, 53), | ||
911 | MTK_FUNCTION(0, "GPIO83"), | ||
912 | MTK_FUNCTION(1, "MSDC1_DAT0"), | ||
913 | MTK_FUNCTION(2, "EINT53"), | ||
914 | MTK_FUNCTION(3, "SCL1"), | ||
915 | MTK_FUNCTION(4, "PWM2"), | ||
916 | MTK_FUNCTION(5, "CLKM1"), | ||
917 | MTK_FUNCTION(7, "TESTB_OUT2") | ||
918 | ), | ||
919 | MTK_PIN( | ||
920 | PINCTRL_PIN(84, "MSDC1_DAT1"), | ||
921 | "AA19", "mt8135", | ||
922 | MTK_EINT_FUNCTION(2, 54), | ||
923 | MTK_FUNCTION(0, "GPIO84"), | ||
924 | MTK_FUNCTION(1, "MSDC1_DAT1"), | ||
925 | MTK_FUNCTION(2, "EINT54"), | ||
926 | MTK_FUNCTION(3, "SDA1"), | ||
927 | MTK_FUNCTION(4, "PWM3"), | ||
928 | MTK_FUNCTION(5, "CLKM2"), | ||
929 | MTK_FUNCTION(7, "TESTB_OUT3") | ||
930 | ), | ||
931 | MTK_PIN( | ||
932 | PINCTRL_PIN(85, "MSDC1_CMD"), | ||
933 | "AA20", "mt8135", | ||
934 | MTK_EINT_FUNCTION(2, 52), | ||
935 | MTK_FUNCTION(0, "GPIO85"), | ||
936 | MTK_FUNCTION(1, "MSDC1_CMD"), | ||
937 | MTK_FUNCTION(2, "EINT52"), | ||
938 | MTK_FUNCTION(3, "SDA0"), | ||
939 | MTK_FUNCTION(4, "PWM1"), | ||
940 | MTK_FUNCTION(5, "CLKM0"), | ||
941 | MTK_FUNCTION(7, "TESTB_OUT1") | ||
942 | ), | ||
943 | MTK_PIN( | ||
944 | PINCTRL_PIN(86, "MSDC1_CLK"), | ||
945 | "AB19", "mt8135", | ||
946 | MTK_EINT_FUNCTION(2, 51), | ||
947 | MTK_FUNCTION(0, "GPIO86"), | ||
948 | MTK_FUNCTION(1, "MSDC1_CLK"), | ||
949 | MTK_FUNCTION(2, "EINT51"), | ||
950 | MTK_FUNCTION(3, "SCL0"), | ||
951 | MTK_FUNCTION(4, "DISP_PWM"), | ||
952 | MTK_FUNCTION(7, "TESTB_OUT0") | ||
953 | ), | ||
954 | MTK_PIN( | ||
955 | PINCTRL_PIN(87, "MSDC1_DAT2"), | ||
956 | "AA21", "mt8135", | ||
957 | MTK_EINT_FUNCTION(2, 55), | ||
958 | MTK_FUNCTION(0, "GPIO87"), | ||
959 | MTK_FUNCTION(1, "MSDC1_DAT2"), | ||
960 | MTK_FUNCTION(2, "EINT55"), | ||
961 | MTK_FUNCTION(3, "SCL4"), | ||
962 | MTK_FUNCTION(4, "PWM4"), | ||
963 | MTK_FUNCTION(5, "CLKM3"), | ||
964 | MTK_FUNCTION(7, "TESTB_OUT4") | ||
965 | ), | ||
966 | MTK_PIN( | ||
967 | PINCTRL_PIN(88, "MSDC1_DAT3"), | ||
968 | "AB20", "mt8135", | ||
969 | MTK_EINT_FUNCTION(2, 56), | ||
970 | MTK_FUNCTION(0, "GPIO88"), | ||
971 | MTK_FUNCTION(1, "MSDC1_DAT3"), | ||
972 | MTK_FUNCTION(2, "EINT56"), | ||
973 | MTK_FUNCTION(3, "SDA4"), | ||
974 | MTK_FUNCTION(4, "PWM5"), | ||
975 | MTK_FUNCTION(5, "CLKM4"), | ||
976 | MTK_FUNCTION(7, "TESTB_OUT5") | ||
977 | ), | ||
978 | MTK_PIN( | ||
979 | PINCTRL_PIN(89, "MSDC4_DAT0"), | ||
980 | "AB8", "mt8135", | ||
981 | MTK_EINT_FUNCTION(2, 133), | ||
982 | MTK_FUNCTION(0, "GPIO89"), | ||
983 | MTK_FUNCTION(1, "MSDC4_DAT0"), | ||
984 | MTK_FUNCTION(2, "EINT133"), | ||
985 | MTK_FUNCTION(4, "EXT_FRAME_SYNC"), | ||
986 | MTK_FUNCTION(5, "USB_DRVVBUS"), | ||
987 | MTK_FUNCTION(6, "A_FUNC_DIN[9]"), | ||
988 | MTK_FUNCTION(7, "LPTE") | ||
989 | ), | ||
990 | MTK_PIN( | ||
991 | PINCTRL_PIN(90, "MSDC4_DAT1"), | ||
992 | "AB7", "mt8135", | ||
993 | MTK_EINT_FUNCTION(2, 134), | ||
994 | MTK_FUNCTION(0, "GPIO90"), | ||
995 | MTK_FUNCTION(1, "MSDC4_DAT1"), | ||
996 | MTK_FUNCTION(2, "EINT134"), | ||
997 | MTK_FUNCTION(6, "A_FUNC_DIN[10]"), | ||
998 | MTK_FUNCTION(7, "LRSTB_1X") | ||
999 | ), | ||
1000 | MTK_PIN( | ||
1001 | PINCTRL_PIN(91, "MSDC4_DAT5"), | ||
1002 | "AA8", "mt8135", | ||
1003 | MTK_EINT_FUNCTION(2, 136), | ||
1004 | MTK_FUNCTION(0, "GPIO91"), | ||
1005 | MTK_FUNCTION(1, "MSDC4_DAT5"), | ||
1006 | MTK_FUNCTION(2, "EINT136"), | ||
1007 | MTK_FUNCTION(3, "I2SIN_WS"), | ||
1008 | MTK_FUNCTION(4, "DAC_WS"), | ||
1009 | MTK_FUNCTION(5, "PCM1_WS"), | ||
1010 | MTK_FUNCTION(6, "A_FUNC_DIN[11]"), | ||
1011 | MTK_FUNCTION(7, "SPI1_CSN") | ||
1012 | ), | ||
1013 | MTK_PIN( | ||
1014 | PINCTRL_PIN(92, "MSDC4_DAT6"), | ||
1015 | "AC4", "mt8135", | ||
1016 | MTK_EINT_FUNCTION(2, 137), | ||
1017 | MTK_FUNCTION(0, "GPIO92"), | ||
1018 | MTK_FUNCTION(1, "MSDC4_DAT6"), | ||
1019 | MTK_FUNCTION(2, "EINT137"), | ||
1020 | MTK_FUNCTION(3, "I2SOUT_DAT"), | ||
1021 | MTK_FUNCTION(4, "DAC_DAT_OUT"), | ||
1022 | MTK_FUNCTION(5, "PCM1_DO"), | ||
1023 | MTK_FUNCTION(6, "A_FUNC_DIN[12]"), | ||
1024 | MTK_FUNCTION(7, "SPI1_MO") | ||
1025 | ), | ||
1026 | MTK_PIN( | ||
1027 | PINCTRL_PIN(93, "MSDC4_DAT7"), | ||
1028 | "AC6", "mt8135", | ||
1029 | MTK_EINT_FUNCTION(2, 138), | ||
1030 | MTK_FUNCTION(0, "GPIO93"), | ||
1031 | MTK_FUNCTION(1, "MSDC4_DAT7"), | ||
1032 | MTK_FUNCTION(2, "EINT138"), | ||
1033 | MTK_FUNCTION(3, "I2SIN_DAT"), | ||
1034 | MTK_FUNCTION(5, "PCM1_DI"), | ||
1035 | MTK_FUNCTION(6, "A_FUNC_DIN[13]"), | ||
1036 | MTK_FUNCTION(7, "SPI1_MI") | ||
1037 | ), | ||
1038 | MTK_PIN( | ||
1039 | PINCTRL_PIN(94, "MSDC4_DAT4"), | ||
1040 | "AA7", "mt8135", | ||
1041 | MTK_EINT_FUNCTION(2, 135), | ||
1042 | MTK_FUNCTION(0, "GPIO94"), | ||
1043 | MTK_FUNCTION(1, "MSDC4_DAT4"), | ||
1044 | MTK_FUNCTION(2, "EINT135"), | ||
1045 | MTK_FUNCTION(3, "I2SIN_CK"), | ||
1046 | MTK_FUNCTION(4, "DAC_CK"), | ||
1047 | MTK_FUNCTION(5, "PCM1_CK"), | ||
1048 | MTK_FUNCTION(6, "A_FUNC_DIN[14]"), | ||
1049 | MTK_FUNCTION(7, "SPI1_CLK") | ||
1050 | ), | ||
1051 | MTK_PIN( | ||
1052 | PINCTRL_PIN(95, "MSDC4_DAT2"), | ||
1053 | "AB6", "mt8135", | ||
1054 | MTK_EINT_FUNCTION(2, 131), | ||
1055 | MTK_FUNCTION(0, "GPIO95"), | ||
1056 | MTK_FUNCTION(1, "MSDC4_DAT2"), | ||
1057 | MTK_FUNCTION(2, "EINT131"), | ||
1058 | MTK_FUNCTION(3, "I2SIN_WS"), | ||
1059 | MTK_FUNCTION(4, "CM2PDN_2X"), | ||
1060 | MTK_FUNCTION(5, "DAC_WS"), | ||
1061 | MTK_FUNCTION(6, "PCM1_WS"), | ||
1062 | MTK_FUNCTION(7, "LSCE0B_1X") | ||
1063 | ), | ||
1064 | MTK_PIN( | ||
1065 | PINCTRL_PIN(96, "MSDC4_CLK"), | ||
1066 | "AB5", "mt8135", | ||
1067 | MTK_EINT_FUNCTION(2, 129), | ||
1068 | MTK_FUNCTION(0, "GPIO96"), | ||
1069 | MTK_FUNCTION(1, "MSDC4_CLK"), | ||
1070 | MTK_FUNCTION(2, "EINT129"), | ||
1071 | MTK_FUNCTION(3, "DPI1_CK_2X"), | ||
1072 | MTK_FUNCTION(4, "CM2PCLK_2X"), | ||
1073 | MTK_FUNCTION(5, "PWM4"), | ||
1074 | MTK_FUNCTION(6, "PCM1_DI"), | ||
1075 | MTK_FUNCTION(7, "LSCK_1X") | ||
1076 | ), | ||
1077 | MTK_PIN( | ||
1078 | PINCTRL_PIN(97, "MSDC4_DAT3"), | ||
1079 | "Y8", "mt8135", | ||
1080 | MTK_EINT_FUNCTION(2, 132), | ||
1081 | MTK_FUNCTION(0, "GPIO97"), | ||
1082 | MTK_FUNCTION(1, "MSDC4_DAT3"), | ||
1083 | MTK_FUNCTION(2, "EINT132"), | ||
1084 | MTK_FUNCTION(3, "I2SOUT_DAT"), | ||
1085 | MTK_FUNCTION(4, "CM2RST_2X"), | ||
1086 | MTK_FUNCTION(5, "DAC_DAT_OUT"), | ||
1087 | MTK_FUNCTION(6, "PCM1_DO"), | ||
1088 | MTK_FUNCTION(7, "LSCE1B_1X") | ||
1089 | ), | ||
1090 | MTK_PIN( | ||
1091 | PINCTRL_PIN(98, "MSDC4_CMD"), | ||
1092 | "AC3", "mt8135", | ||
1093 | MTK_EINT_FUNCTION(2, 128), | ||
1094 | MTK_FUNCTION(0, "GPIO98"), | ||
1095 | MTK_FUNCTION(1, "MSDC4_CMD"), | ||
1096 | MTK_FUNCTION(2, "EINT128"), | ||
1097 | MTK_FUNCTION(3, "DPI1_DE_2X"), | ||
1098 | MTK_FUNCTION(5, "PWM3"), | ||
1099 | MTK_FUNCTION(7, "LSDA_1X") | ||
1100 | ), | ||
1101 | MTK_PIN( | ||
1102 | PINCTRL_PIN(99, "MSDC4_RSTB"), | ||
1103 | "AB4", "mt8135", | ||
1104 | MTK_EINT_FUNCTION(2, 130), | ||
1105 | MTK_FUNCTION(0, "GPIO99"), | ||
1106 | MTK_FUNCTION(1, "MSDC4_RSTB"), | ||
1107 | MTK_FUNCTION(2, "EINT130"), | ||
1108 | MTK_FUNCTION(3, "I2SIN_CK"), | ||
1109 | MTK_FUNCTION(4, "CM2MCLK_2X"), | ||
1110 | MTK_FUNCTION(5, "DAC_CK"), | ||
1111 | MTK_FUNCTION(6, "PCM1_CK"), | ||
1112 | MTK_FUNCTION(7, "LSA0_1X") | ||
1113 | ), | ||
1114 | MTK_PIN( | ||
1115 | PINCTRL_PIN(100, "SDA0"), | ||
1116 | "W9", "mt8135", | ||
1117 | MTK_EINT_FUNCTION(2, 91), | ||
1118 | MTK_FUNCTION(0, "GPIO100"), | ||
1119 | MTK_FUNCTION(1, "SDA0"), | ||
1120 | MTK_FUNCTION(2, "EINT91"), | ||
1121 | MTK_FUNCTION(3, "CLKM1"), | ||
1122 | MTK_FUNCTION(4, "PWM1"), | ||
1123 | MTK_FUNCTION(7, "A_FUNC_DIN[15]") | ||
1124 | ), | ||
1125 | MTK_PIN( | ||
1126 | PINCTRL_PIN(101, "SCL0"), | ||
1127 | "W11", "mt8135", | ||
1128 | MTK_EINT_FUNCTION(2, 90), | ||
1129 | MTK_FUNCTION(0, "GPIO101"), | ||
1130 | MTK_FUNCTION(1, "SCL0"), | ||
1131 | MTK_FUNCTION(2, "EINT90"), | ||
1132 | MTK_FUNCTION(3, "CLKM0"), | ||
1133 | MTK_FUNCTION(4, "DISP_PWM"), | ||
1134 | MTK_FUNCTION(7, "A_FUNC_DIN[16]") | ||
1135 | ), | ||
1136 | MTK_PIN( | ||
1137 | PINCTRL_PIN(102, "EINT10_AUXIN2"), | ||
1138 | "AA3", "mt8135", | ||
1139 | MTK_EINT_FUNCTION(1, 10), | ||
1140 | MTK_FUNCTION(0, "GPIO102"), | ||
1141 | MTK_FUNCTION(1, "EINT10"), | ||
1142 | MTK_FUNCTION(5, "USB_TEST_IO[16]"), | ||
1143 | MTK_FUNCTION(6, "TESTB_OUT16"), | ||
1144 | MTK_FUNCTION(7, "A_FUNC_DIN[17]") | ||
1145 | ), | ||
1146 | MTK_PIN( | ||
1147 | PINCTRL_PIN(103, "EINT11_AUXIN3"), | ||
1148 | "AB2", "mt8135", | ||
1149 | MTK_EINT_FUNCTION(1, 11), | ||
1150 | MTK_FUNCTION(0, "GPIO103"), | ||
1151 | MTK_FUNCTION(1, "EINT11"), | ||
1152 | MTK_FUNCTION(5, "USB_TEST_IO[17]"), | ||
1153 | MTK_FUNCTION(6, "TESTB_OUT17"), | ||
1154 | MTK_FUNCTION(7, "A_FUNC_DIN[18]") | ||
1155 | ), | ||
1156 | MTK_PIN( | ||
1157 | PINCTRL_PIN(104, "EINT16_AUXIN4"), | ||
1158 | "AB3", "mt8135", | ||
1159 | MTK_EINT_FUNCTION(1, 16), | ||
1160 | MTK_FUNCTION(0, "GPIO104"), | ||
1161 | MTK_FUNCTION(1, "EINT16"), | ||
1162 | MTK_FUNCTION(5, "USB_TEST_IO[18]"), | ||
1163 | MTK_FUNCTION(6, "TESTB_OUT18"), | ||
1164 | MTK_FUNCTION(7, "A_FUNC_DIN[19]") | ||
1165 | ), | ||
1166 | MTK_PIN( | ||
1167 | PINCTRL_PIN(105, "I2S_CLK"), | ||
1168 | "W6", "mt8135", | ||
1169 | MTK_EINT_FUNCTION(2, 10), | ||
1170 | MTK_FUNCTION(0, "GPIO105"), | ||
1171 | MTK_FUNCTION(1, "I2SIN_CK"), | ||
1172 | MTK_FUNCTION(2, "EINT10"), | ||
1173 | MTK_FUNCTION(3, "DAC_CK"), | ||
1174 | MTK_FUNCTION(4, "PCM1_CK"), | ||
1175 | MTK_FUNCTION(5, "USB_TEST_IO[19]"), | ||
1176 | MTK_FUNCTION(6, "TESTB_OUT19"), | ||
1177 | MTK_FUNCTION(7, "A_FUNC_DIN[20]") | ||
1178 | ), | ||
1179 | MTK_PIN( | ||
1180 | PINCTRL_PIN(106, "I2S_WS"), | ||
1181 | "AA6", "mt8135", | ||
1182 | MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT), | ||
1183 | MTK_FUNCTION(0, "GPIO106"), | ||
1184 | MTK_FUNCTION(1, "I2SIN_WS"), | ||
1185 | MTK_FUNCTION(3, "DAC_WS"), | ||
1186 | MTK_FUNCTION(4, "PCM1_WS"), | ||
1187 | MTK_FUNCTION(5, "USB_TEST_IO[20]"), | ||
1188 | MTK_FUNCTION(6, "TESTB_OUT20"), | ||
1189 | MTK_FUNCTION(7, "A_FUNC_DIN[21]") | ||
1190 | ), | ||
1191 | MTK_PIN( | ||
1192 | PINCTRL_PIN(107, "I2S_DATA_IN"), | ||
1193 | "AA5", "mt8135", | ||
1194 | MTK_EINT_FUNCTION(2, 11), | ||
1195 | MTK_FUNCTION(0, "GPIO107"), | ||
1196 | MTK_FUNCTION(1, "I2SIN_DAT"), | ||
1197 | MTK_FUNCTION(2, "EINT11"), | ||
1198 | MTK_FUNCTION(4, "PCM1_DI"), | ||
1199 | MTK_FUNCTION(5, "USB_TEST_IO[21]"), | ||
1200 | MTK_FUNCTION(6, "TESTB_OUT22"), | ||
1201 | MTK_FUNCTION(7, "A_FUNC_DIN[22]") | ||
1202 | ), | ||
1203 | MTK_PIN( | ||
1204 | PINCTRL_PIN(108, "I2S_DATA_OUT"), | ||
1205 | "AA4", "mt8135", | ||
1206 | MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT), | ||
1207 | MTK_FUNCTION(0, "GPIO108"), | ||
1208 | MTK_FUNCTION(1, "I2SOUT_DAT"), | ||
1209 | MTK_FUNCTION(3, "DAC_DAT_OUT"), | ||
1210 | MTK_FUNCTION(4, "PCM1_DO"), | ||
1211 | MTK_FUNCTION(5, "USB_TEST_IO[22]"), | ||
1212 | MTK_FUNCTION(6, "TESTB_OUT23"), | ||
1213 | MTK_FUNCTION(7, "A_FUNC_DIN[23]") | ||
1214 | ), | ||
1215 | MTK_PIN( | ||
1216 | PINCTRL_PIN(109, "EINT5"), | ||
1217 | "W5", "mt8135", | ||
1218 | MTK_EINT_FUNCTION(1, 5), | ||
1219 | MTK_FUNCTION(0, "GPIO109"), | ||
1220 | MTK_FUNCTION(1, "EINT5"), | ||
1221 | MTK_FUNCTION(2, "PWM5"), | ||
1222 | MTK_FUNCTION(3, "CLKM3"), | ||
1223 | MTK_FUNCTION(4, "GPU_JTRSTB"), | ||
1224 | MTK_FUNCTION(5, "USB_TEST_IO[23]"), | ||
1225 | MTK_FUNCTION(6, "TESTB_OUT26"), | ||
1226 | MTK_FUNCTION(7, "A_FUNC_DIN[24]") | ||
1227 | ), | ||
1228 | MTK_PIN( | ||
1229 | PINCTRL_PIN(110, "EINT6"), | ||
1230 | "V5", "mt8135", | ||
1231 | MTK_EINT_FUNCTION(1, 6), | ||
1232 | MTK_FUNCTION(0, "GPIO110"), | ||
1233 | MTK_FUNCTION(1, "EINT6"), | ||
1234 | MTK_FUNCTION(2, "PWM6"), | ||
1235 | MTK_FUNCTION(3, "CLKM4"), | ||
1236 | MTK_FUNCTION(4, "GPU_JTMS"), | ||
1237 | MTK_FUNCTION(5, "USB_TEST_IO[24]"), | ||
1238 | MTK_FUNCTION(6, "TESTB_OUT27"), | ||
1239 | MTK_FUNCTION(7, "A_FUNC_DIN[25]") | ||
1240 | ), | ||
1241 | MTK_PIN( | ||
1242 | PINCTRL_PIN(111, "EINT7"), | ||
1243 | "W3", "mt8135", | ||
1244 | MTK_EINT_FUNCTION(1, 7), | ||
1245 | MTK_FUNCTION(0, "GPIO111"), | ||
1246 | MTK_FUNCTION(1, "EINT7"), | ||
1247 | MTK_FUNCTION(2, "PWM7"), | ||
1248 | MTK_FUNCTION(3, "CLKM5"), | ||
1249 | MTK_FUNCTION(4, "GPU_JTDO"), | ||
1250 | MTK_FUNCTION(5, "USB_TEST_IO[25]"), | ||
1251 | MTK_FUNCTION(6, "TESTB_OUT28"), | ||
1252 | MTK_FUNCTION(7, "A_FUNC_DIN[26]") | ||
1253 | ), | ||
1254 | MTK_PIN( | ||
1255 | PINCTRL_PIN(112, "EINT8"), | ||
1256 | "V6", "mt8135", | ||
1257 | MTK_EINT_FUNCTION(1, 8), | ||
1258 | MTK_FUNCTION(0, "GPIO112"), | ||
1259 | MTK_FUNCTION(1, "EINT8"), | ||
1260 | MTK_FUNCTION(2, "DISP_PWM"), | ||
1261 | MTK_FUNCTION(3, "CLKM6"), | ||
1262 | MTK_FUNCTION(4, "GPU_JTDI"), | ||
1263 | MTK_FUNCTION(5, "USB_TEST_IO[26]"), | ||
1264 | MTK_FUNCTION(6, "TESTB_OUT29"), | ||
1265 | MTK_FUNCTION(7, "EXT_FRAME_SYNC") | ||
1266 | ), | ||
1267 | MTK_PIN( | ||
1268 | PINCTRL_PIN(113, "EINT9"), | ||
1269 | "W8", "mt8135", | ||
1270 | MTK_EINT_FUNCTION(1, 9), | ||
1271 | MTK_FUNCTION(0, "GPIO113"), | ||
1272 | MTK_FUNCTION(1, "EINT9"), | ||
1273 | MTK_FUNCTION(4, "GPU_JTCK"), | ||
1274 | MTK_FUNCTION(5, "USB_DRVVBUS"), | ||
1275 | MTK_FUNCTION(6, "TESTB_OUT30"), | ||
1276 | MTK_FUNCTION(7, "A_FUNC_DIN[27]") | ||
1277 | ), | ||
1278 | MTK_PIN( | ||
1279 | PINCTRL_PIN(114, "LPCE1B"), | ||
1280 | "W4", "mt8135", | ||
1281 | MTK_EINT_FUNCTION(2, 127), | ||
1282 | MTK_FUNCTION(0, "GPIO114"), | ||
1283 | MTK_FUNCTION(1, "LPCE1B"), | ||
1284 | MTK_FUNCTION(2, "EINT127"), | ||
1285 | MTK_FUNCTION(5, "PWM2"), | ||
1286 | MTK_FUNCTION(6, "TESTB_OUT14"), | ||
1287 | MTK_FUNCTION(7, "A_FUNC_DIN[28]") | ||
1288 | ), | ||
1289 | MTK_PIN( | ||
1290 | PINCTRL_PIN(115, "LPCE0B"), | ||
1291 | "T5", "mt8135", | ||
1292 | MTK_EINT_FUNCTION(2, 126), | ||
1293 | MTK_FUNCTION(0, "GPIO115"), | ||
1294 | MTK_FUNCTION(1, "LPCE0B"), | ||
1295 | MTK_FUNCTION(2, "EINT126"), | ||
1296 | MTK_FUNCTION(5, "PWM1"), | ||
1297 | MTK_FUNCTION(6, "TESTB_OUT15"), | ||
1298 | MTK_FUNCTION(7, "A_FUNC_DIN[29]") | ||
1299 | ), | ||
1300 | MTK_PIN( | ||
1301 | PINCTRL_PIN(116, "DISP_PWM"), | ||
1302 | "V4", "mt8135", | ||
1303 | MTK_EINT_FUNCTION(2, 77), | ||
1304 | MTK_FUNCTION(0, "GPIO116"), | ||
1305 | MTK_FUNCTION(1, "DISP_PWM"), | ||
1306 | MTK_FUNCTION(2, "EINT77"), | ||
1307 | MTK_FUNCTION(3, "LSDI"), | ||
1308 | MTK_FUNCTION(4, "PWM1"), | ||
1309 | MTK_FUNCTION(5, "PWM2"), | ||
1310 | MTK_FUNCTION(7, "PWM3") | ||
1311 | ), | ||
1312 | MTK_PIN( | ||
1313 | PINCTRL_PIN(117, "EINT1"), | ||
1314 | "T6", "mt8135", | ||
1315 | MTK_EINT_FUNCTION(1, 1), | ||
1316 | MTK_FUNCTION(0, "GPIO117"), | ||
1317 | MTK_FUNCTION(1, "EINT1"), | ||
1318 | MTK_FUNCTION(2, "PWM2"), | ||
1319 | MTK_FUNCTION(3, "CLKM1"), | ||
1320 | MTK_FUNCTION(5, "USB_TEST_IO[13]"), | ||
1321 | MTK_FUNCTION(7, "USB_SDA") | ||
1322 | ), | ||
1323 | MTK_PIN( | ||
1324 | PINCTRL_PIN(118, "EINT2"), | ||
1325 | "T4", "mt8135", | ||
1326 | MTK_EINT_FUNCTION(1, 2), | ||
1327 | MTK_FUNCTION(0, "GPIO118"), | ||
1328 | MTK_FUNCTION(1, "EINT2"), | ||
1329 | MTK_FUNCTION(2, "PWM3"), | ||
1330 | MTK_FUNCTION(3, "CLKM2"), | ||
1331 | MTK_FUNCTION(5, "USB_TEST_IO[14]"), | ||
1332 | MTK_FUNCTION(6, "SRCLKENAI2"), | ||
1333 | MTK_FUNCTION(7, "A_FUNC_DIN[30]") | ||
1334 | ), | ||
1335 | MTK_PIN( | ||
1336 | PINCTRL_PIN(119, "EINT3"), | ||
1337 | "R4", "mt8135", | ||
1338 | MTK_EINT_FUNCTION(1, 3), | ||
1339 | MTK_FUNCTION(0, "GPIO119"), | ||
1340 | MTK_FUNCTION(1, "EINT3"), | ||
1341 | MTK_FUNCTION(5, "USB_TEST_IO[15]"), | ||
1342 | MTK_FUNCTION(6, "SRCLKENAI1"), | ||
1343 | MTK_FUNCTION(7, "EXT_26M_CK") | ||
1344 | ), | ||
1345 | MTK_PIN( | ||
1346 | PINCTRL_PIN(120, "EINT4"), | ||
1347 | "R5", "mt8135", | ||
1348 | MTK_EINT_FUNCTION(1, 4), | ||
1349 | MTK_FUNCTION(0, "GPIO120"), | ||
1350 | MTK_FUNCTION(1, "EINT4"), | ||
1351 | MTK_FUNCTION(2, "PWM4"), | ||
1352 | MTK_FUNCTION(5, "USB_DRVVBUS"), | ||
1353 | MTK_FUNCTION(7, "A_FUNC_DIN[31]") | ||
1354 | ), | ||
1355 | MTK_PIN( | ||
1356 | PINCTRL_PIN(121, "DPIDE"), | ||
1357 | NULL, "mt8135", | ||
1358 | MTK_EINT_FUNCTION(2, 100), | ||
1359 | MTK_FUNCTION(0, "GPIO121"), | ||
1360 | MTK_FUNCTION(1, "DPI0_DE"), | ||
1361 | MTK_FUNCTION(2, "EINT100"), | ||
1362 | MTK_FUNCTION(3, "I2SOUT_DAT"), | ||
1363 | MTK_FUNCTION(4, "DAC_DAT_OUT"), | ||
1364 | MTK_FUNCTION(5, "PCM1_DO"), | ||
1365 | MTK_FUNCTION(6, "IRDA_TXD") | ||
1366 | ), | ||
1367 | MTK_PIN( | ||
1368 | PINCTRL_PIN(122, "DPICK"), | ||
1369 | NULL, "mt8135", | ||
1370 | MTK_EINT_FUNCTION(2, 101), | ||
1371 | MTK_FUNCTION(0, "GPIO122"), | ||
1372 | MTK_FUNCTION(1, "DPI0_CK"), | ||
1373 | MTK_FUNCTION(2, "EINT101"), | ||
1374 | MTK_FUNCTION(3, "I2SIN_DAT"), | ||
1375 | MTK_FUNCTION(5, "PCM1_DI"), | ||
1376 | MTK_FUNCTION(6, "IRDA_PDN") | ||
1377 | ), | ||
1378 | MTK_PIN( | ||
1379 | PINCTRL_PIN(123, "DPIG4"), | ||
1380 | NULL, "mt8135", | ||
1381 | MTK_EINT_FUNCTION(2, 114), | ||
1382 | MTK_FUNCTION(0, "GPIO123"), | ||
1383 | MTK_FUNCTION(1, "DPI0_G4"), | ||
1384 | MTK_FUNCTION(2, "EINT114"), | ||
1385 | MTK_FUNCTION(4, "CM2DAT_2X[0]"), | ||
1386 | MTK_FUNCTION(5, "DSP2_ID") | ||
1387 | ), | ||
1388 | MTK_PIN( | ||
1389 | PINCTRL_PIN(124, "DPIG5"), | ||
1390 | NULL, "mt8135", | ||
1391 | MTK_EINT_FUNCTION(2, 115), | ||
1392 | MTK_FUNCTION(0, "GPIO124"), | ||
1393 | MTK_FUNCTION(1, "DPI0_G5"), | ||
1394 | MTK_FUNCTION(2, "EINT115"), | ||
1395 | MTK_FUNCTION(4, "CM2DAT_2X[1]"), | ||
1396 | MTK_FUNCTION(5, "DSP2_ICK") | ||
1397 | ), | ||
1398 | MTK_PIN( | ||
1399 | PINCTRL_PIN(125, "DPIR3"), | ||
1400 | NULL, "mt8135", | ||
1401 | MTK_EINT_FUNCTION(2, 121), | ||
1402 | MTK_FUNCTION(0, "GPIO125"), | ||
1403 | MTK_FUNCTION(1, "DPI0_R3"), | ||
1404 | MTK_FUNCTION(2, "EINT121"), | ||
1405 | MTK_FUNCTION(4, "CM2DAT_2X[7]") | ||
1406 | ), | ||
1407 | MTK_PIN( | ||
1408 | PINCTRL_PIN(126, "DPIG1"), | ||
1409 | NULL, "mt8135", | ||
1410 | MTK_EINT_FUNCTION(2, 111), | ||
1411 | MTK_FUNCTION(0, "GPIO126"), | ||
1412 | MTK_FUNCTION(1, "DPI0_G1"), | ||
1413 | MTK_FUNCTION(2, "EINT111"), | ||
1414 | MTK_FUNCTION(5, "DSP1_ICK") | ||
1415 | ), | ||
1416 | MTK_PIN( | ||
1417 | PINCTRL_PIN(127, "DPIVSYNC"), | ||
1418 | NULL, "mt8135", | ||
1419 | MTK_EINT_FUNCTION(2, 98), | ||
1420 | MTK_FUNCTION(0, "GPIO127"), | ||
1421 | MTK_FUNCTION(1, "DPI0_VSYNC"), | ||
1422 | MTK_FUNCTION(2, "EINT98"), | ||
1423 | MTK_FUNCTION(3, "I2SIN_CK"), | ||
1424 | MTK_FUNCTION(4, "DAC_CK"), | ||
1425 | MTK_FUNCTION(5, "PCM1_CK") | ||
1426 | ), | ||
1427 | MTK_PIN( | ||
1428 | PINCTRL_PIN(128, "DPIHSYNC"), | ||
1429 | NULL, "mt8135", | ||
1430 | MTK_EINT_FUNCTION(2, 99), | ||
1431 | MTK_FUNCTION(0, "GPIO128"), | ||
1432 | MTK_FUNCTION(1, "DPI0_HSYNC"), | ||
1433 | MTK_FUNCTION(2, "EINT99"), | ||
1434 | MTK_FUNCTION(3, "I2SIN_WS"), | ||
1435 | MTK_FUNCTION(4, "DAC_WS"), | ||
1436 | MTK_FUNCTION(5, "PCM1_WS"), | ||
1437 | MTK_FUNCTION(6, "IRDA_RXD") | ||
1438 | ), | ||
1439 | MTK_PIN( | ||
1440 | PINCTRL_PIN(129, "DPIB0"), | ||
1441 | NULL, "mt8135", | ||
1442 | MTK_EINT_FUNCTION(2, 102), | ||
1443 | MTK_FUNCTION(0, "GPIO129"), | ||
1444 | MTK_FUNCTION(1, "DPI0_B0"), | ||
1445 | MTK_FUNCTION(2, "EINT102"), | ||
1446 | MTK_FUNCTION(4, "SCL0"), | ||
1447 | MTK_FUNCTION(5, "DISP_PWM") | ||
1448 | ), | ||
1449 | MTK_PIN( | ||
1450 | PINCTRL_PIN(130, "DPIB1"), | ||
1451 | NULL, "mt8135", | ||
1452 | MTK_EINT_FUNCTION(2, 103), | ||
1453 | MTK_FUNCTION(0, "GPIO130"), | ||
1454 | MTK_FUNCTION(1, "DPI0_B1"), | ||
1455 | MTK_FUNCTION(2, "EINT103"), | ||
1456 | MTK_FUNCTION(3, "CLKM0"), | ||
1457 | MTK_FUNCTION(4, "SDA0"), | ||
1458 | MTK_FUNCTION(5, "PWM1") | ||
1459 | ), | ||
1460 | MTK_PIN( | ||
1461 | PINCTRL_PIN(131, "DPIB2"), | ||
1462 | NULL, "mt8135", | ||
1463 | MTK_EINT_FUNCTION(2, 104), | ||
1464 | MTK_FUNCTION(0, "GPIO131"), | ||
1465 | MTK_FUNCTION(1, "DPI0_B2"), | ||
1466 | MTK_FUNCTION(2, "EINT104"), | ||
1467 | MTK_FUNCTION(3, "CLKM1"), | ||
1468 | MTK_FUNCTION(4, "SCL1"), | ||
1469 | MTK_FUNCTION(5, "PWM2") | ||
1470 | ), | ||
1471 | MTK_PIN( | ||
1472 | PINCTRL_PIN(132, "DPIB3"), | ||
1473 | NULL, "mt8135", | ||
1474 | MTK_EINT_FUNCTION(2, 105), | ||
1475 | MTK_FUNCTION(0, "GPIO132"), | ||
1476 | MTK_FUNCTION(1, "DPI0_B3"), | ||
1477 | MTK_FUNCTION(2, "EINT105"), | ||
1478 | MTK_FUNCTION(3, "CLKM2"), | ||
1479 | MTK_FUNCTION(4, "SDA1"), | ||
1480 | MTK_FUNCTION(5, "PWM3") | ||
1481 | ), | ||
1482 | MTK_PIN( | ||
1483 | PINCTRL_PIN(133, "DPIB4"), | ||
1484 | NULL, "mt8135", | ||
1485 | MTK_EINT_FUNCTION(2, 106), | ||
1486 | MTK_FUNCTION(0, "GPIO133"), | ||
1487 | MTK_FUNCTION(1, "DPI0_B4"), | ||
1488 | MTK_FUNCTION(2, "EINT106"), | ||
1489 | MTK_FUNCTION(3, "CLKM3"), | ||
1490 | MTK_FUNCTION(4, "SCL2"), | ||
1491 | MTK_FUNCTION(5, "PWM4") | ||
1492 | ), | ||
1493 | MTK_PIN( | ||
1494 | PINCTRL_PIN(134, "DPIB5"), | ||
1495 | NULL, "mt8135", | ||
1496 | MTK_EINT_FUNCTION(2, 107), | ||
1497 | MTK_FUNCTION(0, "GPIO134"), | ||
1498 | MTK_FUNCTION(1, "DPI0_B5"), | ||
1499 | MTK_FUNCTION(2, "EINT107"), | ||
1500 | MTK_FUNCTION(3, "CLKM4"), | ||
1501 | MTK_FUNCTION(4, "SDA2"), | ||
1502 | MTK_FUNCTION(5, "PWM5") | ||
1503 | ), | ||
1504 | MTK_PIN( | ||
1505 | PINCTRL_PIN(135, "DPIB6"), | ||
1506 | NULL, "mt8135", | ||
1507 | MTK_EINT_FUNCTION(2, 108), | ||
1508 | MTK_FUNCTION(0, "GPIO135"), | ||
1509 | MTK_FUNCTION(1, "DPI0_B6"), | ||
1510 | MTK_FUNCTION(2, "EINT108"), | ||
1511 | MTK_FUNCTION(3, "CLKM5"), | ||
1512 | MTK_FUNCTION(4, "SCL3"), | ||
1513 | MTK_FUNCTION(5, "PWM6") | ||
1514 | ), | ||
1515 | MTK_PIN( | ||
1516 | PINCTRL_PIN(136, "DPIB7"), | ||
1517 | NULL, "mt8135", | ||
1518 | MTK_EINT_FUNCTION(2, 109), | ||
1519 | MTK_FUNCTION(0, "GPIO136"), | ||
1520 | MTK_FUNCTION(1, "DPI0_B7"), | ||
1521 | MTK_FUNCTION(2, "EINT109"), | ||
1522 | MTK_FUNCTION(3, "CLKM6"), | ||
1523 | MTK_FUNCTION(4, "SDA3"), | ||
1524 | MTK_FUNCTION(5, "PWM7") | ||
1525 | ), | ||
1526 | MTK_PIN( | ||
1527 | PINCTRL_PIN(137, "DPIG0"), | ||
1528 | NULL, "mt8135", | ||
1529 | MTK_EINT_FUNCTION(2, 110), | ||
1530 | MTK_FUNCTION(0, "GPIO137"), | ||
1531 | MTK_FUNCTION(1, "DPI0_G0"), | ||
1532 | MTK_FUNCTION(2, "EINT110"), | ||
1533 | MTK_FUNCTION(5, "DSP1_ID") | ||
1534 | ), | ||
1535 | MTK_PIN( | ||
1536 | PINCTRL_PIN(138, "DPIG2"), | ||
1537 | NULL, "mt8135", | ||
1538 | MTK_EINT_FUNCTION(2, 112), | ||
1539 | MTK_FUNCTION(0, "GPIO138"), | ||
1540 | MTK_FUNCTION(1, "DPI0_G2"), | ||
1541 | MTK_FUNCTION(2, "EINT112"), | ||
1542 | MTK_FUNCTION(5, "DSP1_IMS") | ||
1543 | ), | ||
1544 | MTK_PIN( | ||
1545 | PINCTRL_PIN(139, "DPIG3"), | ||
1546 | NULL, "mt8135", | ||
1547 | MTK_EINT_FUNCTION(2, 113), | ||
1548 | MTK_FUNCTION(0, "GPIO139"), | ||
1549 | MTK_FUNCTION(1, "DPI0_G3"), | ||
1550 | MTK_FUNCTION(2, "EINT113"), | ||
1551 | MTK_FUNCTION(5, "DSP2_IMS") | ||
1552 | ), | ||
1553 | MTK_PIN( | ||
1554 | PINCTRL_PIN(140, "DPIG6"), | ||
1555 | NULL, "mt8135", | ||
1556 | MTK_EINT_FUNCTION(2, 116), | ||
1557 | MTK_FUNCTION(0, "GPIO140"), | ||
1558 | MTK_FUNCTION(1, "DPI0_G6"), | ||
1559 | MTK_FUNCTION(2, "EINT116"), | ||
1560 | MTK_FUNCTION(4, "CM2DAT_2X[2]") | ||
1561 | ), | ||
1562 | MTK_PIN( | ||
1563 | PINCTRL_PIN(141, "DPIG7"), | ||
1564 | NULL, "mt8135", | ||
1565 | MTK_EINT_FUNCTION(2, 117), | ||
1566 | MTK_FUNCTION(0, "GPIO141"), | ||
1567 | MTK_FUNCTION(1, "DPI0_G7"), | ||
1568 | MTK_FUNCTION(2, "EINT117"), | ||
1569 | MTK_FUNCTION(4, "CM2DAT_2X[3]") | ||
1570 | ), | ||
1571 | MTK_PIN( | ||
1572 | PINCTRL_PIN(142, "DPIR0"), | ||
1573 | NULL, "mt8135", | ||
1574 | MTK_EINT_FUNCTION(2, 118), | ||
1575 | MTK_FUNCTION(0, "GPIO142"), | ||
1576 | MTK_FUNCTION(1, "DPI0_R0"), | ||
1577 | MTK_FUNCTION(2, "EINT118"), | ||
1578 | MTK_FUNCTION(4, "CM2DAT_2X[4]") | ||
1579 | ), | ||
1580 | MTK_PIN( | ||
1581 | PINCTRL_PIN(143, "DPIR1"), | ||
1582 | NULL, "mt8135", | ||
1583 | MTK_EINT_FUNCTION(2, 119), | ||
1584 | MTK_FUNCTION(0, "GPIO143"), | ||
1585 | MTK_FUNCTION(1, "DPI0_R1"), | ||
1586 | MTK_FUNCTION(2, "EINT119"), | ||
1587 | MTK_FUNCTION(4, "CM2DAT_2X[5]") | ||
1588 | ), | ||
1589 | MTK_PIN( | ||
1590 | PINCTRL_PIN(144, "DPIR2"), | ||
1591 | NULL, "mt8135", | ||
1592 | MTK_EINT_FUNCTION(2, 120), | ||
1593 | MTK_FUNCTION(0, "GPIO144"), | ||
1594 | MTK_FUNCTION(1, "DPI0_R2"), | ||
1595 | MTK_FUNCTION(2, "EINT120"), | ||
1596 | MTK_FUNCTION(4, "CM2DAT_2X[6]") | ||
1597 | ), | ||
1598 | MTK_PIN( | ||
1599 | PINCTRL_PIN(145, "DPIR4"), | ||
1600 | NULL, "mt8135", | ||
1601 | MTK_EINT_FUNCTION(2, 122), | ||
1602 | MTK_FUNCTION(0, "GPIO145"), | ||
1603 | MTK_FUNCTION(1, "DPI0_R4"), | ||
1604 | MTK_FUNCTION(2, "EINT122"), | ||
1605 | MTK_FUNCTION(4, "CM2DAT_2X[8]") | ||
1606 | ), | ||
1607 | MTK_PIN( | ||
1608 | PINCTRL_PIN(146, "DPIR5"), | ||
1609 | NULL, "mt8135", | ||
1610 | MTK_EINT_FUNCTION(2, 123), | ||
1611 | MTK_FUNCTION(0, "GPIO146"), | ||
1612 | MTK_FUNCTION(1, "DPI0_R5"), | ||
1613 | MTK_FUNCTION(2, "EINT123"), | ||
1614 | MTK_FUNCTION(4, "CM2DAT_2X[9]") | ||
1615 | ), | ||
1616 | MTK_PIN( | ||
1617 | PINCTRL_PIN(147, "DPIR6"), | ||
1618 | NULL, "mt8135", | ||
1619 | MTK_EINT_FUNCTION(2, 124), | ||
1620 | MTK_FUNCTION(0, "GPIO147"), | ||
1621 | MTK_FUNCTION(1, "DPI0_R6"), | ||
1622 | MTK_FUNCTION(2, "EINT124"), | ||
1623 | MTK_FUNCTION(4, "CM2VSYNC_2X") | ||
1624 | ), | ||
1625 | MTK_PIN( | ||
1626 | PINCTRL_PIN(148, "DPIR7"), | ||
1627 | NULL, "mt8135", | ||
1628 | MTK_EINT_FUNCTION(2, 125), | ||
1629 | MTK_FUNCTION(0, "GPIO148"), | ||
1630 | MTK_FUNCTION(1, "DPI0_R7"), | ||
1631 | MTK_FUNCTION(2, "EINT125"), | ||
1632 | MTK_FUNCTION(4, "CM2HSYNC_2X") | ||
1633 | ), | ||
1634 | MTK_PIN( | ||
1635 | PINCTRL_PIN(149, "TDN3/LVDS(TDN3)"), | ||
1636 | "AA2", "mt8135", | ||
1637 | MTK_EINT_FUNCTION(2, 36), | ||
1638 | MTK_FUNCTION(0, "GPIO149"), | ||
1639 | MTK_FUNCTION(2, "EINT36") | ||
1640 | ), | ||
1641 | MTK_PIN( | ||
1642 | PINCTRL_PIN(150, "TDP3/LVDS(TDP3)"), | ||
1643 | "AA1", "mt8135", | ||
1644 | MTK_EINT_FUNCTION(2, 35), | ||
1645 | MTK_FUNCTION(0, "GPIO150"), | ||
1646 | MTK_FUNCTION(2, "EINT35") | ||
1647 | ), | ||
1648 | MTK_PIN( | ||
1649 | PINCTRL_PIN(151, "TDN2/LVDS(TCN)"), | ||
1650 | "Y2", "mt8135", | ||
1651 | MTK_EINT_FUNCTION(2, 169), | ||
1652 | MTK_FUNCTION(0, "GPIO151"), | ||
1653 | MTK_FUNCTION(2, "EINT169") | ||
1654 | ), | ||
1655 | MTK_PIN( | ||
1656 | PINCTRL_PIN(152, "TDP2/LVDS(TCP)"), | ||
1657 | "Y1", "mt8135", | ||
1658 | MTK_EINT_FUNCTION(2, 168), | ||
1659 | MTK_FUNCTION(0, "GPIO152"), | ||
1660 | MTK_FUNCTION(2, "EINT168") | ||
1661 | ), | ||
1662 | MTK_PIN( | ||
1663 | PINCTRL_PIN(153, "TCN/LVDS(TDN2)"), | ||
1664 | "W2", "mt8135", | ||
1665 | MTK_EINT_FUNCTION(2, 163), | ||
1666 | MTK_FUNCTION(0, "GPIO153"), | ||
1667 | MTK_FUNCTION(2, "EINT163") | ||
1668 | ), | ||
1669 | MTK_PIN( | ||
1670 | PINCTRL_PIN(154, "TCP/LVDS(TDP2)"), | ||
1671 | "W1", "mt8135", | ||
1672 | MTK_EINT_FUNCTION(2, 162), | ||
1673 | MTK_FUNCTION(0, "GPIO154"), | ||
1674 | MTK_FUNCTION(2, "EINT162") | ||
1675 | ), | ||
1676 | MTK_PIN( | ||
1677 | PINCTRL_PIN(155, "TDN1/LVDS(TDN1)"), | ||
1678 | "V3", "mt8135", | ||
1679 | MTK_EINT_FUNCTION(2, 167), | ||
1680 | MTK_FUNCTION(0, "GPIO155"), | ||
1681 | MTK_FUNCTION(2, "EINT167") | ||
1682 | ), | ||
1683 | MTK_PIN( | ||
1684 | PINCTRL_PIN(156, "TDP1/LVDS(TDP1)"), | ||
1685 | "V2", "mt8135", | ||
1686 | MTK_EINT_FUNCTION(2, 166), | ||
1687 | MTK_FUNCTION(0, "GPIO156"), | ||
1688 | MTK_FUNCTION(2, "EINT166") | ||
1689 | ), | ||
1690 | MTK_PIN( | ||
1691 | PINCTRL_PIN(157, "TDN0/LVDS(TDN0)"), | ||
1692 | "U3", "mt8135", | ||
1693 | MTK_EINT_FUNCTION(2, 165), | ||
1694 | MTK_FUNCTION(0, "GPIO157"), | ||
1695 | MTK_FUNCTION(2, "EINT165") | ||
1696 | ), | ||
1697 | MTK_PIN( | ||
1698 | PINCTRL_PIN(158, "TDP0/LVDS(TDP0)"), | ||
1699 | "U2", "mt8135", | ||
1700 | MTK_EINT_FUNCTION(2, 164), | ||
1701 | MTK_FUNCTION(0, "GPIO158"), | ||
1702 | MTK_FUNCTION(2, "EINT164") | ||
1703 | ), | ||
1704 | MTK_PIN( | ||
1705 | PINCTRL_PIN(159, "RDN3"), | ||
1706 | "N5", "mt8135", | ||
1707 | MTK_EINT_FUNCTION(2, 18), | ||
1708 | MTK_FUNCTION(0, "GPIO159"), | ||
1709 | MTK_FUNCTION(2, "EINT18") | ||
1710 | ), | ||
1711 | MTK_PIN( | ||
1712 | PINCTRL_PIN(160, "RDP3"), | ||
1713 | "N4", "mt8135", | ||
1714 | MTK_EINT_FUNCTION(2, 30), | ||
1715 | MTK_FUNCTION(0, "GPIO160"), | ||
1716 | MTK_FUNCTION(2, "EINT30") | ||
1717 | ), | ||
1718 | MTK_PIN( | ||
1719 | PINCTRL_PIN(161, "RDN2"), | ||
1720 | "T2", "mt8135", | ||
1721 | MTK_EINT_FUNCTION(2, 31), | ||
1722 | MTK_FUNCTION(0, "GPIO161"), | ||
1723 | MTK_FUNCTION(2, "EINT31") | ||
1724 | ), | ||
1725 | MTK_PIN( | ||
1726 | PINCTRL_PIN(162, "RDP2"), | ||
1727 | "T3", "mt8135", | ||
1728 | MTK_EINT_FUNCTION(2, 32), | ||
1729 | MTK_FUNCTION(0, "GPIO162"), | ||
1730 | MTK_FUNCTION(2, "EINT32") | ||
1731 | ), | ||
1732 | MTK_PIN( | ||
1733 | PINCTRL_PIN(163, "RCN"), | ||
1734 | "P2", "mt8135", | ||
1735 | MTK_EINT_FUNCTION(2, 33), | ||
1736 | MTK_FUNCTION(0, "GPIO163"), | ||
1737 | MTK_FUNCTION(2, "EINT33") | ||
1738 | ), | ||
1739 | MTK_PIN( | ||
1740 | PINCTRL_PIN(164, "RCP"), | ||
1741 | "P3", "mt8135", | ||
1742 | MTK_EINT_FUNCTION(2, 39), | ||
1743 | MTK_FUNCTION(0, "GPIO164"), | ||
1744 | MTK_FUNCTION(2, "EINT39") | ||
1745 | ), | ||
1746 | MTK_PIN( | ||
1747 | PINCTRL_PIN(165, "RDN1"), | ||
1748 | "R3", "mt8135", | ||
1749 | MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT), | ||
1750 | MTK_FUNCTION(0, "GPIO165") | ||
1751 | ), | ||
1752 | MTK_PIN( | ||
1753 | PINCTRL_PIN(166, "RDP1"), | ||
1754 | "R2", "mt8135", | ||
1755 | MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT), | ||
1756 | MTK_FUNCTION(0, "GPIO166") | ||
1757 | ), | ||
1758 | MTK_PIN( | ||
1759 | PINCTRL_PIN(167, "RDN0"), | ||
1760 | "N3", "mt8135", | ||
1761 | MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT), | ||
1762 | MTK_FUNCTION(0, "GPIO167") | ||
1763 | ), | ||
1764 | MTK_PIN( | ||
1765 | PINCTRL_PIN(168, "RDP0"), | ||
1766 | "N2", "mt8135", | ||
1767 | MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT), | ||
1768 | MTK_FUNCTION(0, "GPIO168") | ||
1769 | ), | ||
1770 | MTK_PIN( | ||
1771 | PINCTRL_PIN(169, "RDN1_A"), | ||
1772 | "M4", "mt8135", | ||
1773 | MTK_EINT_FUNCTION(2, 175), | ||
1774 | MTK_FUNCTION(0, "GPIO169"), | ||
1775 | MTK_FUNCTION(1, "CMDAT6"), | ||
1776 | MTK_FUNCTION(2, "EINT175") | ||
1777 | ), | ||
1778 | MTK_PIN( | ||
1779 | PINCTRL_PIN(170, "RDP1_A"), | ||
1780 | "M3", "mt8135", | ||
1781 | MTK_EINT_FUNCTION(2, 174), | ||
1782 | MTK_FUNCTION(0, "GPIO170"), | ||
1783 | MTK_FUNCTION(1, "CMDAT7"), | ||
1784 | MTK_FUNCTION(2, "EINT174") | ||
1785 | ), | ||
1786 | MTK_PIN( | ||
1787 | PINCTRL_PIN(171, "RCN_A"), | ||
1788 | "L3", "mt8135", | ||
1789 | MTK_EINT_FUNCTION(2, 171), | ||
1790 | MTK_FUNCTION(0, "GPIO171"), | ||
1791 | MTK_FUNCTION(1, "CMDAT8"), | ||
1792 | MTK_FUNCTION(2, "EINT171") | ||
1793 | ), | ||
1794 | MTK_PIN( | ||
1795 | PINCTRL_PIN(172, "RCP_A"), | ||
1796 | "L2", "mt8135", | ||
1797 | MTK_EINT_FUNCTION(2, 170), | ||
1798 | MTK_FUNCTION(0, "GPIO172"), | ||
1799 | MTK_FUNCTION(1, "CMDAT9"), | ||
1800 | MTK_FUNCTION(2, "EINT170") | ||
1801 | ), | ||
1802 | MTK_PIN( | ||
1803 | PINCTRL_PIN(173, "RDN0_A"), | ||
1804 | "M2", "mt8135", | ||
1805 | MTK_EINT_FUNCTION(2, 173), | ||
1806 | MTK_FUNCTION(0, "GPIO173"), | ||
1807 | MTK_FUNCTION(1, "CMHSYNC"), | ||
1808 | MTK_FUNCTION(2, "EINT173") | ||
1809 | ), | ||
1810 | MTK_PIN( | ||
1811 | PINCTRL_PIN(174, "RDP0_A"), | ||
1812 | "M1", "mt8135", | ||
1813 | MTK_EINT_FUNCTION(2, 172), | ||
1814 | MTK_FUNCTION(0, "GPIO174"), | ||
1815 | MTK_FUNCTION(1, "CMVSYNC"), | ||
1816 | MTK_FUNCTION(2, "EINT172") | ||
1817 | ), | ||
1818 | MTK_PIN( | ||
1819 | PINCTRL_PIN(175, "RDN1_B"), | ||
1820 | "H2", "mt8135", | ||
1821 | MTK_EINT_FUNCTION(2, 181), | ||
1822 | MTK_FUNCTION(0, "GPIO175"), | ||
1823 | MTK_FUNCTION(1, "CMDAT2"), | ||
1824 | MTK_FUNCTION(2, "EINT181"), | ||
1825 | MTK_FUNCTION(3, "CMCSD2") | ||
1826 | ), | ||
1827 | MTK_PIN( | ||
1828 | PINCTRL_PIN(176, "RDP1_B"), | ||
1829 | "H1", "mt8135", | ||
1830 | MTK_EINT_FUNCTION(2, 180), | ||
1831 | MTK_FUNCTION(0, "GPIO176"), | ||
1832 | MTK_FUNCTION(1, "CMDAT3"), | ||
1833 | MTK_FUNCTION(2, "EINT180"), | ||
1834 | MTK_FUNCTION(3, "CMCSD3") | ||
1835 | ), | ||
1836 | MTK_PIN( | ||
1837 | PINCTRL_PIN(177, "RCN_B"), | ||
1838 | "K3", "mt8135", | ||
1839 | MTK_EINT_FUNCTION(2, 177), | ||
1840 | MTK_FUNCTION(0, "GPIO177"), | ||
1841 | MTK_FUNCTION(1, "CMDAT4"), | ||
1842 | MTK_FUNCTION(2, "EINT177") | ||
1843 | ), | ||
1844 | MTK_PIN( | ||
1845 | PINCTRL_PIN(178, "RCP_B"), | ||
1846 | "K2", "mt8135", | ||
1847 | MTK_EINT_FUNCTION(2, 176), | ||
1848 | MTK_FUNCTION(0, "GPIO178"), | ||
1849 | MTK_FUNCTION(1, "CMDAT5"), | ||
1850 | MTK_FUNCTION(2, "EINT176") | ||
1851 | ), | ||
1852 | MTK_PIN( | ||
1853 | PINCTRL_PIN(179, "RDN0_B"), | ||
1854 | "J3", "mt8135", | ||
1855 | MTK_EINT_FUNCTION(2, 179), | ||
1856 | MTK_FUNCTION(0, "GPIO179"), | ||
1857 | MTK_FUNCTION(1, "CMDAT0"), | ||
1858 | MTK_FUNCTION(2, "EINT179"), | ||
1859 | MTK_FUNCTION(3, "CMCSD0") | ||
1860 | ), | ||
1861 | MTK_PIN( | ||
1862 | PINCTRL_PIN(180, "RDP0_B"), | ||
1863 | "J2", "mt8135", | ||
1864 | MTK_EINT_FUNCTION(2, 178), | ||
1865 | MTK_FUNCTION(0, "GPIO180"), | ||
1866 | MTK_FUNCTION(1, "CMDAT1"), | ||
1867 | MTK_FUNCTION(2, "EINT178"), | ||
1868 | MTK_FUNCTION(3, "CMCSD1") | ||
1869 | ), | ||
1870 | MTK_PIN( | ||
1871 | PINCTRL_PIN(181, "CMPCLK"), | ||
1872 | "K4", "mt8135", | ||
1873 | MTK_EINT_FUNCTION(2, 182), | ||
1874 | MTK_FUNCTION(0, "GPIO181"), | ||
1875 | MTK_FUNCTION(1, "CMPCLK"), | ||
1876 | MTK_FUNCTION(2, "EINT182"), | ||
1877 | MTK_FUNCTION(3, "CMCSK"), | ||
1878 | MTK_FUNCTION(4, "CM2MCLK_4X"), | ||
1879 | MTK_FUNCTION(5, "TS_AUXADC_SEL[3]"), | ||
1880 | MTK_FUNCTION(6, "VENC_TEST_CK"), | ||
1881 | MTK_FUNCTION(7, "TESTA_OUT27") | ||
1882 | ), | ||
1883 | MTK_PIN( | ||
1884 | PINCTRL_PIN(182, "CMMCLK"), | ||
1885 | "J5", "mt8135", | ||
1886 | MTK_EINT_FUNCTION(2, 183), | ||
1887 | MTK_FUNCTION(0, "GPIO182"), | ||
1888 | MTK_FUNCTION(1, "CMMCLK"), | ||
1889 | MTK_FUNCTION(2, "EINT183"), | ||
1890 | MTK_FUNCTION(5, "TS_AUXADC_SEL[2]"), | ||
1891 | MTK_FUNCTION(7, "TESTA_OUT28") | ||
1892 | ), | ||
1893 | MTK_PIN( | ||
1894 | PINCTRL_PIN(183, "CMRST"), | ||
1895 | "J6", "mt8135", | ||
1896 | MTK_EINT_FUNCTION(2, 185), | ||
1897 | MTK_FUNCTION(0, "GPIO183"), | ||
1898 | MTK_FUNCTION(1, "CMRST"), | ||
1899 | MTK_FUNCTION(2, "EINT185"), | ||
1900 | MTK_FUNCTION(5, "TS_AUXADC_SEL[1]"), | ||
1901 | MTK_FUNCTION(7, "TESTA_OUT30") | ||
1902 | ), | ||
1903 | MTK_PIN( | ||
1904 | PINCTRL_PIN(184, "CMPDN"), | ||
1905 | "J4", "mt8135", | ||
1906 | MTK_EINT_FUNCTION(2, 184), | ||
1907 | MTK_FUNCTION(0, "GPIO184"), | ||
1908 | MTK_FUNCTION(1, "CMPDN"), | ||
1909 | MTK_FUNCTION(2, "EINT184"), | ||
1910 | MTK_FUNCTION(5, "TS_AUXADC_SEL[0]"), | ||
1911 | MTK_FUNCTION(7, "TESTA_OUT29") | ||
1912 | ), | ||
1913 | MTK_PIN( | ||
1914 | PINCTRL_PIN(185, "CMFLASH"), | ||
1915 | "G4", "mt8135", | ||
1916 | MTK_EINT_FUNCTION(2, 186), | ||
1917 | MTK_FUNCTION(0, "GPIO185"), | ||
1918 | MTK_FUNCTION(1, "CMFLASH"), | ||
1919 | MTK_FUNCTION(2, "EINT186"), | ||
1920 | MTK_FUNCTION(3, "CM2MCLK_3X"), | ||
1921 | MTK_FUNCTION(6, "MFG_TEST_CK_1"), | ||
1922 | MTK_FUNCTION(7, "TESTA_OUT31") | ||
1923 | ), | ||
1924 | MTK_PIN( | ||
1925 | PINCTRL_PIN(186, "MRG_I2S_PCM_CLK"), | ||
1926 | "F5", "mt8135", | ||
1927 | MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT), | ||
1928 | MTK_FUNCTION(0, "GPIO186"), | ||
1929 | MTK_FUNCTION(1, "MRG_I2S_PCM_CLK"), | ||
1930 | MTK_FUNCTION(3, "I2SIN_CK"), | ||
1931 | MTK_FUNCTION(4, "PCM0_CK"), | ||
1932 | MTK_FUNCTION(5, "DSP2_ICK"), | ||
1933 | MTK_FUNCTION(6, "IMG_TEST_CK"), | ||
1934 | MTK_FUNCTION(7, "USB_SCL") | ||
1935 | ), | ||
1936 | MTK_PIN( | ||
1937 | PINCTRL_PIN(187, "MRG_I2S_PCM_SYNC"), | ||
1938 | "G6", "mt8135", | ||
1939 | MTK_EINT_FUNCTION(2, 16), | ||
1940 | MTK_FUNCTION(0, "GPIO187"), | ||
1941 | MTK_FUNCTION(1, "MRG_I2S_PCM_SYNC"), | ||
1942 | MTK_FUNCTION(2, "EINT16"), | ||
1943 | MTK_FUNCTION(3, "I2SIN_WS"), | ||
1944 | MTK_FUNCTION(4, "PCM0_WS"), | ||
1945 | MTK_FUNCTION(6, "DISP_TEST_CK") | ||
1946 | ), | ||
1947 | MTK_PIN( | ||
1948 | PINCTRL_PIN(188, "MRG_I2S_PCM_RX"), | ||
1949 | "G3", "mt8135", | ||
1950 | MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT), | ||
1951 | MTK_FUNCTION(0, "GPIO188"), | ||
1952 | MTK_FUNCTION(1, "MRG_I2S_PCM_RX"), | ||
1953 | MTK_FUNCTION(3, "I2SIN_DAT"), | ||
1954 | MTK_FUNCTION(4, "PCM0_DI"), | ||
1955 | MTK_FUNCTION(5, "DSP2_ID"), | ||
1956 | MTK_FUNCTION(6, "MFG_TEST_CK"), | ||
1957 | MTK_FUNCTION(7, "USB_SDA") | ||
1958 | ), | ||
1959 | MTK_PIN( | ||
1960 | PINCTRL_PIN(189, "MRG_I2S_PCM_TX"), | ||
1961 | "G5", "mt8135", | ||
1962 | MTK_EINT_FUNCTION(2, 17), | ||
1963 | MTK_FUNCTION(0, "GPIO189"), | ||
1964 | MTK_FUNCTION(1, "MRG_I2S_PCM_TX"), | ||
1965 | MTK_FUNCTION(2, "EINT17"), | ||
1966 | MTK_FUNCTION(3, "I2SOUT_DAT"), | ||
1967 | MTK_FUNCTION(4, "PCM0_DO"), | ||
1968 | MTK_FUNCTION(6, "VDEC_TEST_CK") | ||
1969 | ), | ||
1970 | MTK_PIN( | ||
1971 | PINCTRL_PIN(190, "SRCLKENAI"), | ||
1972 | "K5", "mt8135", | ||
1973 | MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT), | ||
1974 | MTK_FUNCTION(0, "GPIO190"), | ||
1975 | MTK_FUNCTION(1, "SRCLKENAI") | ||
1976 | ), | ||
1977 | MTK_PIN( | ||
1978 | PINCTRL_PIN(191, "URXD3"), | ||
1979 | "C3", "mt8135", | ||
1980 | MTK_EINT_FUNCTION(2, 87), | ||
1981 | MTK_FUNCTION(0, "GPIO191"), | ||
1982 | MTK_FUNCTION(1, "URXD3"), | ||
1983 | MTK_FUNCTION(2, "EINT87"), | ||
1984 | MTK_FUNCTION(3, "UTXD3"), | ||
1985 | MTK_FUNCTION(5, "TS_AUX_ST"), | ||
1986 | MTK_FUNCTION(6, "PWM4") | ||
1987 | ), | ||
1988 | MTK_PIN( | ||
1989 | PINCTRL_PIN(192, "UTXD3"), | ||
1990 | "B2", "mt8135", | ||
1991 | MTK_EINT_FUNCTION(2, 86), | ||
1992 | MTK_FUNCTION(0, "GPIO192"), | ||
1993 | MTK_FUNCTION(1, "UTXD3"), | ||
1994 | MTK_FUNCTION(2, "EINT86"), | ||
1995 | MTK_FUNCTION(3, "URXD3"), | ||
1996 | MTK_FUNCTION(5, "TS_AUX_CS_B"), | ||
1997 | MTK_FUNCTION(6, "PWM3") | ||
1998 | ), | ||
1999 | MTK_PIN( | ||
2000 | PINCTRL_PIN(193, "SDA2"), | ||
2001 | "G2", "mt8135", | ||
2002 | MTK_EINT_FUNCTION(2, 95), | ||
2003 | MTK_FUNCTION(0, "GPIO193"), | ||
2004 | MTK_FUNCTION(1, "SDA2"), | ||
2005 | MTK_FUNCTION(2, "EINT95"), | ||
2006 | MTK_FUNCTION(3, "CLKM5"), | ||
2007 | MTK_FUNCTION(4, "PWM5"), | ||
2008 | MTK_FUNCTION(5, "TS_AUX_PWDB") | ||
2009 | ), | ||
2010 | MTK_PIN( | ||
2011 | PINCTRL_PIN(194, "SCL2"), | ||
2012 | "F4", "mt8135", | ||
2013 | MTK_EINT_FUNCTION(2, 94), | ||
2014 | MTK_FUNCTION(0, "GPIO194"), | ||
2015 | MTK_FUNCTION(1, "SCL2"), | ||
2016 | MTK_FUNCTION(2, "EINT94"), | ||
2017 | MTK_FUNCTION(3, "CLKM4"), | ||
2018 | MTK_FUNCTION(4, "PWM4"), | ||
2019 | MTK_FUNCTION(5, "TS_AUXADC_TEST_CK") | ||
2020 | ), | ||
2021 | MTK_PIN( | ||
2022 | PINCTRL_PIN(195, "SDA1"), | ||
2023 | "F2", "mt8135", | ||
2024 | MTK_EINT_FUNCTION(2, 93), | ||
2025 | MTK_FUNCTION(0, "GPIO195"), | ||
2026 | MTK_FUNCTION(1, "SDA1"), | ||
2027 | MTK_FUNCTION(2, "EINT93"), | ||
2028 | MTK_FUNCTION(3, "CLKM3"), | ||
2029 | MTK_FUNCTION(4, "PWM3"), | ||
2030 | MTK_FUNCTION(5, "TS_AUX_SCLK_PWDB") | ||
2031 | ), | ||
2032 | MTK_PIN( | ||
2033 | PINCTRL_PIN(196, "SCL1"), | ||
2034 | "F3", "mt8135", | ||
2035 | MTK_EINT_FUNCTION(2, 92), | ||
2036 | MTK_FUNCTION(0, "GPIO196"), | ||
2037 | MTK_FUNCTION(1, "SCL1"), | ||
2038 | MTK_FUNCTION(2, "EINT92"), | ||
2039 | MTK_FUNCTION(3, "CLKM2"), | ||
2040 | MTK_FUNCTION(4, "PWM2"), | ||
2041 | MTK_FUNCTION(5, "TS_AUX_DIN") | ||
2042 | ), | ||
2043 | MTK_PIN( | ||
2044 | PINCTRL_PIN(197, "MSDC3_DAT2"), | ||
2045 | "E1", "mt8135", | ||
2046 | MTK_EINT_FUNCTION(2, 71), | ||
2047 | MTK_FUNCTION(0, "GPIO197"), | ||
2048 | MTK_FUNCTION(1, "MSDC3_DAT2"), | ||
2049 | MTK_FUNCTION(2, "EINT71"), | ||
2050 | MTK_FUNCTION(3, "SCL6"), | ||
2051 | MTK_FUNCTION(4, "PWM5"), | ||
2052 | MTK_FUNCTION(5, "CLKM4"), | ||
2053 | MTK_FUNCTION(6, "MFG_TEST_CK_2") | ||
2054 | ), | ||
2055 | MTK_PIN( | ||
2056 | PINCTRL_PIN(198, "MSDC3_DAT3"), | ||
2057 | "C2", "mt8135", | ||
2058 | MTK_EINT_FUNCTION(2, 72), | ||
2059 | MTK_FUNCTION(0, "GPIO198"), | ||
2060 | MTK_FUNCTION(1, "MSDC3_DAT3"), | ||
2061 | MTK_FUNCTION(2, "EINT72"), | ||
2062 | MTK_FUNCTION(3, "SDA6"), | ||
2063 | MTK_FUNCTION(4, "PWM6"), | ||
2064 | MTK_FUNCTION(5, "CLKM5"), | ||
2065 | MTK_FUNCTION(6, "MFG_TEST_CK_3") | ||
2066 | ), | ||
2067 | MTK_PIN( | ||
2068 | PINCTRL_PIN(199, "MSDC3_CMD"), | ||
2069 | "D2", "mt8135", | ||
2070 | MTK_EINT_FUNCTION(2, 68), | ||
2071 | MTK_FUNCTION(0, "GPIO199"), | ||
2072 | MTK_FUNCTION(1, "MSDC3_CMD"), | ||
2073 | MTK_FUNCTION(2, "EINT68"), | ||
2074 | MTK_FUNCTION(3, "SDA2"), | ||
2075 | MTK_FUNCTION(4, "PWM2"), | ||
2076 | MTK_FUNCTION(5, "CLKM1"), | ||
2077 | MTK_FUNCTION(6, "MFG_TEST_CK_4") | ||
2078 | ), | ||
2079 | MTK_PIN( | ||
2080 | PINCTRL_PIN(200, "MSDC3_CLK"), | ||
2081 | "E2", "mt8135", | ||
2082 | MTK_EINT_FUNCTION(2, 67), | ||
2083 | MTK_FUNCTION(0, "GPIO200"), | ||
2084 | MTK_FUNCTION(1, "MSDC3_CLK"), | ||
2085 | MTK_FUNCTION(2, "EINT67"), | ||
2086 | MTK_FUNCTION(3, "SCL2"), | ||
2087 | MTK_FUNCTION(4, "PWM1"), | ||
2088 | MTK_FUNCTION(5, "CLKM0") | ||
2089 | ), | ||
2090 | MTK_PIN( | ||
2091 | PINCTRL_PIN(201, "MSDC3_DAT1"), | ||
2092 | "D3", "mt8135", | ||
2093 | MTK_EINT_FUNCTION(2, 70), | ||
2094 | MTK_FUNCTION(0, "GPIO201"), | ||
2095 | MTK_FUNCTION(1, "MSDC3_DAT1"), | ||
2096 | MTK_FUNCTION(2, "EINT70"), | ||
2097 | MTK_FUNCTION(3, "SDA3"), | ||
2098 | MTK_FUNCTION(4, "PWM4"), | ||
2099 | MTK_FUNCTION(5, "CLKM3") | ||
2100 | ), | ||
2101 | MTK_PIN( | ||
2102 | PINCTRL_PIN(202, "MSDC3_DAT0"), | ||
2103 | "E3", "mt8135", | ||
2104 | MTK_EINT_FUNCTION(2, 69), | ||
2105 | MTK_FUNCTION(0, "GPIO202"), | ||
2106 | MTK_FUNCTION(1, "MSDC3_DAT0"), | ||
2107 | MTK_FUNCTION(2, "EINT69"), | ||
2108 | MTK_FUNCTION(3, "SCL3"), | ||
2109 | MTK_FUNCTION(4, "PWM3"), | ||
2110 | MTK_FUNCTION(5, "CLKM2") | ||
2111 | ), | ||
2112 | }; | ||
2113 | |||
2114 | #endif /* __PINCTRL_MTK_MT8135_H */ | ||
diff --git a/include/dt-bindings/pinctrl/mt65xx.h b/include/dt-bindings/pinctrl/mt65xx.h new file mode 100644 index 000000000000..1198f4541327 --- /dev/null +++ b/include/dt-bindings/pinctrl/mt65xx.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014 MediaTek Inc. | ||
3 | * Author: Hongzhou.Yang <hongzhou.yang@mediatek.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef _DT_BINDINGS_PINCTRL_MT65XX_H | ||
16 | #define _DT_BINDINGS_PINCTRL_MT65XX_H | ||
17 | |||
18 | #define MTK_PIN_NO(x) ((x) << 8) | ||
19 | #define MTK_GET_PIN_NO(x) ((x) >> 8) | ||
20 | #define MTK_GET_PIN_FUNC(x) ((x) & 0xf) | ||
21 | |||
22 | #define MTK_PUPD_SET_R1R0_00 100 | ||
23 | #define MTK_PUPD_SET_R1R0_01 101 | ||
24 | #define MTK_PUPD_SET_R1R0_10 102 | ||
25 | #define MTK_PUPD_SET_R1R0_11 103 | ||
26 | |||
27 | #define MTK_DRIVE_2mA 2 | ||
28 | #define MTK_DRIVE_4mA 4 | ||
29 | #define MTK_DRIVE_6mA 6 | ||
30 | #define MTK_DRIVE_8mA 8 | ||
31 | #define MTK_DRIVE_10mA 10 | ||
32 | #define MTK_DRIVE_12mA 12 | ||
33 | #define MTK_DRIVE_14mA 14 | ||
34 | #define MTK_DRIVE_16mA 16 | ||
35 | #define MTK_DRIVE_20mA 20 | ||
36 | #define MTK_DRIVE_24mA 24 | ||
37 | #define MTK_DRIVE_28mA 28 | ||
38 | #define MTK_DRIVE_32mA 32 | ||
39 | |||
40 | #endif /* _DT_BINDINGS_PINCTRL_MT65XX_H */ | ||