1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (C) 2019 MediaTek Inc.
4  * Author: Zhiyong Tao <zhiyong.tao@mediatek.com>
5  *
6  */
7 
8 #include <linux/module.h>
9 #include "pinctrl-mtk-mt8192.h"
10 #include "pinctrl-paris.h"
11 
12 /* MT8192 have multiple bases to program pin configuration listed as the below:
13  * iocfg0:0x10005000, iocfg_rm:0x11C20000, iocfg_bm:0x11D10000,
14  * iocfg_bl:0x11D30000, iocfg_br:0x11D40000, iocfg_lm:0x11E20000,
15  * iocfg_lb:0x11E70000, iocfg_rt:0x11EA0000, iocfg_lt:0x11F20000,
16  * iocfg_tl:0x11F30000
17  * _i_based could be used to indicate what base the pin should be mapped into.
18  */
19 
20 #define PIN_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \
21 	PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, \
22 		       32, 0)
23 
24 #define PINS_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \
25 	PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits,  \
26 		       32, 1)
27 
28 static const struct mtk_pin_field_calc mt8192_pin_mode_range[] = {
29 	PIN_FIELD(0, 228, 0x300, 0x10, 0, 4),
30 };
31 
32 static const struct mtk_pin_field_calc mt8192_pin_dir_range[] = {
33 	PIN_FIELD(0, 228, 0x0, 0x10, 0, 1),
34 };
35 
36 static const struct mtk_pin_field_calc mt8192_pin_di_range[] = {
37 	PIN_FIELD(0, 228, 0x200, 0x10, 0, 1),
38 };
39 
40 static const struct mtk_pin_field_calc mt8192_pin_do_range[] = {
41 	PIN_FIELD(0, 228, 0x100, 0x10, 0, 1),
42 };
43 
44 static const struct mtk_pin_field_calc mt8192_pin_smt_range[] = {
45 	PIN_FIELD_BASE(0, 0, 4, 0x00f0, 0x10, 8, 1),
46 	PIN_FIELD_BASE(1, 1, 4, 0x00f0, 0x10, 8, 1),
47 	PIN_FIELD_BASE(2, 2, 4, 0x00f0, 0x10, 8, 1),
48 	PIN_FIELD_BASE(3, 3, 4, 0x00f0, 0x10, 8, 1),
49 	PIN_FIELD_BASE(4, 4, 4, 0x00f0, 0x10, 8, 1),
50 	PIN_FIELD_BASE(5, 5, 4, 0x00f0, 0x10, 9, 1),
51 	PIN_FIELD_BASE(6, 6, 4, 0x00f0, 0x10, 9, 1),
52 	PIN_FIELD_BASE(7, 7, 4, 0x00f0, 0x10, 9, 1),
53 	PIN_FIELD_BASE(8, 8, 4, 0x00f0, 0x10, 9, 1),
54 	PIN_FIELD_BASE(9, 9, 4, 0x00f0, 0x10, 5, 1),
55 	PIN_FIELD_BASE(10, 10, 6, 0x0070, 0x10, 0, 1),
56 	PIN_FIELD_BASE(11, 11, 6, 0x0070, 0x10, 1, 1),
57 	PIN_FIELD_BASE(12, 12, 6, 0x0070, 0x10, 2, 1),
58 	PIN_FIELD_BASE(13, 13, 6, 0x0070, 0x10, 3, 1),
59 	PIN_FIELD_BASE(14, 14, 6, 0x0070, 0x10, 4, 1),
60 	PIN_FIELD_BASE(15, 15, 6, 0x0070, 0x10, 5, 1),
61 	PIN_FIELD_BASE(16, 16, 8, 0x0080, 0x10, 0, 1),
62 	PIN_FIELD_BASE(17, 17, 8, 0x0080, 0x10, 0, 1),
63 	PIN_FIELD_BASE(18, 18, 7, 0x0100, 0x10, 4, 1),
64 	PIN_FIELD_BASE(19, 19, 7, 0x0100, 0x10, 4, 1),
65 	PIN_FIELD_BASE(20, 20, 7, 0x0100, 0x10, 5, 1),
66 	PIN_FIELD_BASE(21, 21, 7, 0x0100, 0x10, 5, 1),
67 	PIN_FIELD_BASE(22, 22, 2, 0x00c0, 0x10, 3, 1),
68 	PIN_FIELD_BASE(23, 23, 2, 0x00c0, 0x10, 3, 1),
69 	PIN_FIELD_BASE(24, 24, 2, 0x00c0, 0x10, 3, 1),
70 	PIN_FIELD_BASE(25, 25, 2, 0x00c0, 0x10, 3, 1),
71 	PIN_FIELD_BASE(26, 26, 3, 0x00a0, 0x10, 10, 1),
72 	PIN_FIELD_BASE(27, 27, 3, 0x00a0, 0x10, 10, 1),
73 	PIN_FIELD_BASE(28, 28, 3, 0x00a0, 0x10, 11, 1),
74 	PIN_FIELD_BASE(29, 29, 3, 0x00a0, 0x10, 11, 1),
75 	PIN_FIELD_BASE(30, 30, 3, 0x00a0, 0x10, 11, 1),
76 	PIN_FIELD_BASE(31, 31, 3, 0x00a0, 0x10, 11, 1),
77 	PIN_FIELD_BASE(32, 32, 3, 0x00a0, 0x10, 12, 1),
78 	PIN_FIELD_BASE(33, 33, 3, 0x00a0, 0x10, 12, 1),
79 	PIN_FIELD_BASE(34, 34, 3, 0x00a0, 0x10, 12, 1),
80 	PIN_FIELD_BASE(35, 35, 3, 0x00a0, 0x10, 12, 1),
81 	PIN_FIELD_BASE(36, 36, 2, 0x00c0, 0x10, 2, 1),
82 	PIN_FIELD_BASE(37, 37, 2, 0x00c0, 0x10, 2, 1),
83 	PIN_FIELD_BASE(38, 38, 2, 0x00c0, 0x10, 2, 1),
84 	PIN_FIELD_BASE(39, 39, 2, 0x00c0, 0x10, 2, 1),
85 	PIN_FIELD_BASE(40, 40, 8, 0x0080, 0x10, 0, 1),
86 	PIN_FIELD_BASE(41, 41, 8, 0x0080, 0x10, 0, 1),
87 	PIN_FIELD_BASE(42, 42, 8, 0x0080, 0x10, 1, 1),
88 	PIN_FIELD_BASE(43, 43, 7, 0x0100, 0x10, 4, 1),
89 	PIN_FIELD_BASE(44, 44, 7, 0x0100, 0x10, 4, 1),
90 	PIN_FIELD_BASE(45, 45, 1, 0x00c0, 0x10, 12, 1),
91 	PIN_FIELD_BASE(46, 46, 1, 0x00c0, 0x10, 12, 1),
92 	PIN_FIELD_BASE(47, 47, 1, 0x00c0, 0x10, 12, 1),
93 	PIN_FIELD_BASE(48, 48, 1, 0x00c0, 0x10, 13, 1),
94 	PIN_FIELD_BASE(49, 49, 1, 0x00c0, 0x10, 13, 1),
95 	PIN_FIELD_BASE(50, 50, 1, 0x00c0, 0x10, 13, 1),
96 	PIN_FIELD_BASE(51, 51, 1, 0x00c0, 0x10, 4, 1),
97 	PIN_FIELD_BASE(52, 52, 1, 0x00c0, 0x10, 5, 1),
98 	PIN_FIELD_BASE(53, 53, 1, 0x00c0, 0x10, 9, 1),
99 	PIN_FIELD_BASE(54, 54, 1, 0x00c0, 0x10, 6, 1),
100 	PIN_FIELD_BASE(55, 55, 1, 0x00c0, 0x10, 8, 1),
101 	PIN_FIELD_BASE(56, 56, 1, 0x00c0, 0x10, 7, 1),
102 	PIN_FIELD_BASE(57, 57, 3, 0x00a0, 0x10, 8, 1),
103 	PIN_FIELD_BASE(58, 58, 3, 0x00a0, 0x10, 8, 1),
104 	PIN_FIELD_BASE(59, 59, 3, 0x00a0, 0x10, 9, 1),
105 	PIN_FIELD_BASE(60, 60, 3, 0x00a0, 0x10, 9, 1),
106 	PIN_FIELD_BASE(61, 61, 3, 0x00a0, 0x10, 10, 1),
107 	PIN_FIELD_BASE(62, 62, 3, 0x00a0, 0x10, 10, 1),
108 	PIN_FIELD_BASE(63, 63, 3, 0x00a0, 0x10, 0, 1),
109 	PIN_FIELD_BASE(64, 64, 3, 0x00a0, 0x10, 0, 1),
110 	PIN_FIELD_BASE(65, 65, 3, 0x00a0, 0x10, 0, 1),
111 	PIN_FIELD_BASE(66, 66, 3, 0x00a0, 0x10, 0, 1),
112 	PIN_FIELD_BASE(67, 67, 3, 0x00a0, 0x10, 1, 1),
113 	PIN_FIELD_BASE(68, 68, 3, 0x00a0, 0x10, 1, 1),
114 	PIN_FIELD_BASE(69, 69, 3, 0x00a0, 0x10, 1, 1),
115 	PIN_FIELD_BASE(70, 70, 3, 0x00a0, 0x10, 1, 1),
116 	PIN_FIELD_BASE(71, 71, 3, 0x00a0, 0x10, 2, 1),
117 	PIN_FIELD_BASE(72, 72, 3, 0x00a0, 0x10, 2, 1),
118 	PIN_FIELD_BASE(73, 73, 3, 0x00a0, 0x10, 2, 1),
119 	PIN_FIELD_BASE(74, 74, 3, 0x00a0, 0x10, 2, 1),
120 	PIN_FIELD_BASE(75, 75, 3, 0x00a0, 0x10, 3, 1),
121 	PIN_FIELD_BASE(76, 76, 3, 0x00a0, 0x10, 3, 1),
122 	PIN_FIELD_BASE(77, 77, 3, 0x00a0, 0x10, 3, 1),
123 	PIN_FIELD_BASE(78, 78, 3, 0x00a0, 0x10, 3, 1),
124 	PIN_FIELD_BASE(79, 79, 3, 0x00a0, 0x10, 4, 1),
125 	PIN_FIELD_BASE(80, 80, 3, 0x00a0, 0x10, 4, 1),
126 	PIN_FIELD_BASE(81, 81, 3, 0x00a0, 0x10, 4, 1),
127 	PIN_FIELD_BASE(82, 82, 3, 0x00a0, 0x10, 4, 1),
128 	PIN_FIELD_BASE(83, 83, 3, 0x00a0, 0x10, 5, 1),
129 	PIN_FIELD_BASE(84, 84, 3, 0x00a0, 0x10, 5, 1),
130 	PIN_FIELD_BASE(85, 85, 3, 0x00a0, 0x10, 7, 1),
131 	PIN_FIELD_BASE(86, 86, 3, 0x00a0, 0x10, 7, 1),
132 	PIN_FIELD_BASE(87, 87, 3, 0x00a0, 0x10, 6, 1),
133 	PIN_FIELD_BASE(88, 88, 3, 0x00a0, 0x10, 6, 1),
134 	PIN_FIELD_BASE(89, 89, 2, 0x00c0, 0x10, 9, 1),
135 	PIN_FIELD_BASE(90, 90, 2, 0x00c0, 0x10, 10, 1),
136 	PIN_FIELD_BASE(91, 91, 2, 0x00c0, 0x10, 4, 1),
137 	PIN_FIELD_BASE(92, 92, 2, 0x00c0, 0x10, 4, 1),
138 	PIN_FIELD_BASE(93, 93, 2, 0x00c0, 0x10, 4, 1),
139 	PIN_FIELD_BASE(94, 94, 2, 0x00c0, 0x10, 4, 1),
140 	PIN_FIELD_BASE(95, 95, 2, 0x00c0, 0x10, 5, 1),
141 	PIN_FIELD_BASE(96, 96, 2, 0x00c0, 0x10, 5, 1),
142 	PIN_FIELD_BASE(97, 97, 2, 0x00c0, 0x10, 5, 1),
143 	PIN_FIELD_BASE(98, 98, 2, 0x00c0, 0x10, 5, 1),
144 	PIN_FIELD_BASE(99, 99, 2, 0x00c0, 0x10, 6, 1),
145 	PIN_FIELD_BASE(100, 100, 2, 0x00c0, 0x10, 6, 1),
146 	PIN_FIELD_BASE(101, 101, 2, 0x00c0, 0x10, 6, 1),
147 	PIN_FIELD_BASE(102, 102, 2, 0x00c0, 0x10, 6, 1),
148 	PIN_FIELD_BASE(103, 103, 2, 0x00c0, 0x10, 7, 1),
149 	PIN_FIELD_BASE(104, 104, 2, 0x00c0, 0x10, 7, 1),
150 	PIN_FIELD_BASE(105, 105, 2, 0x00c0, 0x10, 7, 1),
151 	PIN_FIELD_BASE(106, 106, 2, 0x00c0, 0x10, 7, 1),
152 	PIN_FIELD_BASE(107, 107, 2, 0x00c0, 0x10, 8, 1),
153 	PIN_FIELD_BASE(108, 108, 2, 0x00c0, 0x10, 8, 1),
154 	PIN_FIELD_BASE(109, 109, 2, 0x00c0, 0x10, 0, 1),
155 	PIN_FIELD_BASE(110, 110, 2, 0x00c0, 0x10, 8, 1),
156 	PIN_FIELD_BASE(111, 111, 2, 0x00c0, 0x10, 0, 1),
157 	PIN_FIELD_BASE(112, 112, 2, 0x00c0, 0x10, 0, 1),
158 	PIN_FIELD_BASE(113, 113, 2, 0x00c0, 0x10, 8, 1),
159 	PIN_FIELD_BASE(114, 114, 2, 0x00c0, 0x10, 1, 1),
160 	PIN_FIELD_BASE(115, 115, 2, 0x00c0, 0x10, 1, 1),
161 	PIN_FIELD_BASE(116, 116, 2, 0x00c0, 0x10, 1, 1),
162 	PIN_FIELD_BASE(117, 117, 2, 0x00c0, 0x10, 0, 1),
163 	PIN_FIELD_BASE(118, 118, 4, 0x00f0, 0x10, 12, 1),
164 	PIN_FIELD_BASE(119, 119, 4, 0x00f0, 0x10, 18, 1),
165 	PIN_FIELD_BASE(120, 120, 4, 0x00f0, 0x10, 17, 1),
166 	PIN_FIELD_BASE(121, 121, 4, 0x00f0, 0x10, 23, 1),
167 	PIN_FIELD_BASE(122, 122, 4, 0x00f0, 0x10, 16, 1),
168 	PIN_FIELD_BASE(123, 123, 4, 0x00f0, 0x10, 22, 1),
169 	PIN_FIELD_BASE(124, 124, 4, 0x00f0, 0x10, 15, 1),
170 	PIN_FIELD_BASE(125, 125, 4, 0x00f0, 0x10, 21, 1),
171 	PIN_FIELD_BASE(126, 126, 4, 0x00f0, 0x10, 6, 1),
172 	PIN_FIELD_BASE(127, 127, 4, 0x00f0, 0x10, 7, 1),
173 	PIN_FIELD_BASE(128, 128, 4, 0x00f0, 0x10, 10, 1),
174 	PIN_FIELD_BASE(129, 129, 4, 0x00f0, 0x10, 10, 1),
175 	PIN_FIELD_BASE(130, 130, 4, 0x00f0, 0x10, 3, 1),
176 	PIN_FIELD_BASE(131, 131, 4, 0x00f0, 0x10, 4, 1),
177 	PIN_FIELD_BASE(132, 132, 4, 0x00f0, 0x10, 11, 1),
178 	PIN_FIELD_BASE(133, 133, 4, 0x00f0, 0x10, 10, 1),
179 	PIN_FIELD_BASE(134, 134, 4, 0x00f0, 0x10, 10, 1),
180 	PIN_FIELD_BASE(135, 135, 4, 0x00f0, 0x10, 11, 1),
181 	PIN_FIELD_BASE(136, 136, 4, 0x00f0, 0x10, 0, 1),
182 	PIN_FIELD_BASE(137, 137, 4, 0x00f0, 0x10, 1, 1),
183 	PIN_FIELD_BASE(138, 138, 4, 0x00f0, 0x10, 2, 1),
184 	PIN_FIELD_BASE(139, 139, 4, 0x00f0, 0x10, 14, 1),
185 	PIN_FIELD_BASE(140, 140, 4, 0x00f0, 0x10, 20, 1),
186 	PIN_FIELD_BASE(141, 141, 4, 0x00f0, 0x10, 13, 1),
187 	PIN_FIELD_BASE(142, 142, 4, 0x00f0, 0x10, 19, 1),
188 	PIN_FIELD_BASE(143, 143, 1, 0x00c0, 0x10, 10, 1),
189 	PIN_FIELD_BASE(144, 144, 1, 0x00c0, 0x10, 10, 1),
190 	PIN_FIELD_BASE(145, 145, 1, 0x00c0, 0x10, 11, 1),
191 	PIN_FIELD_BASE(146, 146, 1, 0x00c0, 0x10, 10, 1),
192 	PIN_FIELD_BASE(147, 147, 1, 0x00c0, 0x10, 10, 1),
193 	PIN_FIELD_BASE(148, 148, 1, 0x00c0, 0x10, 3, 1),
194 	PIN_FIELD_BASE(149, 149, 1, 0x00c0, 0x10, 0, 1),
195 	PIN_FIELD_BASE(150, 150, 1, 0x00c0, 0x10, 1, 1),
196 	PIN_FIELD_BASE(151, 151, 1, 0x00c0, 0x10, 2, 1),
197 	PIN_FIELD_BASE(152, 152, 7, 0x0100, 0x10, 6, 1),
198 	PIN_FIELD_BASE(153, 153, 7, 0x0100, 0x10, 6, 1),
199 	PIN_FIELD_BASE(154, 154, 7, 0x0100, 0x10, 6, 1),
200 	PIN_FIELD_BASE(155, 155, 7, 0x0100, 0x10, 6, 1),
201 	PIN_FIELD_BASE(156, 156, 7, 0x0100, 0x10, 7, 1),
202 	PIN_FIELD_BASE(157, 157, 7, 0x0100, 0x10, 7, 1),
203 	PIN_FIELD_BASE(158, 158, 7, 0x0100, 0x10, 7, 1),
204 	PIN_FIELD_BASE(159, 159, 7, 0x0100, 0x10, 7, 1),
205 	PIN_FIELD_BASE(160, 160, 7, 0x0100, 0x10, 12, 1),
206 	PIN_FIELD_BASE(161, 161, 7, 0x0100, 0x10, 13, 1),
207 	PIN_FIELD_BASE(162, 162, 7, 0x0100, 0x10, 0, 1),
208 	PIN_FIELD_BASE(163, 163, 7, 0x0100, 0x10, 1, 1),
209 	PIN_FIELD_BASE(164, 164, 7, 0x0100, 0x10, 8, 1),
210 	PIN_FIELD_BASE(165, 165, 7, 0x0100, 0x10, 8, 1),
211 	PIN_FIELD_BASE(166, 166, 7, 0x0100, 0x10, 8, 1),
212 	PIN_FIELD_BASE(167, 167, 7, 0x0100, 0x10, 8, 1),
213 	PIN_FIELD_BASE(168, 168, 7, 0x0100, 0x10, 2, 1),
214 	PIN_FIELD_BASE(169, 169, 7, 0x0100, 0x10, 3, 1),
215 	PIN_FIELD_BASE(170, 170, 7, 0x0100, 0x10, 8, 1),
216 	PIN_FIELD_BASE(171, 171, 7, 0x0100, 0x10, 8, 1),
217 	PIN_FIELD_BASE(172, 172, 7, 0x0100, 0x10, 9, 1),
218 	PIN_FIELD_BASE(173, 173, 7, 0x0100, 0x10, 10, 1),
219 	PIN_FIELD_BASE(174, 174, 7, 0x0100, 0x10, 9, 1),
220 	PIN_FIELD_BASE(175, 175, 7, 0x0100, 0x10, 10, 1),
221 	PIN_FIELD_BASE(176, 176, 7, 0x0100, 0x10, 9, 1),
222 	PIN_FIELD_BASE(177, 177, 7, 0x0100, 0x10, 9, 1),
223 	PIN_FIELD_BASE(178, 178, 7, 0x0100, 0x10, 10, 1),
224 	PIN_FIELD_BASE(179, 179, 7, 0x0100, 0x10, 10, 1),
225 	PIN_FIELD_BASE(180, 180, 7, 0x0100, 0x10, 11, 1),
226 	PIN_FIELD_BASE(181, 181, 7, 0x0100, 0x10, 11, 1),
227 	PIN_FIELD_BASE(182, 182, 7, 0x0100, 0x10, 11, 1),
228 	PIN_FIELD_BASE(183, 183, 9, 0x0090, 0x10, 1, 1),
229 	PIN_FIELD_BASE(184, 184, 9, 0x0090, 0x10, 2, 1),
230 	PIN_FIELD_BASE(185, 185, 9, 0x0090, 0x10, 4, 1),
231 	PIN_FIELD_BASE(186, 186, 9, 0x0090, 0x10, 6, 1),
232 	PIN_FIELD_BASE(187, 187, 9, 0x0090, 0x10, 8, 1),
233 	PIN_FIELD_BASE(188, 188, 9, 0x0090, 0x10, 3, 1),
234 	PIN_FIELD_BASE(189, 189, 9, 0x0090, 0x10, 7, 1),
235 	PIN_FIELD_BASE(190, 190, 9, 0x0090, 0x10, 9, 1),
236 	PIN_FIELD_BASE(191, 191, 9, 0x0090, 0x10, 10, 1),
237 	PIN_FIELD_BASE(192, 192, 9, 0x0090, 0x10, 0, 1),
238 	PIN_FIELD_BASE(193, 193, 9, 0x0090, 0x10, 5, 1),
239 	PIN_FIELD_BASE(194, 194, 9, 0x0090, 0x10, 11, 1),
240 	PIN_FIELD_BASE(195, 195, 5, 0x0080, 0x10, 1, 1),
241 	PIN_FIELD_BASE(196, 196, 5, 0x0080, 0x10, 3, 1),
242 	PIN_FIELD_BASE(197, 197, 5, 0x0080, 0x10, 3, 1),
243 	PIN_FIELD_BASE(198, 198, 5, 0x0080, 0x10, 3, 1),
244 	PIN_FIELD_BASE(199, 199, 5, 0x0080, 0x10, 4, 1),
245 	PIN_FIELD_BASE(200, 200, 8, 0x0080, 0x10, 3, 1),
246 	PIN_FIELD_BASE(201, 201, 8, 0x0080, 0x10, 5, 1),
247 	PIN_FIELD_BASE(202, 202, 5, 0x0080, 0x10, 5, 1),
248 	PIN_FIELD_BASE(203, 203, 5, 0x0080, 0x10, 6, 1),
249 	PIN_FIELD_BASE(204, 204, 8, 0x0080, 0x10, 2, 1),
250 	PIN_FIELD_BASE(205, 205, 8, 0x0080, 0x10, 4, 1),
251 	PIN_FIELD_BASE(206, 206, 5, 0x0080, 0x10, 1, 1),
252 	PIN_FIELD_BASE(207, 207, 5, 0x0080, 0x10, 1, 1),
253 	PIN_FIELD_BASE(208, 208, 5, 0x0080, 0x10, 7, 1),
254 	PIN_FIELD_BASE(209, 209, 5, 0x0080, 0x10, 0, 1),
255 	PIN_FIELD_BASE(210, 210, 5, 0x0080, 0x10, 0, 1),
256 	PIN_FIELD_BASE(211, 211, 5, 0x0080, 0x10, 0, 1),
257 	PIN_FIELD_BASE(212, 212, 5, 0x0080, 0x10, 0, 1),
258 	PIN_FIELD_BASE(213, 213, 5, 0x0080, 0x10, 1, 1),
259 	PIN_FIELD_BASE(214, 214, 5, 0x0080, 0x10, 2, 1),
260 	PIN_FIELD_BASE(215, 215, 5, 0x0080, 0x10, 2, 1),
261 	PIN_FIELD_BASE(216, 216, 5, 0x0080, 0x10, 2, 1),
262 	PIN_FIELD_BASE(217, 217, 5, 0x0080, 0x10, 2, 1),
263 	PIN_FIELD_BASE(218, 218, 5, 0x0080, 0x10, 3, 1),
264 	PIN_FIELD_BASE(219, 219, 5, 0x0080, 0x10, 4, 1),
265 };
266 
267 static const struct mtk_pin_field_calc mt8192_pin_ies_range[] = {
268 	PIN_FIELD_BASE(0, 0, 4, 0x0070, 0x10, 9, 1),
269 	PIN_FIELD_BASE(1, 1, 4, 0x0070, 0x10, 10, 1),
270 	PIN_FIELD_BASE(2, 2, 4, 0x0070, 0x10, 11, 1),
271 	PIN_FIELD_BASE(3, 3, 4, 0x0070, 0x10, 12, 1),
272 	PIN_FIELD_BASE(4, 4, 4, 0x0070, 0x10, 13, 1),
273 	PIN_FIELD_BASE(5, 5, 4, 0x0070, 0x10, 14, 1),
274 	PIN_FIELD_BASE(6, 6, 4, 0x0070, 0x10, 15, 1),
275 	PIN_FIELD_BASE(7, 7, 4, 0x0070, 0x10, 16, 1),
276 	PIN_FIELD_BASE(8, 8, 4, 0x0070, 0x10, 17, 1),
277 	PIN_FIELD_BASE(9, 9, 4, 0x0070, 0x10, 18, 1),
278 	PIN_FIELD_BASE(10, 10, 6, 0x0010, 0x10, 0, 1),
279 	PIN_FIELD_BASE(11, 11, 6, 0x0010, 0x10, 1, 1),
280 	PIN_FIELD_BASE(12, 12, 6, 0x0010, 0x10, 2, 1),
281 	PIN_FIELD_BASE(13, 13, 6, 0x0010, 0x10, 3, 1),
282 	PIN_FIELD_BASE(14, 14, 6, 0x0010, 0x10, 4, 1),
283 	PIN_FIELD_BASE(15, 15, 6, 0x0010, 0x10, 5, 1),
284 	PIN_FIELD_BASE(16, 16, 8, 0x0030, 0x10, 2, 1),
285 	PIN_FIELD_BASE(17, 17, 8, 0x0030, 0x10, 3, 1),
286 	PIN_FIELD_BASE(18, 18, 7, 0x0050, 0x10, 21, 1),
287 	PIN_FIELD_BASE(19, 19, 7, 0x0050, 0x10, 22, 1),
288 	PIN_FIELD_BASE(20, 20, 7, 0x0050, 0x10, 23, 1),
289 	PIN_FIELD_BASE(21, 21, 7, 0x0050, 0x10, 24, 1),
290 	PIN_FIELD_BASE(22, 22, 2, 0x0050, 0x10, 3, 1),
291 	PIN_FIELD_BASE(23, 23, 2, 0x0050, 0x10, 4, 1),
292 	PIN_FIELD_BASE(24, 24, 2, 0x0050, 0x10, 5, 1),
293 	PIN_FIELD_BASE(25, 25, 2, 0x0050, 0x10, 6, 1),
294 	PIN_FIELD_BASE(26, 26, 3, 0x0040, 0x10, 5, 1),
295 	PIN_FIELD_BASE(27, 27, 3, 0x0040, 0x10, 6, 1),
296 	PIN_FIELD_BASE(28, 28, 3, 0x0040, 0x10, 7, 1),
297 	PIN_FIELD_BASE(29, 29, 3, 0x0040, 0x10, 8, 1),
298 	PIN_FIELD_BASE(30, 30, 3, 0x0040, 0x10, 9, 1),
299 	PIN_FIELD_BASE(31, 31, 3, 0x0030, 0x10, 27, 1),
300 	PIN_FIELD_BASE(32, 32, 3, 0x0030, 0x10, 24, 1),
301 	PIN_FIELD_BASE(33, 33, 3, 0x0030, 0x10, 26, 1),
302 	PIN_FIELD_BASE(34, 34, 3, 0x0030, 0x10, 23, 1),
303 	PIN_FIELD_BASE(35, 35, 3, 0x0030, 0x10, 25, 1),
304 	PIN_FIELD_BASE(36, 36, 2, 0x0050, 0x10, 20, 1),
305 	PIN_FIELD_BASE(37, 37, 2, 0x0050, 0x10, 21, 1),
306 	PIN_FIELD_BASE(38, 38, 2, 0x0050, 0x10, 22, 1),
307 	PIN_FIELD_BASE(39, 39, 2, 0x0050, 0x10, 23, 1),
308 	PIN_FIELD_BASE(40, 40, 8, 0x0030, 0x10, 0, 1),
309 	PIN_FIELD_BASE(41, 41, 8, 0x0030, 0x10, 1, 1),
310 	PIN_FIELD_BASE(42, 42, 8, 0x0030, 0x10, 4, 1),
311 	PIN_FIELD_BASE(43, 43, 7, 0x0050, 0x10, 25, 1),
312 	PIN_FIELD_BASE(44, 44, 7, 0x0050, 0x10, 26, 1),
313 	PIN_FIELD_BASE(45, 45, 1, 0x0030, 0x10, 18, 1),
314 	PIN_FIELD_BASE(46, 46, 1, 0x0030, 0x10, 20, 1),
315 	PIN_FIELD_BASE(47, 47, 1, 0x0030, 0x10, 19, 1),
316 	PIN_FIELD_BASE(48, 48, 1, 0x0030, 0x10, 16, 1),
317 	PIN_FIELD_BASE(49, 49, 1, 0x0030, 0x10, 17, 1),
318 	PIN_FIELD_BASE(50, 50, 1, 0x0030, 0x10, 15, 1),
319 	PIN_FIELD_BASE(51, 51, 1, 0x0030, 0x10, 9, 1),
320 	PIN_FIELD_BASE(52, 52, 1, 0x0030, 0x10, 10, 1),
321 	PIN_FIELD_BASE(53, 53, 1, 0x0030, 0x10, 14, 1),
322 	PIN_FIELD_BASE(54, 54, 1, 0x0030, 0x10, 11, 1),
323 	PIN_FIELD_BASE(55, 55, 1, 0x0030, 0x10, 13, 1),
324 	PIN_FIELD_BASE(56, 56, 1, 0x0030, 0x10, 12, 1),
325 	PIN_FIELD_BASE(57, 57, 3, 0x0040, 0x10, 1, 1),
326 	PIN_FIELD_BASE(58, 58, 3, 0x0040, 0x10, 2, 1),
327 	PIN_FIELD_BASE(59, 59, 3, 0x0040, 0x10, 3, 1),
328 	PIN_FIELD_BASE(60, 60, 3, 0x0040, 0x10, 4, 1),
329 	PIN_FIELD_BASE(61, 61, 3, 0x0030, 0x10, 28, 1),
330 	PIN_FIELD_BASE(62, 62, 3, 0x0030, 0x10, 22, 1),
331 	PIN_FIELD_BASE(63, 63, 3, 0x0030, 0x10, 0, 1),
332 	PIN_FIELD_BASE(64, 64, 3, 0x0030, 0x10, 1, 1),
333 	PIN_FIELD_BASE(65, 65, 3, 0x0030, 0x10, 12, 1),
334 	PIN_FIELD_BASE(66, 66, 3, 0x0030, 0x10, 15, 1),
335 	PIN_FIELD_BASE(67, 67, 3, 0x0030, 0x10, 16, 1),
336 	PIN_FIELD_BASE(68, 68, 3, 0x0030, 0x10, 17, 1),
337 	PIN_FIELD_BASE(69, 69, 3, 0x0030, 0x10, 18, 1),
338 	PIN_FIELD_BASE(70, 70, 3, 0x0030, 0x10, 19, 1),
339 	PIN_FIELD_BASE(71, 71, 3, 0x0030, 0x10, 20, 1),
340 	PIN_FIELD_BASE(72, 72, 3, 0x0030, 0x10, 21, 1),
341 	PIN_FIELD_BASE(73, 73, 3, 0x0030, 0x10, 2, 1),
342 	PIN_FIELD_BASE(74, 74, 3, 0x0030, 0x10, 3, 1),
343 	PIN_FIELD_BASE(75, 75, 3, 0x0030, 0x10, 4, 1),
344 	PIN_FIELD_BASE(76, 76, 3, 0x0030, 0x10, 5, 1),
345 	PIN_FIELD_BASE(77, 77, 3, 0x0030, 0x10, 6, 1),
346 	PIN_FIELD_BASE(78, 78, 3, 0x0030, 0x10, 7, 1),
347 	PIN_FIELD_BASE(79, 79, 3, 0x0030, 0x10, 8, 1),
348 	PIN_FIELD_BASE(80, 80, 3, 0x0030, 0x10, 9, 1),
349 	PIN_FIELD_BASE(81, 81, 3, 0x0030, 0x10, 10, 1),
350 	PIN_FIELD_BASE(82, 82, 3, 0x0030, 0x10, 11, 1),
351 	PIN_FIELD_BASE(83, 83, 3, 0x0030, 0x10, 13, 1),
352 	PIN_FIELD_BASE(84, 84, 3, 0x0030, 0x10, 14, 1),
353 	PIN_FIELD_BASE(85, 85, 3, 0x0030, 0x10, 31, 1),
354 	PIN_FIELD_BASE(86, 86, 3, 0x0040, 0x10, 0, 1),
355 	PIN_FIELD_BASE(87, 87, 3, 0x0030, 0x10, 29, 1),
356 	PIN_FIELD_BASE(88, 88, 3, 0x0030, 0x10, 30, 1),
357 	PIN_FIELD_BASE(89, 89, 2, 0x0050, 0x10, 24, 1),
358 	PIN_FIELD_BASE(90, 90, 2, 0x0050, 0x10, 25, 1),
359 	PIN_FIELD_BASE(91, 91, 2, 0x0050, 0x10, 0, 1),
360 	PIN_FIELD_BASE(92, 92, 2, 0x0060, 0x10, 1, 1),
361 	PIN_FIELD_BASE(93, 93, 2, 0x0060, 0x10, 3, 1),
362 	PIN_FIELD_BASE(94, 94, 2, 0x0060, 0x10, 2, 1),
363 	PIN_FIELD_BASE(95, 95, 2, 0x0060, 0x10, 4, 1),
364 	PIN_FIELD_BASE(96, 96, 2, 0x0050, 0x10, 31, 1),
365 	PIN_FIELD_BASE(97, 97, 2, 0x0050, 0x10, 26, 1),
366 	PIN_FIELD_BASE(98, 98, 2, 0x0060, 0x10, 0, 1),
367 	PIN_FIELD_BASE(99, 99, 2, 0x0050, 0x10, 27, 1),
368 	PIN_FIELD_BASE(100, 100, 2, 0x0050, 0x10, 28, 1),
369 	PIN_FIELD_BASE(101, 101, 2, 0x0050, 0x10, 29, 1),
370 	PIN_FIELD_BASE(102, 102, 2, 0x0050, 0x10, 30, 1),
371 	PIN_FIELD_BASE(103, 103, 2, 0x0050, 0x10, 18, 1),
372 	PIN_FIELD_BASE(104, 104, 2, 0x0050, 0x10, 17, 1),
373 	PIN_FIELD_BASE(105, 105, 2, 0x0050, 0x10, 19, 1),
374 	PIN_FIELD_BASE(106, 106, 2, 0x0050, 0x10, 16, 1),
375 	PIN_FIELD_BASE(107, 107, 2, 0x0050, 0x10, 1, 1),
376 	PIN_FIELD_BASE(108, 108, 2, 0x0050, 0x10, 2, 1),
377 	PIN_FIELD_BASE(109, 109, 2, 0x0050, 0x10, 10, 1),
378 	PIN_FIELD_BASE(110, 110, 2, 0x0050, 0x10, 7, 1),
379 	PIN_FIELD_BASE(111, 111, 2, 0x0050, 0x10, 9, 1),
380 	PIN_FIELD_BASE(112, 112, 2, 0x0050, 0x10, 11, 1),
381 	PIN_FIELD_BASE(113, 113, 2, 0x0050, 0x10, 8, 1),
382 	PIN_FIELD_BASE(114, 114, 2, 0x0050, 0x10, 14, 1),
383 	PIN_FIELD_BASE(115, 115, 2, 0x0050, 0x10, 13, 1),
384 	PIN_FIELD_BASE(116, 116, 2, 0x0050, 0x10, 15, 1),
385 	PIN_FIELD_BASE(117, 117, 2, 0x0050, 0x10, 12, 1),
386 	PIN_FIELD_BASE(118, 118, 4, 0x0070, 0x10, 23, 1),
387 	PIN_FIELD_BASE(119, 119, 4, 0x0070, 0x10, 29, 1),
388 	PIN_FIELD_BASE(120, 120, 4, 0x0070, 0x10, 28, 1),
389 	PIN_FIELD_BASE(121, 121, 4, 0x0080, 0x10, 2, 1),
390 	PIN_FIELD_BASE(122, 122, 4, 0x0070, 0x10, 27, 1),
391 	PIN_FIELD_BASE(123, 123, 4, 0x0080, 0x10, 1, 1),
392 	PIN_FIELD_BASE(124, 124, 4, 0x0070, 0x10, 26, 1),
393 	PIN_FIELD_BASE(125, 125, 4, 0x0080, 0x10, 0, 1),
394 	PIN_FIELD_BASE(126, 126, 4, 0x0070, 0x10, 19, 1),
395 	PIN_FIELD_BASE(127, 127, 4, 0x0070, 0x10, 20, 1),
396 	PIN_FIELD_BASE(128, 128, 4, 0x0070, 0x10, 21, 1),
397 	PIN_FIELD_BASE(129, 129, 4, 0x0070, 0x10, 22, 1),
398 	PIN_FIELD_BASE(130, 130, 4, 0x0070, 0x10, 6, 1),
399 	PIN_FIELD_BASE(131, 131, 4, 0x0070, 0x10, 7, 1),
400 	PIN_FIELD_BASE(132, 132, 4, 0x0070, 0x10, 8, 1),
401 	PIN_FIELD_BASE(133, 133, 4, 0x0070, 0x10, 3, 1),
402 	PIN_FIELD_BASE(134, 134, 4, 0x0070, 0x10, 4, 1),
403 	PIN_FIELD_BASE(135, 135, 4, 0x0070, 0x10, 5, 1),
404 	PIN_FIELD_BASE(136, 136, 4, 0x0070, 0x10, 0, 1),
405 	PIN_FIELD_BASE(137, 137, 4, 0x0070, 0x10, 1, 1),
406 	PIN_FIELD_BASE(138, 138, 4, 0x0070, 0x10, 2, 1),
407 	PIN_FIELD_BASE(139, 139, 4, 0x0070, 0x10, 25, 1),
408 	PIN_FIELD_BASE(140, 140, 4, 0x0070, 0x10, 31, 1),
409 	PIN_FIELD_BASE(141, 141, 4, 0x0070, 0x10, 24, 1),
410 	PIN_FIELD_BASE(142, 142, 4, 0x0070, 0x10, 30, 1),
411 	PIN_FIELD_BASE(143, 143, 1, 0x0030, 0x10, 6, 1),
412 	PIN_FIELD_BASE(144, 144, 1, 0x0030, 0x10, 7, 1),
413 	PIN_FIELD_BASE(145, 145, 1, 0x0030, 0x10, 8, 1),
414 	PIN_FIELD_BASE(146, 146, 1, 0x0030, 0x10, 3, 1),
415 	PIN_FIELD_BASE(147, 147, 1, 0x0030, 0x10, 4, 1),
416 	PIN_FIELD_BASE(148, 148, 1, 0x0030, 0x10, 5, 1),
417 	PIN_FIELD_BASE(149, 149, 1, 0x0030, 0x10, 0, 1),
418 	PIN_FIELD_BASE(150, 150, 1, 0x0030, 0x10, 1, 1),
419 	PIN_FIELD_BASE(151, 151, 1, 0x0030, 0x10, 2, 1),
420 	PIN_FIELD_BASE(152, 152, 7, 0x0050, 0x10, 30, 1),
421 	PIN_FIELD_BASE(153, 153, 7, 0x0050, 0x10, 29, 1),
422 	PIN_FIELD_BASE(154, 154, 7, 0x0050, 0x10, 27, 1),
423 	PIN_FIELD_BASE(155, 155, 7, 0x0050, 0x10, 28, 1),
424 	PIN_FIELD_BASE(156, 156, 7, 0x0060, 0x10, 1, 1),
425 	PIN_FIELD_BASE(157, 157, 7, 0x0060, 0x10, 2, 1),
426 	PIN_FIELD_BASE(158, 158, 7, 0x0060, 0x10, 3, 1),
427 	PIN_FIELD_BASE(159, 159, 7, 0x0060, 0x10, 4, 1),
428 	PIN_FIELD_BASE(160, 160, 7, 0x0050, 0x10, 31, 1),
429 	PIN_FIELD_BASE(161, 161, 7, 0x0060, 0x10, 0, 1),
430 	PIN_FIELD_BASE(162, 162, 7, 0x0050, 0x10, 0, 1),
431 	PIN_FIELD_BASE(163, 163, 7, 0x0050, 0x10, 1, 1),
432 	PIN_FIELD_BASE(164, 164, 7, 0x0050, 0x10, 2, 1),
433 	PIN_FIELD_BASE(165, 165, 7, 0x0050, 0x10, 3, 1),
434 	PIN_FIELD_BASE(166, 166, 7, 0x0050, 0x10, 4, 1),
435 	PIN_FIELD_BASE(167, 167, 7, 0x0050, 0x10, 5, 1),
436 	PIN_FIELD_BASE(168, 168, 7, 0x0050, 0x10, 6, 1),
437 	PIN_FIELD_BASE(169, 169, 7, 0x0050, 0x10, 7, 1),
438 	PIN_FIELD_BASE(170, 170, 7, 0x0050, 0x10, 8, 1),
439 	PIN_FIELD_BASE(171, 171, 7, 0x0050, 0x10, 9, 1),
440 	PIN_FIELD_BASE(172, 172, 7, 0x0050, 0x10, 13, 1),
441 	PIN_FIELD_BASE(173, 173, 7, 0x0050, 0x10, 14, 1),
442 	PIN_FIELD_BASE(174, 174, 7, 0x0050, 0x10, 12, 1),
443 	PIN_FIELD_BASE(175, 175, 7, 0x0050, 0x10, 15, 1),
444 	PIN_FIELD_BASE(176, 176, 7, 0x0050, 0x10, 10, 1),
445 	PIN_FIELD_BASE(177, 177, 7, 0x0050, 0x10, 11, 1),
446 	PIN_FIELD_BASE(178, 178, 7, 0x0050, 0x10, 16, 1),
447 	PIN_FIELD_BASE(179, 179, 7, 0x0050, 0x10, 17, 1),
448 	PIN_FIELD_BASE(180, 180, 7, 0x0050, 0x10, 18, 1),
449 	PIN_FIELD_BASE(181, 181, 7, 0x0050, 0x10, 19, 1),
450 	PIN_FIELD_BASE(182, 182, 7, 0x0050, 0x10, 20, 1),
451 	PIN_FIELD_BASE(183, 183, 9, 0x0020, 0x10, 1, 1),
452 	PIN_FIELD_BASE(184, 184, 9, 0x0020, 0x10, 2, 1),
453 	PIN_FIELD_BASE(185, 185, 9, 0x0020, 0x10, 4, 1),
454 	PIN_FIELD_BASE(186, 186, 9, 0x0020, 0x10, 6, 1),
455 	PIN_FIELD_BASE(187, 187, 9, 0x0020, 0x10, 8, 1),
456 	PIN_FIELD_BASE(188, 188, 9, 0x0020, 0x10, 3, 1),
457 	PIN_FIELD_BASE(189, 189, 9, 0x0020, 0x10, 7, 1),
458 	PIN_FIELD_BASE(190, 190, 9, 0x0020, 0x10, 9, 1),
459 	PIN_FIELD_BASE(191, 191, 9, 0x0020, 0x10, 10, 1),
460 	PIN_FIELD_BASE(192, 192, 9, 0x0020, 0x10, 0, 1),
461 	PIN_FIELD_BASE(193, 193, 9, 0x0020, 0x10, 5, 1),
462 	PIN_FIELD_BASE(194, 194, 9, 0x0020, 0x10, 11, 1),
463 	PIN_FIELD_BASE(195, 195, 5, 0x0030, 0x10, 16, 1),
464 	PIN_FIELD_BASE(196, 196, 5, 0x0030, 0x10, 6, 1),
465 	PIN_FIELD_BASE(197, 197, 5, 0x0030, 0x10, 8, 1),
466 	PIN_FIELD_BASE(198, 198, 5, 0x0030, 0x10, 7, 1),
467 	PIN_FIELD_BASE(199, 199, 5, 0x0030, 0x10, 3, 1),
468 	PIN_FIELD_BASE(200, 200, 8, 0x0030, 0x10, 6, 1),
469 	PIN_FIELD_BASE(201, 201, 8, 0x0030, 0x10, 8, 1),
470 	PIN_FIELD_BASE(202, 202, 5, 0x0030, 0x10, 15, 1),
471 	PIN_FIELD_BASE(203, 203, 5, 0x0030, 0x10, 17, 1),
472 	PIN_FIELD_BASE(204, 204, 8, 0x0030, 0x10, 5, 1),
473 	PIN_FIELD_BASE(205, 205, 8, 0x0030, 0x10, 7, 1),
474 	PIN_FIELD_BASE(206, 206, 5, 0x0030, 0x10, 18, 1),
475 	PIN_FIELD_BASE(207, 207, 5, 0x0030, 0x10, 19, 1),
476 	PIN_FIELD_BASE(208, 208, 5, 0x0030, 0x10, 20, 1),
477 	PIN_FIELD_BASE(209, 209, 5, 0x0030, 0x10, 12, 1),
478 	PIN_FIELD_BASE(210, 210, 5, 0x0030, 0x10, 11, 1),
479 	PIN_FIELD_BASE(211, 211, 5, 0x0030, 0x10, 13, 1),
480 	PIN_FIELD_BASE(212, 212, 5, 0x0030, 0x10, 10, 1),
481 	PIN_FIELD_BASE(213, 213, 5, 0x0030, 0x10, 14, 1),
482 	PIN_FIELD_BASE(214, 214, 5, 0x0030, 0x10, 0, 1),
483 	PIN_FIELD_BASE(215, 215, 5, 0x0030, 0x10, 9, 1),
484 	PIN_FIELD_BASE(216, 216, 5, 0x0030, 0x10, 4, 1),
485 	PIN_FIELD_BASE(217, 217, 5, 0x0030, 0x10, 5, 1),
486 	PIN_FIELD_BASE(218, 218, 5, 0x0030, 0x10, 1, 1),
487 	PIN_FIELD_BASE(219, 219, 5, 0x0030, 0x10, 2, 1),
488 };
489 
490 static const struct mtk_pin_field_calc mt8192_pin_pu_range[] = {
491 	PIN_FIELD_BASE(0, 0, 4, 0x00b0, 0x10, 9, 1),
492 	PIN_FIELD_BASE(1, 1, 4, 0x00b0, 0x10, 10, 1),
493 	PIN_FIELD_BASE(2, 2, 4, 0x00b0, 0x10, 11, 1),
494 	PIN_FIELD_BASE(3, 3, 4, 0x00b0, 0x10, 12, 1),
495 	PIN_FIELD_BASE(4, 4, 4, 0x00b0, 0x10, 13, 1),
496 	PIN_FIELD_BASE(5, 5, 4, 0x00b0, 0x10, 14, 1),
497 	PIN_FIELD_BASE(6, 6, 4, 0x00b0, 0x10, 15, 1),
498 	PIN_FIELD_BASE(7, 7, 4, 0x00b0, 0x10, 16, 1),
499 	PIN_FIELD_BASE(8, 8, 4, 0x00b0, 0x10, 17, 1),
500 	PIN_FIELD_BASE(9, 9, 4, 0x00b0, 0x10, 18, 1),
501 	PIN_FIELD_BASE(16, 16, 8, 0x0050, 0x10, 2, 1),
502 	PIN_FIELD_BASE(17, 17, 8, 0x0050, 0x10, 3, 1),
503 	PIN_FIELD_BASE(18, 18, 7, 0x00a0, 0x10, 21, 1),
504 	PIN_FIELD_BASE(19, 19, 7, 0x00a0, 0x10, 22, 1),
505 	PIN_FIELD_BASE(20, 20, 7, 0x00a0, 0x10, 23, 1),
506 	PIN_FIELD_BASE(21, 21, 7, 0x00a0, 0x10, 24, 1),
507 	PIN_FIELD_BASE(22, 22, 2, 0x0090, 0x10, 3, 1),
508 	PIN_FIELD_BASE(23, 23, 2, 0x0090, 0x10, 4, 1),
509 	PIN_FIELD_BASE(24, 24, 2, 0x0090, 0x10, 5, 1),
510 	PIN_FIELD_BASE(25, 25, 2, 0x0090, 0x10, 6, 1),
511 	PIN_FIELD_BASE(26, 26, 3, 0x0080, 0x10, 5, 1),
512 	PIN_FIELD_BASE(27, 27, 3, 0x0080, 0x10, 6, 1),
513 	PIN_FIELD_BASE(28, 28, 3, 0x0080, 0x10, 7, 1),
514 	PIN_FIELD_BASE(29, 29, 3, 0x0080, 0x10, 8, 1),
515 	PIN_FIELD_BASE(30, 30, 3, 0x0080, 0x10, 9, 1),
516 	PIN_FIELD_BASE(31, 31, 3, 0x0070, 0x10, 27, 1),
517 	PIN_FIELD_BASE(32, 32, 3, 0x0070, 0x10, 24, 1),
518 	PIN_FIELD_BASE(33, 33, 3, 0x0070, 0x10, 26, 1),
519 	PIN_FIELD_BASE(34, 34, 3, 0x0070, 0x10, 23, 1),
520 	PIN_FIELD_BASE(35, 35, 3, 0x0070, 0x10, 25, 1),
521 	PIN_FIELD_BASE(36, 36, 2, 0x0090, 0x10, 20, 1),
522 	PIN_FIELD_BASE(37, 37, 2, 0x0090, 0x10, 21, 1),
523 	PIN_FIELD_BASE(38, 38, 2, 0x0090, 0x10, 22, 1),
524 	PIN_FIELD_BASE(39, 39, 2, 0x0090, 0x10, 23, 1),
525 	PIN_FIELD_BASE(40, 40, 8, 0x0050, 0x10, 0, 1),
526 	PIN_FIELD_BASE(41, 41, 8, 0x0050, 0x10, 1, 1),
527 	PIN_FIELD_BASE(42, 42, 8, 0x0050, 0x10, 4, 1),
528 	PIN_FIELD_BASE(43, 43, 7, 0x00a0, 0x10, 25, 1),
529 	PIN_FIELD_BASE(44, 44, 7, 0x00a0, 0x10, 26, 1),
530 	PIN_FIELD_BASE(57, 57, 3, 0x0080, 0x10, 1, 1),
531 	PIN_FIELD_BASE(58, 58, 3, 0x0080, 0x10, 2, 1),
532 	PIN_FIELD_BASE(59, 59, 3, 0x0080, 0x10, 3, 1),
533 	PIN_FIELD_BASE(60, 60, 3, 0x0080, 0x10, 4, 1),
534 	PIN_FIELD_BASE(61, 61, 3, 0x0070, 0x10, 28, 1),
535 	PIN_FIELD_BASE(62, 62, 3, 0x0070, 0x10, 22, 1),
536 	PIN_FIELD_BASE(63, 63, 3, 0x0070, 0x10, 0, 1),
537 	PIN_FIELD_BASE(64, 64, 3, 0x0070, 0x10, 1, 1),
538 	PIN_FIELD_BASE(65, 65, 3, 0x0070, 0x10, 12, 1),
539 	PIN_FIELD_BASE(66, 66, 3, 0x0070, 0x10, 15, 1),
540 	PIN_FIELD_BASE(67, 67, 3, 0x0070, 0x10, 16, 1),
541 	PIN_FIELD_BASE(68, 68, 3, 0x0070, 0x10, 17, 1),
542 	PIN_FIELD_BASE(69, 69, 3, 0x0070, 0x10, 18, 1),
543 	PIN_FIELD_BASE(70, 70, 3, 0x0070, 0x10, 19, 1),
544 	PIN_FIELD_BASE(71, 71, 3, 0x0070, 0x10, 20, 1),
545 	PIN_FIELD_BASE(72, 72, 3, 0x0070, 0x10, 21, 1),
546 	PIN_FIELD_BASE(73, 73, 3, 0x0070, 0x10, 2, 1),
547 	PIN_FIELD_BASE(74, 74, 3, 0x0070, 0x10, 3, 1),
548 	PIN_FIELD_BASE(75, 75, 3, 0x0070, 0x10, 4, 1),
549 	PIN_FIELD_BASE(76, 76, 3, 0x0070, 0x10, 5, 1),
550 	PIN_FIELD_BASE(77, 77, 3, 0x0070, 0x10, 6, 1),
551 	PIN_FIELD_BASE(78, 78, 3, 0x0070, 0x10, 7, 1),
552 	PIN_FIELD_BASE(79, 79, 3, 0x0070, 0x10, 8, 1),
553 	PIN_FIELD_BASE(80, 80, 3, 0x0070, 0x10, 9, 1),
554 	PIN_FIELD_BASE(81, 81, 3, 0x0070, 0x10, 10, 1),
555 	PIN_FIELD_BASE(82, 82, 3, 0x0070, 0x10, 11, 1),
556 	PIN_FIELD_BASE(83, 83, 3, 0x0070, 0x10, 13, 1),
557 	PIN_FIELD_BASE(84, 84, 3, 0x0070, 0x10, 14, 1),
558 	PIN_FIELD_BASE(85, 85, 3, 0x0070, 0x10, 31, 1),
559 	PIN_FIELD_BASE(86, 86, 3, 0x0080, 0x10, 0, 1),
560 	PIN_FIELD_BASE(87, 87, 3, 0x0070, 0x10, 29, 1),
561 	PIN_FIELD_BASE(88, 88, 3, 0x0070, 0x10, 30, 1),
562 	PIN_FIELD_BASE(89, 89, 2, 0x0090, 0x10, 24, 1),
563 	PIN_FIELD_BASE(90, 90, 2, 0x0090, 0x10, 25, 1),
564 	PIN_FIELD_BASE(91, 91, 2, 0x0090, 0x10, 0, 1),
565 	PIN_FIELD_BASE(92, 92, 2, 0x00a0, 0x10, 2, 1),
566 	PIN_FIELD_BASE(93, 93, 2, 0x00a0, 0x10, 4, 1),
567 	PIN_FIELD_BASE(94, 94, 2, 0x00a0, 0x10, 3, 1),
568 	PIN_FIELD_BASE(95, 95, 2, 0x00a0, 0x10, 5, 1),
569 	PIN_FIELD_BASE(96, 96, 2, 0x0090, 0x10, 31, 1),
570 	PIN_FIELD_BASE(97, 97, 2, 0x0090, 0x10, 26, 1),
571 	PIN_FIELD_BASE(98, 98, 2, 0x00a0, 0x10, 0, 1),
572 	PIN_FIELD_BASE(99, 99, 2, 0x0090, 0x10, 27, 1),
573 	PIN_FIELD_BASE(100, 100, 2, 0x0090, 0x10, 28, 1),
574 	PIN_FIELD_BASE(101, 101, 2, 0x0090, 0x10, 29, 1),
575 	PIN_FIELD_BASE(102, 102, 2, 0x0090, 0x10, 30, 1),
576 	PIN_FIELD_BASE(103, 103, 2, 0x0090, 0x10, 18, 1),
577 	PIN_FIELD_BASE(104, 104, 2, 0x0090, 0x10, 17, 1),
578 	PIN_FIELD_BASE(105, 105, 2, 0x0090, 0x10, 19, 1),
579 	PIN_FIELD_BASE(106, 106, 2, 0x0090, 0x10, 16, 1),
580 	PIN_FIELD_BASE(107, 107, 2, 0x0090, 0x10, 1, 1),
581 	PIN_FIELD_BASE(108, 108, 2, 0x0090, 0x10, 2, 1),
582 	PIN_FIELD_BASE(109, 109, 2, 0x0090, 0x10, 10, 1),
583 	PIN_FIELD_BASE(110, 110, 2, 0x0090, 0x10, 7, 1),
584 	PIN_FIELD_BASE(111, 111, 2, 0x0090, 0x10, 9, 1),
585 	PIN_FIELD_BASE(112, 112, 2, 0x0090, 0x10, 11, 1),
586 	PIN_FIELD_BASE(113, 113, 2, 0x0090, 0x10, 8, 1),
587 	PIN_FIELD_BASE(114, 114, 2, 0x0090, 0x10, 14, 1),
588 	PIN_FIELD_BASE(115, 115, 2, 0x0090, 0x10, 13, 1),
589 	PIN_FIELD_BASE(116, 116, 2, 0x0090, 0x10, 15, 1),
590 	PIN_FIELD_BASE(117, 117, 2, 0x0090, 0x10, 12, 1),
591 	PIN_FIELD_BASE(118, 118, 4, 0x00b0, 0x10, 23, 1),
592 	PIN_FIELD_BASE(119, 119, 4, 0x00b0, 0x10, 29, 1),
593 	PIN_FIELD_BASE(120, 120, 4, 0x00b0, 0x10, 28, 1),
594 	PIN_FIELD_BASE(121, 121, 4, 0x00c0, 0x10, 2, 1),
595 	PIN_FIELD_BASE(122, 122, 4, 0x00b0, 0x10, 27, 1),
596 	PIN_FIELD_BASE(123, 123, 4, 0x00c0, 0x10, 1, 1),
597 	PIN_FIELD_BASE(124, 124, 4, 0x00b0, 0x10, 26, 1),
598 	PIN_FIELD_BASE(125, 125, 4, 0x00c0, 0x10, 0, 1),
599 	PIN_FIELD_BASE(126, 126, 4, 0x00b0, 0x10, 19, 1),
600 	PIN_FIELD_BASE(127, 127, 4, 0x00b0, 0x10, 20, 1),
601 	PIN_FIELD_BASE(128, 128, 4, 0x00b0, 0x10, 21, 1),
602 	PIN_FIELD_BASE(129, 129, 4, 0x00b0, 0x10, 22, 1),
603 	PIN_FIELD_BASE(130, 130, 4, 0x00b0, 0x10, 6, 1),
604 	PIN_FIELD_BASE(131, 131, 4, 0x00b0, 0x10, 7, 1),
605 	PIN_FIELD_BASE(132, 132, 4, 0x00b0, 0x10, 8, 1),
606 	PIN_FIELD_BASE(133, 133, 4, 0x00b0, 0x10, 3, 1),
607 	PIN_FIELD_BASE(134, 134, 4, 0x00b0, 0x10, 4, 1),
608 	PIN_FIELD_BASE(135, 135, 4, 0x00b0, 0x10, 5, 1),
609 	PIN_FIELD_BASE(136, 136, 4, 0x00b0, 0x10, 0, 1),
610 	PIN_FIELD_BASE(137, 137, 4, 0x00b0, 0x10, 1, 1),
611 	PIN_FIELD_BASE(138, 138, 4, 0x00b0, 0x10, 2, 1),
612 	PIN_FIELD_BASE(139, 139, 4, 0x00b0, 0x10, 25, 1),
613 	PIN_FIELD_BASE(140, 140, 4, 0x00b0, 0x10, 31, 1),
614 	PIN_FIELD_BASE(141, 141, 4, 0x00b0, 0x10, 24, 1),
615 	PIN_FIELD_BASE(142, 142, 4, 0x00b0, 0x10, 30, 1),
616 	PIN_FIELD_BASE(143, 143, 1, 0x0070, 0x10, 6, 1),
617 	PIN_FIELD_BASE(144, 144, 1, 0x0070, 0x10, 7, 1),
618 	PIN_FIELD_BASE(145, 145, 1, 0x0070, 0x10, 8, 1),
619 	PIN_FIELD_BASE(146, 146, 1, 0x0070, 0x10, 3, 1),
620 	PIN_FIELD_BASE(147, 147, 1, 0x0070, 0x10, 4, 1),
621 	PIN_FIELD_BASE(148, 148, 1, 0x0070, 0x10, 5, 1),
622 	PIN_FIELD_BASE(149, 149, 1, 0x0070, 0x10, 0, 1),
623 	PIN_FIELD_BASE(150, 150, 1, 0x0070, 0x10, 1, 1),
624 	PIN_FIELD_BASE(151, 151, 1, 0x0070, 0x10, 2, 1),
625 	PIN_FIELD_BASE(156, 156, 7, 0x00a0, 0x10, 29, 1),
626 	PIN_FIELD_BASE(157, 157, 7, 0x00a0, 0x10, 30, 1),
627 	PIN_FIELD_BASE(158, 158, 7, 0x00a0, 0x10, 31, 1),
628 	PIN_FIELD_BASE(159, 159, 7, 0x00b0, 0x10, 0, 1),
629 	PIN_FIELD_BASE(160, 160, 7, 0x00a0, 0x10, 27, 1),
630 	PIN_FIELD_BASE(161, 161, 7, 0x00a0, 0x10, 28, 1),
631 	PIN_FIELD_BASE(162, 162, 7, 0x00a0, 0x10, 0, 1),
632 	PIN_FIELD_BASE(163, 163, 7, 0x00a0, 0x10, 1, 1),
633 	PIN_FIELD_BASE(164, 164, 7, 0x00a0, 0x10, 2, 1),
634 	PIN_FIELD_BASE(165, 165, 7, 0x00a0, 0x10, 3, 1),
635 	PIN_FIELD_BASE(166, 166, 7, 0x00a0, 0x10, 4, 1),
636 	PIN_FIELD_BASE(167, 167, 7, 0x00a0, 0x10, 5, 1),
637 	PIN_FIELD_BASE(168, 168, 7, 0x00a0, 0x10, 6, 1),
638 	PIN_FIELD_BASE(169, 169, 7, 0x00a0, 0x10, 7, 1),
639 	PIN_FIELD_BASE(170, 170, 7, 0x00a0, 0x10, 8, 1),
640 	PIN_FIELD_BASE(171, 171, 7, 0x00a0, 0x10, 9, 1),
641 	PIN_FIELD_BASE(172, 172, 7, 0x00a0, 0x10, 13, 1),
642 	PIN_FIELD_BASE(173, 173, 7, 0x00a0, 0x10, 14, 1),
643 	PIN_FIELD_BASE(174, 174, 7, 0x00a0, 0x10, 12, 1),
644 	PIN_FIELD_BASE(175, 175, 7, 0x00a0, 0x10, 15, 1),
645 	PIN_FIELD_BASE(176, 176, 7, 0x00a0, 0x10, 10, 1),
646 	PIN_FIELD_BASE(177, 177, 7, 0x00a0, 0x10, 11, 1),
647 	PIN_FIELD_BASE(178, 178, 7, 0x00a0, 0x10, 16, 1),
648 	PIN_FIELD_BASE(179, 179, 7, 0x00a0, 0x10, 17, 1),
649 	PIN_FIELD_BASE(180, 180, 7, 0x00a0, 0x10, 18, 1),
650 	PIN_FIELD_BASE(181, 181, 7, 0x00a0, 0x10, 19, 1),
651 	PIN_FIELD_BASE(182, 182, 7, 0x00a0, 0x10, 20, 1),
652 	PIN_FIELD_BASE(195, 195, 5, 0x0050, 0x10, 16, 1),
653 	PIN_FIELD_BASE(196, 196, 5, 0x0050, 0x10, 6, 1),
654 	PIN_FIELD_BASE(197, 197, 5, 0x0050, 0x10, 8, 1),
655 	PIN_FIELD_BASE(198, 198, 5, 0x0050, 0x10, 7, 1),
656 	PIN_FIELD_BASE(199, 199, 5, 0x0050, 0x10, 3, 1),
657 	PIN_FIELD_BASE(200, 200, 8, 0x0050, 0x10, 6, 1),
658 	PIN_FIELD_BASE(201, 201, 8, 0x0050, 0x10, 8, 1),
659 	PIN_FIELD_BASE(202, 202, 5, 0x0050, 0x10, 15, 1),
660 	PIN_FIELD_BASE(203, 203, 5, 0x0050, 0x10, 17, 1),
661 	PIN_FIELD_BASE(204, 204, 8, 0x0050, 0x10, 5, 1),
662 	PIN_FIELD_BASE(205, 205, 8, 0x0050, 0x10, 7, 1),
663 	PIN_FIELD_BASE(206, 206, 5, 0x0050, 0x10, 18, 1),
664 	PIN_FIELD_BASE(207, 207, 5, 0x0050, 0x10, 19, 1),
665 	PIN_FIELD_BASE(208, 208, 5, 0x0050, 0x10, 20, 1),
666 	PIN_FIELD_BASE(209, 209, 5, 0x0050, 0x10, 12, 1),
667 	PIN_FIELD_BASE(210, 210, 5, 0x0050, 0x10, 11, 1),
668 	PIN_FIELD_BASE(211, 211, 5, 0x0050, 0x10, 13, 1),
669 	PIN_FIELD_BASE(212, 212, 5, 0x0050, 0x10, 10, 1),
670 	PIN_FIELD_BASE(213, 213, 5, 0x0050, 0x10, 14, 1),
671 	PIN_FIELD_BASE(214, 214, 5, 0x0050, 0x10, 0, 1),
672 	PIN_FIELD_BASE(215, 215, 5, 0x0050, 0x10, 9, 1),
673 	PIN_FIELD_BASE(216, 216, 5, 0x0050, 0x10, 4, 1),
674 	PIN_FIELD_BASE(217, 217, 5, 0x0050, 0x10, 5, 1),
675 	PIN_FIELD_BASE(218, 218, 5, 0x0050, 0x10, 1, 1),
676 	PIN_FIELD_BASE(219, 219, 5, 0x0050, 0x10, 2, 1),
677 };
678 
679 static const struct mtk_pin_field_calc mt8192_pin_pd_range[] = {
680 	PIN_FIELD_BASE(0, 0, 4, 0x0090, 0x10, 9, 1),
681 	PIN_FIELD_BASE(1, 1, 4, 0x0090, 0x10, 10, 1),
682 	PIN_FIELD_BASE(2, 2, 4, 0x0090, 0x10, 11, 1),
683 	PIN_FIELD_BASE(3, 3, 4, 0x0090, 0x10, 12, 1),
684 	PIN_FIELD_BASE(4, 4, 4, 0x0090, 0x10, 13, 1),
685 	PIN_FIELD_BASE(5, 5, 4, 0x0090, 0x10, 14, 1),
686 	PIN_FIELD_BASE(6, 6, 4, 0x0090, 0x10, 15, 1),
687 	PIN_FIELD_BASE(7, 7, 4, 0x0090, 0x10, 16, 1),
688 	PIN_FIELD_BASE(8, 8, 4, 0x0090, 0x10, 17, 1),
689 	PIN_FIELD_BASE(9, 9, 4, 0x0090, 0x10, 18, 1),
690 	PIN_FIELD_BASE(16, 16, 8, 0x0040, 0x10, 2, 1),
691 	PIN_FIELD_BASE(17, 17, 8, 0x0040, 0x10, 3, 1),
692 	PIN_FIELD_BASE(18, 18, 7, 0x0070, 0x10, 21, 1),
693 	PIN_FIELD_BASE(19, 19, 7, 0x0070, 0x10, 22, 1),
694 	PIN_FIELD_BASE(20, 20, 7, 0x0070, 0x10, 23, 1),
695 	PIN_FIELD_BASE(21, 21, 7, 0x0070, 0x10, 24, 1),
696 	PIN_FIELD_BASE(22, 22, 2, 0x0070, 0x10, 3, 1),
697 	PIN_FIELD_BASE(23, 23, 2, 0x0070, 0x10, 4, 1),
698 	PIN_FIELD_BASE(24, 24, 2, 0x0070, 0x10, 5, 1),
699 	PIN_FIELD_BASE(25, 25, 2, 0x0070, 0x10, 6, 1),
700 	PIN_FIELD_BASE(26, 26, 3, 0x0060, 0x10, 5, 1),
701 	PIN_FIELD_BASE(27, 27, 3, 0x0060, 0x10, 6, 1),
702 	PIN_FIELD_BASE(28, 28, 3, 0x0060, 0x10, 7, 1),
703 	PIN_FIELD_BASE(29, 29, 3, 0x0060, 0x10, 8, 1),
704 	PIN_FIELD_BASE(30, 30, 3, 0x0060, 0x10, 9, 1),
705 	PIN_FIELD_BASE(31, 31, 3, 0x0050, 0x10, 27, 1),
706 	PIN_FIELD_BASE(32, 32, 3, 0x0050, 0x10, 24, 1),
707 	PIN_FIELD_BASE(33, 33, 3, 0x0050, 0x10, 26, 1),
708 	PIN_FIELD_BASE(34, 34, 3, 0x0050, 0x10, 23, 1),
709 	PIN_FIELD_BASE(35, 35, 3, 0x0050, 0x10, 25, 1),
710 	PIN_FIELD_BASE(36, 36, 2, 0x0070, 0x10, 20, 1),
711 	PIN_FIELD_BASE(37, 37, 2, 0x0070, 0x10, 21, 1),
712 	PIN_FIELD_BASE(38, 38, 2, 0x0070, 0x10, 22, 1),
713 	PIN_FIELD_BASE(39, 39, 2, 0x0070, 0x10, 23, 1),
714 	PIN_FIELD_BASE(40, 40, 8, 0x0040, 0x10, 0, 1),
715 	PIN_FIELD_BASE(41, 41, 8, 0x0040, 0x10, 1, 1),
716 	PIN_FIELD_BASE(42, 42, 8, 0x0040, 0x10, 4, 1),
717 	PIN_FIELD_BASE(43, 43, 7, 0x0070, 0x10, 25, 1),
718 	PIN_FIELD_BASE(44, 44, 7, 0x0070, 0x10, 26, 1),
719 	PIN_FIELD_BASE(57, 57, 3, 0x0060, 0x10, 1, 1),
720 	PIN_FIELD_BASE(58, 58, 3, 0x0060, 0x10, 2, 1),
721 	PIN_FIELD_BASE(59, 59, 3, 0x0060, 0x10, 3, 1),
722 	PIN_FIELD_BASE(60, 60, 3, 0x0060, 0x10, 4, 1),
723 	PIN_FIELD_BASE(61, 61, 3, 0x0050, 0x10, 28, 1),
724 	PIN_FIELD_BASE(62, 62, 3, 0x0050, 0x10, 22, 1),
725 	PIN_FIELD_BASE(63, 63, 3, 0x0050, 0x10, 0, 1),
726 	PIN_FIELD_BASE(64, 64, 3, 0x0050, 0x10, 1, 1),
727 	PIN_FIELD_BASE(65, 65, 3, 0x0050, 0x10, 12, 1),
728 	PIN_FIELD_BASE(66, 66, 3, 0x0050, 0x10, 15, 1),
729 	PIN_FIELD_BASE(67, 67, 3, 0x0050, 0x10, 16, 1),
730 	PIN_FIELD_BASE(68, 68, 3, 0x0050, 0x10, 17, 1),
731 	PIN_FIELD_BASE(69, 69, 3, 0x0050, 0x10, 18, 1),
732 	PIN_FIELD_BASE(70, 70, 3, 0x0050, 0x10, 19, 1),
733 	PIN_FIELD_BASE(71, 71, 3, 0x0050, 0x10, 20, 1),
734 	PIN_FIELD_BASE(72, 72, 3, 0x0050, 0x10, 21, 1),
735 	PIN_FIELD_BASE(73, 73, 3, 0x0050, 0x10, 2, 1),
736 	PIN_FIELD_BASE(74, 74, 3, 0x0050, 0x10, 3, 1),
737 	PIN_FIELD_BASE(75, 75, 3, 0x0050, 0x10, 4, 1),
738 	PIN_FIELD_BASE(76, 76, 3, 0x0050, 0x10, 5, 1),
739 	PIN_FIELD_BASE(77, 77, 3, 0x0050, 0x10, 6, 1),
740 	PIN_FIELD_BASE(78, 78, 3, 0x0050, 0x10, 7, 1),
741 	PIN_FIELD_BASE(79, 79, 3, 0x0050, 0x10, 8, 1),
742 	PIN_FIELD_BASE(80, 80, 3, 0x0050, 0x10, 9, 1),
743 	PIN_FIELD_BASE(81, 81, 3, 0x0050, 0x10, 10, 1),
744 	PIN_FIELD_BASE(82, 82, 3, 0x0050, 0x10, 11, 1),
745 	PIN_FIELD_BASE(83, 83, 3, 0x0050, 0x10, 13, 1),
746 	PIN_FIELD_BASE(84, 84, 3, 0x0050, 0x10, 14, 1),
747 	PIN_FIELD_BASE(85, 85, 3, 0x0050, 0x10, 31, 1),
748 	PIN_FIELD_BASE(86, 86, 3, 0x0060, 0x10, 0, 1),
749 	PIN_FIELD_BASE(87, 87, 3, 0x0050, 0x10, 29, 1),
750 	PIN_FIELD_BASE(88, 88, 3, 0x0050, 0x10, 30, 1),
751 	PIN_FIELD_BASE(89, 89, 2, 0x0070, 0x10, 24, 1),
752 	PIN_FIELD_BASE(90, 90, 2, 0x0070, 0x10, 25, 1),
753 	PIN_FIELD_BASE(91, 91, 2, 0x0070, 0x10, 0, 1),
754 	PIN_FIELD_BASE(92, 92, 2, 0x0080, 0x10, 2, 1),
755 	PIN_FIELD_BASE(93, 93, 2, 0x0080, 0x10, 4, 1),
756 	PIN_FIELD_BASE(94, 94, 2, 0x0080, 0x10, 3, 1),
757 	PIN_FIELD_BASE(95, 95, 2, 0x0080, 0x10, 5, 1),
758 	PIN_FIELD_BASE(96, 96, 2, 0x0070, 0x10, 31, 1),
759 	PIN_FIELD_BASE(97, 97, 2, 0x0070, 0x10, 26, 1),
760 	PIN_FIELD_BASE(98, 98, 2, 0x0080, 0x10, 0, 1),
761 	PIN_FIELD_BASE(99, 99, 2, 0x0070, 0x10, 27, 1),
762 	PIN_FIELD_BASE(100, 100, 2, 0x0070, 0x10, 28, 1),
763 	PIN_FIELD_BASE(101, 101, 2, 0x0070, 0x10, 29, 1),
764 	PIN_FIELD_BASE(102, 102, 2, 0x0070, 0x10, 30, 1),
765 	PIN_FIELD_BASE(103, 103, 2, 0x0070, 0x10, 18, 1),
766 	PIN_FIELD_BASE(104, 104, 2, 0x0070, 0x10, 17, 1),
767 	PIN_FIELD_BASE(105, 105, 2, 0x0070, 0x10, 19, 1),
768 	PIN_FIELD_BASE(106, 106, 2, 0x0070, 0x10, 16, 1),
769 	PIN_FIELD_BASE(107, 107, 2, 0x0070, 0x10, 1, 1),
770 	PIN_FIELD_BASE(108, 108, 2, 0x0070, 0x10, 2, 1),
771 	PIN_FIELD_BASE(109, 109, 2, 0x0070, 0x10, 10, 1),
772 	PIN_FIELD_BASE(110, 110, 2, 0x0070, 0x10, 7, 1),
773 	PIN_FIELD_BASE(111, 111, 2, 0x0070, 0x10, 9, 1),
774 	PIN_FIELD_BASE(112, 112, 2, 0x0070, 0x10, 11, 1),
775 	PIN_FIELD_BASE(113, 113, 2, 0x0070, 0x10, 8, 1),
776 	PIN_FIELD_BASE(114, 114, 2, 0x0070, 0x10, 14, 1),
777 	PIN_FIELD_BASE(115, 115, 2, 0x0070, 0x10, 13, 1),
778 	PIN_FIELD_BASE(116, 116, 2, 0x0070, 0x10, 15, 1),
779 	PIN_FIELD_BASE(117, 117, 2, 0x0070, 0x10, 12, 1),
780 	PIN_FIELD_BASE(118, 118, 4, 0x0090, 0x10, 23, 1),
781 	PIN_FIELD_BASE(119, 119, 4, 0x0090, 0x10, 29, 1),
782 	PIN_FIELD_BASE(120, 120, 4, 0x0090, 0x10, 28, 1),
783 	PIN_FIELD_BASE(121, 121, 4, 0x00a0, 0x10, 2, 1),
784 	PIN_FIELD_BASE(122, 122, 4, 0x0090, 0x10, 27, 1),
785 	PIN_FIELD_BASE(123, 123, 4, 0x00a0, 0x10, 1, 1),
786 	PIN_FIELD_BASE(124, 124, 4, 0x0090, 0x10, 26, 1),
787 	PIN_FIELD_BASE(125, 125, 4, 0x00a0, 0x10, 0, 1),
788 	PIN_FIELD_BASE(126, 126, 4, 0x0090, 0x10, 19, 1),
789 	PIN_FIELD_BASE(127, 127, 4, 0x0090, 0x10, 20, 1),
790 	PIN_FIELD_BASE(128, 128, 4, 0x0090, 0x10, 21, 1),
791 	PIN_FIELD_BASE(129, 129, 4, 0x0090, 0x10, 22, 1),
792 	PIN_FIELD_BASE(130, 130, 4, 0x0090, 0x10, 6, 1),
793 	PIN_FIELD_BASE(131, 131, 4, 0x0090, 0x10, 7, 1),
794 	PIN_FIELD_BASE(132, 132, 4, 0x0090, 0x10, 8, 1),
795 	PIN_FIELD_BASE(133, 133, 4, 0x0090, 0x10, 3, 1),
796 	PIN_FIELD_BASE(134, 134, 4, 0x0090, 0x10, 4, 1),
797 	PIN_FIELD_BASE(135, 135, 4, 0x0090, 0x10, 5, 1),
798 	PIN_FIELD_BASE(136, 136, 4, 0x0090, 0x10, 0, 1),
799 	PIN_FIELD_BASE(137, 137, 4, 0x0090, 0x10, 1, 1),
800 	PIN_FIELD_BASE(138, 138, 4, 0x0090, 0x10, 2, 1),
801 	PIN_FIELD_BASE(139, 139, 4, 0x0090, 0x10, 25, 1),
802 	PIN_FIELD_BASE(140, 140, 4, 0x0090, 0x10, 31, 1),
803 	PIN_FIELD_BASE(141, 141, 4, 0x0090, 0x10, 24, 1),
804 	PIN_FIELD_BASE(142, 142, 4, 0x0090, 0x10, 30, 1),
805 	PIN_FIELD_BASE(143, 143, 1, 0x0050, 0x10, 6, 1),
806 	PIN_FIELD_BASE(144, 144, 1, 0x0050, 0x10, 7, 1),
807 	PIN_FIELD_BASE(145, 145, 1, 0x0050, 0x10, 8, 1),
808 	PIN_FIELD_BASE(146, 146, 1, 0x0050, 0x10, 3, 1),
809 	PIN_FIELD_BASE(147, 147, 1, 0x0050, 0x10, 4, 1),
810 	PIN_FIELD_BASE(148, 148, 1, 0x0050, 0x10, 5, 1),
811 	PIN_FIELD_BASE(149, 149, 1, 0x0050, 0x10, 0, 1),
812 	PIN_FIELD_BASE(150, 150, 1, 0x0050, 0x10, 1, 1),
813 	PIN_FIELD_BASE(151, 151, 1, 0x0050, 0x10, 2, 1),
814 	PIN_FIELD_BASE(156, 156, 7, 0x0070, 0x10, 29, 1),
815 	PIN_FIELD_BASE(157, 157, 7, 0x0070, 0x10, 30, 1),
816 	PIN_FIELD_BASE(158, 158, 7, 0x0070, 0x10, 31, 1),
817 	PIN_FIELD_BASE(159, 159, 7, 0x0080, 0x10, 0, 1),
818 	PIN_FIELD_BASE(160, 160, 7, 0x0070, 0x10, 27, 1),
819 	PIN_FIELD_BASE(161, 161, 7, 0x0070, 0x10, 28, 1),
820 	PIN_FIELD_BASE(162, 162, 7, 0x0070, 0x10, 0, 1),
821 	PIN_FIELD_BASE(163, 163, 7, 0x0070, 0x10, 1, 1),
822 	PIN_FIELD_BASE(164, 164, 7, 0x0070, 0x10, 2, 1),
823 	PIN_FIELD_BASE(165, 165, 7, 0x0070, 0x10, 3, 1),
824 	PIN_FIELD_BASE(166, 166, 7, 0x0070, 0x10, 4, 1),
825 	PIN_FIELD_BASE(167, 167, 7, 0x0070, 0x10, 5, 1),
826 	PIN_FIELD_BASE(168, 168, 7, 0x0070, 0x10, 6, 1),
827 	PIN_FIELD_BASE(169, 169, 7, 0x0070, 0x10, 7, 1),
828 	PIN_FIELD_BASE(170, 170, 7, 0x0070, 0x10, 8, 1),
829 	PIN_FIELD_BASE(171, 171, 7, 0x0070, 0x10, 9, 1),
830 	PIN_FIELD_BASE(172, 172, 7, 0x0070, 0x10, 13, 1),
831 	PIN_FIELD_BASE(173, 173, 7, 0x0070, 0x10, 14, 1),
832 	PIN_FIELD_BASE(174, 174, 7, 0x0070, 0x10, 12, 1),
833 	PIN_FIELD_BASE(175, 175, 7, 0x0070, 0x10, 15, 1),
834 	PIN_FIELD_BASE(176, 176, 7, 0x0070, 0x10, 10, 1),
835 	PIN_FIELD_BASE(177, 177, 7, 0x0070, 0x10, 11, 1),
836 	PIN_FIELD_BASE(178, 178, 7, 0x0070, 0x10, 16, 1),
837 	PIN_FIELD_BASE(179, 179, 7, 0x0070, 0x10, 17, 1),
838 	PIN_FIELD_BASE(180, 180, 7, 0x0070, 0x10, 18, 1),
839 	PIN_FIELD_BASE(181, 181, 7, 0x0070, 0x10, 19, 1),
840 	PIN_FIELD_BASE(182, 182, 7, 0x0070, 0x10, 20, 1),
841 	PIN_FIELD_BASE(195, 195, 5, 0x0040, 0x10, 16, 1),
842 	PIN_FIELD_BASE(196, 196, 5, 0x0040, 0x10, 6, 1),
843 	PIN_FIELD_BASE(197, 197, 5, 0x0040, 0x10, 8, 1),
844 	PIN_FIELD_BASE(198, 198, 5, 0x0040, 0x10, 7, 1),
845 	PIN_FIELD_BASE(199, 199, 5, 0x0040, 0x10, 3, 1),
846 	PIN_FIELD_BASE(200, 200, 8, 0x0040, 0x10, 6, 1),
847 	PIN_FIELD_BASE(201, 201, 8, 0x0040, 0x10, 8, 1),
848 	PIN_FIELD_BASE(202, 202, 5, 0x0040, 0x10, 15, 1),
849 	PIN_FIELD_BASE(203, 203, 5, 0x0040, 0x10, 17, 1),
850 	PIN_FIELD_BASE(204, 204, 8, 0x0040, 0x10, 5, 1),
851 	PIN_FIELD_BASE(205, 205, 8, 0x0040, 0x10, 7, 1),
852 	PIN_FIELD_BASE(206, 206, 5, 0x0040, 0x10, 18, 1),
853 	PIN_FIELD_BASE(207, 207, 5, 0x0040, 0x10, 19, 1),
854 	PIN_FIELD_BASE(208, 208, 5, 0x0040, 0x10, 20, 1),
855 	PIN_FIELD_BASE(209, 209, 5, 0x0040, 0x10, 12, 1),
856 	PIN_FIELD_BASE(210, 210, 5, 0x0040, 0x10, 11, 1),
857 	PIN_FIELD_BASE(211, 211, 5, 0x0040, 0x10, 13, 1),
858 	PIN_FIELD_BASE(212, 212, 5, 0x0040, 0x10, 10, 1),
859 	PIN_FIELD_BASE(213, 213, 5, 0x0040, 0x10, 14, 1),
860 	PIN_FIELD_BASE(214, 214, 5, 0x0040, 0x10, 0, 1),
861 	PIN_FIELD_BASE(215, 215, 5, 0x0040, 0x10, 9, 1),
862 	PIN_FIELD_BASE(216, 216, 5, 0x0040, 0x10, 4, 1),
863 	PIN_FIELD_BASE(217, 217, 5, 0x0040, 0x10, 5, 1),
864 	PIN_FIELD_BASE(218, 218, 5, 0x0040, 0x10, 1, 1),
865 	PIN_FIELD_BASE(219, 219, 5, 0x0040, 0x10, 2, 1),
866 };
867 
868 static const struct mtk_pin_field_calc mt8192_pin_drv_range[] = {
869 	PIN_FIELD_BASE(0, 0, 4, 0x0000, 0x10, 18, 3),
870 	PIN_FIELD_BASE(1, 1, 4, 0x0000, 0x10, 21, 3),
871 	PIN_FIELD_BASE(2, 2, 4, 0x0000, 0x10, 24, 3),
872 	PIN_FIELD_BASE(3, 3, 4, 0x0000, 0x10, 27, 3),
873 	PIN_FIELD_BASE(4, 4, 4, 0x0010, 0x10, 0, 3),
874 	PIN_FIELD_BASE(5, 5, 4, 0x0010, 0x10, 3, 3),
875 	PIN_FIELD_BASE(6, 6, 4, 0x0010, 0x10, 6, 3),
876 	PIN_FIELD_BASE(7, 7, 4, 0x0010, 0x10, 9, 3),
877 	PIN_FIELD_BASE(8, 8, 4, 0x0010, 0x10, 12, 3),
878 	PIN_FIELD_BASE(9, 9, 4, 0x0010, 0x10, 15, 3),
879 	PIN_FIELD_BASE(10, 10, 6, 0x0000, 0x10, 0, 3),
880 	PIN_FIELD_BASE(11, 11, 6, 0x0000, 0x10, 3, 3),
881 	PIN_FIELD_BASE(12, 12, 6, 0x0000, 0x10, 6, 3),
882 	PIN_FIELD_BASE(13, 13, 6, 0x0000, 0x10, 9, 3),
883 	PIN_FIELD_BASE(14, 14, 6, 0x0000, 0x10, 12, 3),
884 	PIN_FIELD_BASE(15, 15, 6, 0x0000, 0x10, 15, 3),
885 	PIN_FIELD_BASE(16, 16, 8, 0x0000, 0x10, 0, 3),
886 	PIN_FIELD_BASE(17, 17, 8, 0x0000, 0x10, 0, 3),
887 	PIN_FIELD_BASE(18, 18, 7, 0x0010, 0x10, 15, 3),
888 	PIN_FIELD_BASE(19, 19, 7, 0x0010, 0x10, 15, 3),
889 	PIN_FIELD_BASE(20, 20, 7, 0x0010, 0x10, 18, 3),
890 	PIN_FIELD_BASE(21, 21, 7, 0x0010, 0x10, 18, 3),
891 	PIN_FIELD_BASE(22, 22, 2, 0x0000, 0x10, 6, 3),
892 	PIN_FIELD_BASE(23, 23, 2, 0x0000, 0x10, 9, 3),
893 	PIN_FIELD_BASE(24, 24, 2, 0x0000, 0x10, 12, 3),
894 	PIN_FIELD_BASE(25, 25, 2, 0x0000, 0x10, 15, 3),
895 	PIN_FIELD_BASE(26, 26, 3, 0x0000, 0x10, 15, 3),
896 	PIN_FIELD_BASE(27, 27, 3, 0x0000, 0x10, 18, 3),
897 	PIN_FIELD_BASE(28, 28, 3, 0x0000, 0x10, 21, 3),
898 	PIN_FIELD_BASE(29, 29, 3, 0x0000, 0x10, 24, 3),
899 	PIN_FIELD_BASE(30, 30, 3, 0x0000, 0x10, 27, 3),
900 	PIN_FIELD_BASE(31, 31, 3, 0x0000, 0x10, 12, 3),
901 	PIN_FIELD_BASE(32, 32, 3, 0x0000, 0x10, 3, 3),
902 	PIN_FIELD_BASE(33, 33, 3, 0x0000, 0x10, 9, 3),
903 	PIN_FIELD_BASE(34, 34, 3, 0x0000, 0x10, 0, 3),
904 	PIN_FIELD_BASE(35, 35, 3, 0x0000, 0x10, 6, 3),
905 	PIN_FIELD_BASE(36, 36, 2, 0x0010, 0x10, 21, 3),
906 	PIN_FIELD_BASE(37, 37, 2, 0x0010, 0x10, 24, 3),
907 	PIN_FIELD_BASE(38, 38, 2, 0x0010, 0x10, 27, 3),
908 	PIN_FIELD_BASE(39, 39, 2, 0x0020, 0x10, 0, 3),
909 	PIN_FIELD_BASE(40, 40, 8, 0x0000, 0x10, 0, 3),
910 	PIN_FIELD_BASE(41, 41, 8, 0x0000, 0x10, 0, 3),
911 	PIN_FIELD_BASE(42, 42, 8, 0x0000, 0x10, 3, 3),
912 	PIN_FIELD_BASE(43, 43, 7, 0x0010, 0x10, 15, 3),
913 	PIN_FIELD_BASE(44, 44, 7, 0x0010, 0x10, 15, 3),
914 	PIN_FIELD_BASE(45, 45, 1, 0x0010, 0x10, 6, 2),
915 	PIN_FIELD_BASE(46, 46, 1, 0x0010, 0x10, 6, 2),
916 	PIN_FIELD_BASE(47, 47, 1, 0x0010, 0x10, 6, 2),
917 	PIN_FIELD_BASE(48, 48, 1, 0x0010, 0x10, 8, 2),
918 	PIN_FIELD_BASE(49, 49, 1, 0x0010, 0x10, 8, 2),
919 	PIN_FIELD_BASE(50, 50, 1, 0x0010, 0x10, 8, 2),
920 	PIN_FIELD_BASE(51, 51, 1, 0x0000, 0x10, 12, 3),
921 	PIN_FIELD_BASE(52, 52, 1, 0x0000, 0x10, 15, 3),
922 	PIN_FIELD_BASE(53, 53, 1, 0x0000, 0x10, 27, 3),
923 	PIN_FIELD_BASE(54, 54, 1, 0x0000, 0x10, 18, 3),
924 	PIN_FIELD_BASE(55, 55, 1, 0x0000, 0x10, 24, 3),
925 	PIN_FIELD_BASE(56, 56, 1, 0x0000, 0x10, 21, 3),
926 	PIN_FIELD_BASE(57, 57, 3, 0x0010, 0x10, 24, 3),
927 	PIN_FIELD_BASE(58, 58, 3, 0x0010, 0x10, 24, 3),
928 	PIN_FIELD_BASE(59, 59, 3, 0x0010, 0x10, 27, 3),
929 	PIN_FIELD_BASE(60, 60, 3, 0x0010, 0x10, 27, 3),
930 	PIN_FIELD_BASE(61, 61, 3, 0x0020, 0x10, 0, 3),
931 	PIN_FIELD_BASE(62, 62, 3, 0x0020, 0x10, 0, 3),
932 	PIN_FIELD_BASE(63, 63, 3, 0x0010, 0x10, 0, 3),
933 	PIN_FIELD_BASE(64, 64, 3, 0x0010, 0x10, 0, 3),
934 	PIN_FIELD_BASE(65, 65, 3, 0x0010, 0x10, 0, 3),
935 	PIN_FIELD_BASE(66, 66, 3, 0x0010, 0x10, 0, 3),
936 	PIN_FIELD_BASE(67, 67, 3, 0x0010, 0x10, 3, 3),
937 	PIN_FIELD_BASE(68, 68, 3, 0x0010, 0x10, 3, 3),
938 	PIN_FIELD_BASE(69, 69, 3, 0x0010, 0x10, 3, 3),
939 	PIN_FIELD_BASE(70, 70, 3, 0x0010, 0x10, 3, 3),
940 	PIN_FIELD_BASE(71, 71, 3, 0x0010, 0x10, 6, 3),
941 	PIN_FIELD_BASE(72, 72, 3, 0x0010, 0x10, 6, 3),
942 	PIN_FIELD_BASE(73, 73, 3, 0x0010, 0x10, 6, 3),
943 	PIN_FIELD_BASE(74, 74, 3, 0x0010, 0x10, 6, 3),
944 	PIN_FIELD_BASE(75, 75, 3, 0x0010, 0x10, 9, 3),
945 	PIN_FIELD_BASE(76, 76, 3, 0x0010, 0x10, 9, 3),
946 	PIN_FIELD_BASE(77, 77, 3, 0x0010, 0x10, 9, 3),
947 	PIN_FIELD_BASE(78, 78, 3, 0x0010, 0x10, 9, 3),
948 	PIN_FIELD_BASE(79, 79, 3, 0x0010, 0x10, 12, 3),
949 	PIN_FIELD_BASE(80, 80, 3, 0x0010, 0x10, 12, 3),
950 	PIN_FIELD_BASE(81, 81, 3, 0x0010, 0x10, 12, 3),
951 	PIN_FIELD_BASE(82, 82, 3, 0x0010, 0x10, 12, 3),
952 	PIN_FIELD_BASE(83, 83, 3, 0x0010, 0x10, 15, 3),
953 	PIN_FIELD_BASE(84, 84, 3, 0x0010, 0x10, 15, 3),
954 	PIN_FIELD_BASE(85, 85, 3, 0x0010, 0x10, 21, 3),
955 	PIN_FIELD_BASE(86, 86, 3, 0x0010, 0x10, 21, 3),
956 	PIN_FIELD_BASE(87, 87, 3, 0x0010, 0x10, 18, 3),
957 	PIN_FIELD_BASE(88, 88, 3, 0x0010, 0x10, 18, 3),
958 	PIN_FIELD_BASE(89, 89, 2, 0x0020, 0x10, 3, 3),
959 	PIN_FIELD_BASE(90, 90, 2, 0x0020, 0x10, 6, 3),
960 	PIN_FIELD_BASE(91, 91, 2, 0x0010, 0x10, 3, 3),
961 	PIN_FIELD_BASE(92, 92, 2, 0x0010, 0x10, 3, 3),
962 	PIN_FIELD_BASE(93, 93, 2, 0x0010, 0x10, 3, 3),
963 	PIN_FIELD_BASE(94, 94, 2, 0x0010, 0x10, 3, 3),
964 	PIN_FIELD_BASE(95, 95, 2, 0x0010, 0x10, 3, 3),
965 	PIN_FIELD_BASE(96, 96, 2, 0x0020, 0x10, 24, 3),
966 	PIN_FIELD_BASE(97, 97, 2, 0x0020, 0x10, 9, 3),
967 	PIN_FIELD_BASE(98, 98, 2, 0x0020, 0x10, 27, 3),
968 	PIN_FIELD_BASE(99, 99, 2, 0x0020, 0x10, 12, 3),
969 	PIN_FIELD_BASE(100, 100, 2, 0x0020, 0x10, 15, 3),
970 	PIN_FIELD_BASE(101, 101, 2, 0x0020, 0x10, 18, 3),
971 	PIN_FIELD_BASE(102, 102, 2, 0x0020, 0x10, 21, 3),
972 	PIN_FIELD_BASE(103, 103, 2, 0x0010, 0x10, 6, 3),
973 	PIN_FIELD_BASE(104, 104, 2, 0x0010, 0x10, 6, 3),
974 	PIN_FIELD_BASE(105, 105, 2, 0x0010, 0x10, 6, 3),
975 	PIN_FIELD_BASE(106, 106, 2, 0x0010, 0x10, 6, 3),
976 	PIN_FIELD_BASE(107, 107, 2, 0x0000, 0x10, 0, 3),
977 	PIN_FIELD_BASE(108, 108, 2, 0x0000, 0x10, 3, 3),
978 	PIN_FIELD_BASE(109, 109, 2, 0x0000, 0x10, 27, 3),
979 	PIN_FIELD_BASE(110, 110, 2, 0x0000, 0x10, 18, 3),
980 	PIN_FIELD_BASE(111, 111, 2, 0x0000, 0x10, 24, 3),
981 	PIN_FIELD_BASE(112, 112, 2, 0x0010, 0x10, 0, 3),
982 	PIN_FIELD_BASE(113, 113, 2, 0x0000, 0x10, 21, 3),
983 	PIN_FIELD_BASE(114, 114, 2, 0x0010, 0x10, 15, 3),
984 	PIN_FIELD_BASE(115, 115, 2, 0x0010, 0x10, 12, 3),
985 	PIN_FIELD_BASE(116, 116, 2, 0x0010, 0x10, 18, 3),
986 	PIN_FIELD_BASE(117, 117, 2, 0x0010, 0x10, 9, 3),
987 	PIN_FIELD_BASE(118, 118, 4, 0x0020, 0x10, 3, 3),
988 	PIN_FIELD_BASE(119, 119, 4, 0x0020, 0x10, 21, 3),
989 	PIN_FIELD_BASE(120, 120, 4, 0x0020, 0x10, 18, 3),
990 	PIN_FIELD_BASE(121, 121, 4, 0x0030, 0x10, 6, 3),
991 	PIN_FIELD_BASE(122, 122, 4, 0x0020, 0x10, 15, 3),
992 	PIN_FIELD_BASE(123, 123, 4, 0x0030, 0x10, 3, 3),
993 	PIN_FIELD_BASE(124, 124, 4, 0x0020, 0x10, 12, 3),
994 	PIN_FIELD_BASE(125, 125, 4, 0x0030, 0x10, 0, 3),
995 	PIN_FIELD_BASE(126, 126, 4, 0x0010, 0x10, 18, 3),
996 	PIN_FIELD_BASE(127, 127, 4, 0x0010, 0x10, 21, 3),
997 	PIN_FIELD_BASE(128, 128, 4, 0x0010, 0x10, 24, 3),
998 	PIN_FIELD_BASE(129, 129, 4, 0x0010, 0x10, 27, 3),
999 	PIN_FIELD_BASE(130, 130, 4, 0x0000, 0x10, 9, 3),
1000 	PIN_FIELD_BASE(131, 131, 4, 0x0000, 0x10, 12, 3),
1001 	PIN_FIELD_BASE(132, 132, 4, 0x0000, 0x10, 15, 3),
1002 	PIN_FIELD_BASE(133, 133, 4, 0x0020, 0x10, 0, 3),
1003 	PIN_FIELD_BASE(134, 134, 4, 0x0020, 0x10, 0, 3),
1004 	PIN_FIELD_BASE(135, 135, 4, 0x0020, 0x10, 0, 3),
1005 	PIN_FIELD_BASE(136, 136, 4, 0x0000, 0x10, 0, 3),
1006 	PIN_FIELD_BASE(137, 137, 4, 0x0000, 0x10, 3, 3),
1007 	PIN_FIELD_BASE(138, 138, 4, 0x0000, 0x10, 6, 3),
1008 	PIN_FIELD_BASE(139, 139, 4, 0x0020, 0x10, 9, 3),
1009 	PIN_FIELD_BASE(140, 140, 4, 0x0020, 0x10, 27, 3),
1010 	PIN_FIELD_BASE(141, 141, 4, 0x0020, 0x10, 6, 3),
1011 	PIN_FIELD_BASE(142, 142, 4, 0x0020, 0x10, 24, 3),
1012 	PIN_FIELD_BASE(143, 143, 1, 0x0010, 0x10, 0, 3),
1013 	PIN_FIELD_BASE(144, 144, 1, 0x0010, 0x10, 0, 3),
1014 	PIN_FIELD_BASE(145, 145, 1, 0x0010, 0x10, 3, 3),
1015 	PIN_FIELD_BASE(146, 146, 1, 0x0010, 0x10, 0, 3),
1016 	PIN_FIELD_BASE(147, 147, 1, 0x0010, 0x10, 0, 3),
1017 	PIN_FIELD_BASE(148, 148, 1, 0x0000, 0x10, 9, 3),
1018 	PIN_FIELD_BASE(149, 149, 1, 0x0000, 0x10, 0, 3),
1019 	PIN_FIELD_BASE(150, 150, 1, 0x0000, 0x10, 3, 3),
1020 	PIN_FIELD_BASE(151, 151, 1, 0x0000, 0x10, 6, 3),
1021 	PIN_FIELD_BASE(152, 152, 7, 0x0010, 0x10, 21, 3),
1022 	PIN_FIELD_BASE(153, 153, 7, 0x0010, 0x10, 21, 3),
1023 	PIN_FIELD_BASE(154, 154, 7, 0x0010, 0x10, 21, 3),
1024 	PIN_FIELD_BASE(155, 155, 7, 0x0010, 0x10, 21, 3),
1025 	PIN_FIELD_BASE(156, 156, 7, 0x0020, 0x10, 3, 3),
1026 	PIN_FIELD_BASE(157, 157, 7, 0x0020, 0x10, 6, 3),
1027 	PIN_FIELD_BASE(158, 158, 7, 0x0020, 0x10, 9, 3),
1028 	PIN_FIELD_BASE(159, 159, 7, 0x0020, 0x10, 12, 3),
1029 	PIN_FIELD_BASE(160, 160, 7, 0x0010, 0x10, 27, 3),
1030 	PIN_FIELD_BASE(161, 161, 7, 0x0020, 0x10, 0, 3),
1031 	PIN_FIELD_BASE(162, 162, 7, 0x0000, 0x10, 0, 3),
1032 	PIN_FIELD_BASE(163, 163, 7, 0x0000, 0x10, 3, 3),
1033 	PIN_FIELD_BASE(164, 164, 7, 0x0010, 0x10, 24, 3),
1034 	PIN_FIELD_BASE(165, 165, 7, 0x0010, 0x10, 24, 3),
1035 	PIN_FIELD_BASE(166, 166, 7, 0x0010, 0x10, 24, 3),
1036 	PIN_FIELD_BASE(167, 167, 7, 0x0010, 0x10, 24, 3),
1037 	PIN_FIELD_BASE(168, 168, 7, 0x0000, 0x10, 6, 3),
1038 	PIN_FIELD_BASE(169, 169, 7, 0x0000, 0x10, 9, 3),
1039 	PIN_FIELD_BASE(170, 170, 7, 0x0010, 0x10, 24, 3),
1040 	PIN_FIELD_BASE(171, 171, 7, 0x0010, 0x10, 24, 3),
1041 	PIN_FIELD_BASE(172, 172, 7, 0x0000, 0x10, 21, 3),
1042 	PIN_FIELD_BASE(173, 173, 7, 0x0000, 0x10, 24, 3),
1043 	PIN_FIELD_BASE(174, 174, 7, 0x0000, 0x10, 18, 3),
1044 	PIN_FIELD_BASE(175, 175, 7, 0x0000, 0x10, 27, 3),
1045 	PIN_FIELD_BASE(176, 176, 7, 0x0000, 0x10, 12, 3),
1046 	PIN_FIELD_BASE(177, 177, 7, 0x0000, 0x10, 15, 3),
1047 	PIN_FIELD_BASE(178, 178, 7, 0x0010, 0x10, 0, 3),
1048 	PIN_FIELD_BASE(179, 179, 7, 0x0010, 0x10, 3, 3),
1049 	PIN_FIELD_BASE(180, 180, 7, 0x0010, 0x10, 6, 3),
1050 	PIN_FIELD_BASE(181, 181, 7, 0x0010, 0x10, 9, 3),
1051 	PIN_FIELD_BASE(182, 182, 7, 0x0010, 0x10, 12, 3),
1052 	PIN_FIELD_BASE(183, 183, 9, 0x0000, 0x10, 3, 3),
1053 	PIN_FIELD_BASE(184, 184, 9, 0x0000, 0x10, 6, 3),
1054 	PIN_FIELD_BASE(185, 185, 9, 0x0000, 0x10, 12, 3),
1055 	PIN_FIELD_BASE(186, 186, 9, 0x0000, 0x10, 18, 3),
1056 	PIN_FIELD_BASE(187, 187, 9, 0x0000, 0x10, 24, 3),
1057 	PIN_FIELD_BASE(188, 188, 9, 0x0000, 0x10, 9, 3),
1058 	PIN_FIELD_BASE(189, 189, 9, 0x0000, 0x10, 21, 3),
1059 	PIN_FIELD_BASE(190, 190, 9, 0x0000, 0x10, 27, 3),
1060 	PIN_FIELD_BASE(191, 191, 9, 0x0010, 0x10, 0, 3),
1061 	PIN_FIELD_BASE(192, 192, 9, 0x0000, 0x10, 0, 3),
1062 	PIN_FIELD_BASE(193, 193, 9, 0x0000, 0x10, 15, 3),
1063 	PIN_FIELD_BASE(194, 194, 9, 0x0010, 0x10, 3, 3),
1064 	PIN_FIELD_BASE(195, 195, 5, 0x0010, 0x10, 3, 3),
1065 	PIN_FIELD_BASE(196, 196, 5, 0x0000, 0x10, 18, 3),
1066 	PIN_FIELD_BASE(197, 197, 5, 0x0000, 0x10, 24, 3),
1067 	PIN_FIELD_BASE(198, 198, 5, 0x0000, 0x10, 21, 3),
1068 	PIN_FIELD_BASE(199, 199, 5, 0x0000, 0x10, 9, 3),
1069 	PIN_FIELD_BASE(200, 200, 8, 0x0000, 0x10, 9, 3),
1070 	PIN_FIELD_BASE(201, 201, 8, 0x0000, 0x10, 15, 3),
1071 	PIN_FIELD_BASE(202, 202, 5, 0x0010, 0x10, 6, 3),
1072 	PIN_FIELD_BASE(203, 203, 5, 0x0010, 0x10, 9, 3),
1073 	PIN_FIELD_BASE(204, 204, 8, 0x0000, 0x10, 6, 3),
1074 	PIN_FIELD_BASE(205, 205, 8, 0x0000, 0x10, 12, 3),
1075 	PIN_FIELD_BASE(206, 206, 5, 0x0010, 0x10, 3, 3),
1076 	PIN_FIELD_BASE(207, 207, 5, 0x0010, 0x10, 3, 3),
1077 	PIN_FIELD_BASE(208, 208, 5, 0x0010, 0x10, 12, 3),
1078 	PIN_FIELD_BASE(209, 209, 5, 0x0010, 0x10, 0, 3),
1079 	PIN_FIELD_BASE(210, 210, 5, 0x0010, 0x10, 0, 3),
1080 	PIN_FIELD_BASE(211, 211, 5, 0x0010, 0x10, 0, 3),
1081 	PIN_FIELD_BASE(212, 212, 5, 0x0010, 0x10, 0, 3),
1082 	PIN_FIELD_BASE(213, 213, 5, 0x0010, 0x10, 3, 3),
1083 	PIN_FIELD_BASE(214, 214, 5, 0x0000, 0x10, 0, 3),
1084 	PIN_FIELD_BASE(215, 215, 5, 0x0000, 0x10, 27, 3),
1085 	PIN_FIELD_BASE(216, 216, 5, 0x0000, 0x10, 12, 3),
1086 	PIN_FIELD_BASE(217, 217, 5, 0x0000, 0x10, 15, 3),
1087 	PIN_FIELD_BASE(218, 218, 5, 0x0000, 0x10, 3, 3),
1088 	PIN_FIELD_BASE(219, 219, 5, 0x0000, 0x10, 6, 3),
1089 };
1090 
1091 static const struct mtk_pin_field_calc mt8192_pin_pupd_range[] = {
1092 	PIN_FIELD_BASE(10, 10, 6, 0x0020, 0x10, 0, 1),
1093 	PIN_FIELD_BASE(11, 11, 6, 0x0020, 0x10, 1, 1),
1094 	PIN_FIELD_BASE(12, 12, 6, 0x0020, 0x10, 2, 1),
1095 	PIN_FIELD_BASE(13, 13, 6, 0x0020, 0x10, 3, 1),
1096 	PIN_FIELD_BASE(14, 14, 6, 0x0020, 0x10, 4, 1),
1097 	PIN_FIELD_BASE(15, 15, 6, 0x0020, 0x10, 5, 1),
1098 	PIN_FIELD_BASE(45, 45, 1, 0x0060, 0x10, 9, 1),
1099 	PIN_FIELD_BASE(46, 46, 1, 0x0060, 0x10, 11, 1),
1100 	PIN_FIELD_BASE(47, 47, 1, 0x0060, 0x10, 10, 1),
1101 	PIN_FIELD_BASE(48, 48, 1, 0x0060, 0x10, 7, 1),
1102 	PIN_FIELD_BASE(49, 49, 1, 0x0060, 0x10, 8, 1),
1103 	PIN_FIELD_BASE(50, 50, 1, 0x0060, 0x10, 6, 1),
1104 	PIN_FIELD_BASE(51, 51, 1, 0x0060, 0x10, 0, 1),
1105 	PIN_FIELD_BASE(52, 52, 1, 0x0060, 0x10, 1, 1),
1106 	PIN_FIELD_BASE(53, 53, 1, 0x0060, 0x10, 5, 1),
1107 	PIN_FIELD_BASE(54, 54, 1, 0x0060, 0x10, 2, 1),
1108 	PIN_FIELD_BASE(55, 55, 1, 0x0060, 0x10, 4, 1),
1109 	PIN_FIELD_BASE(56, 56, 1, 0x0060, 0x10, 3, 1),
1110 	PIN_FIELD_BASE(152, 152, 7, 0x0090, 0x10, 3, 1),
1111 	PIN_FIELD_BASE(153, 153, 7, 0x0090, 0x10, 2, 1),
1112 	PIN_FIELD_BASE(154, 154, 7, 0x0090, 0x10, 0, 1),
1113 	PIN_FIELD_BASE(155, 155, 7, 0x0090, 0x10, 1, 1),
1114 	PIN_FIELD_BASE(183, 183, 9, 0x0030, 0x10, 1, 1),
1115 	PIN_FIELD_BASE(184, 184, 9, 0x0030, 0x10, 2, 1),
1116 	PIN_FIELD_BASE(185, 185, 9, 0x0030, 0x10, 4, 1),
1117 	PIN_FIELD_BASE(186, 186, 9, 0x0030, 0x10, 6, 1),
1118 	PIN_FIELD_BASE(187, 187, 9, 0x0030, 0x10, 8, 1),
1119 	PIN_FIELD_BASE(188, 188, 9, 0x0030, 0x10, 3, 1),
1120 	PIN_FIELD_BASE(189, 189, 9, 0x0030, 0x10, 7, 1),
1121 	PIN_FIELD_BASE(190, 190, 9, 0x0030, 0x10, 9, 1),
1122 	PIN_FIELD_BASE(191, 191, 9, 0x0030, 0x10, 10, 1),
1123 	PIN_FIELD_BASE(192, 192, 9, 0x0030, 0x10, 0, 1),
1124 	PIN_FIELD_BASE(193, 193, 9, 0x0030, 0x10, 5, 1),
1125 	PIN_FIELD_BASE(194, 194, 9, 0x0030, 0x10, 11, 1),
1126 };
1127 
1128 static const struct mtk_pin_field_calc mt8192_pin_r0_range[] = {
1129 	PIN_FIELD_BASE(10, 10, 6, 0x0030, 0x10, 0, 1),
1130 	PIN_FIELD_BASE(11, 11, 6, 0x0030, 0x10, 1, 1),
1131 	PIN_FIELD_BASE(12, 12, 6, 0x0030, 0x10, 2, 1),
1132 	PIN_FIELD_BASE(13, 13, 6, 0x0030, 0x10, 3, 1),
1133 	PIN_FIELD_BASE(14, 14, 6, 0x0030, 0x10, 4, 1),
1134 	PIN_FIELD_BASE(15, 15, 6, 0x0030, 0x10, 5, 1),
1135 	PIN_FIELD_BASE(45, 45, 1, 0x0080, 0x10, 9, 1),
1136 	PIN_FIELD_BASE(46, 46, 1, 0x0080, 0x10, 11, 1),
1137 	PIN_FIELD_BASE(47, 47, 1, 0x0080, 0x10, 10, 1),
1138 	PIN_FIELD_BASE(48, 48, 1, 0x0080, 0x10, 7, 1),
1139 	PIN_FIELD_BASE(49, 49, 1, 0x0080, 0x10, 8, 1),
1140 	PIN_FIELD_BASE(50, 50, 1, 0x0080, 0x10, 6, 1),
1141 	PIN_FIELD_BASE(51, 51, 1, 0x0080, 0x10, 0, 1),
1142 	PIN_FIELD_BASE(52, 52, 1, 0x0080, 0x10, 1, 1),
1143 	PIN_FIELD_BASE(53, 53, 1, 0x0080, 0x10, 5, 1),
1144 	PIN_FIELD_BASE(54, 54, 1, 0x0080, 0x10, 2, 1),
1145 	PIN_FIELD_BASE(55, 55, 1, 0x0080, 0x10, 4, 1),
1146 	PIN_FIELD_BASE(56, 56, 1, 0x0080, 0x10, 3, 1),
1147 	PIN_FIELD_BASE(152, 152, 7, 0x00c0, 0x10, 3, 1),
1148 	PIN_FIELD_BASE(153, 153, 7, 0x00c0, 0x10, 2, 1),
1149 	PIN_FIELD_BASE(154, 154, 7, 0x00c0, 0x10, 0, 1),
1150 	PIN_FIELD_BASE(155, 155, 7, 0x00c0, 0x10, 1, 1),
1151 	PIN_FIELD_BASE(183, 183, 9, 0x0040, 0x10, 1, 1),
1152 	PIN_FIELD_BASE(184, 184, 9, 0x0040, 0x10, 2, 1),
1153 	PIN_FIELD_BASE(185, 185, 9, 0x0040, 0x10, 4, 1),
1154 	PIN_FIELD_BASE(186, 186, 9, 0x0040, 0x10, 6, 1),
1155 	PIN_FIELD_BASE(187, 187, 9, 0x0040, 0x10, 8, 1),
1156 	PIN_FIELD_BASE(188, 188, 9, 0x0040, 0x10, 3, 1),
1157 	PIN_FIELD_BASE(189, 189, 9, 0x0040, 0x10, 7, 1),
1158 	PIN_FIELD_BASE(190, 190, 9, 0x0040, 0x10, 9, 1),
1159 	PIN_FIELD_BASE(191, 191, 9, 0x0040, 0x10, 10, 1),
1160 	PIN_FIELD_BASE(192, 192, 9, 0x0040, 0x10, 0, 1),
1161 	PIN_FIELD_BASE(193, 193, 9, 0x0040, 0x10, 5, 1),
1162 	PIN_FIELD_BASE(194, 194, 9, 0x0040, 0x10, 11, 1),
1163 };
1164 
1165 static const struct mtk_pin_field_calc mt8192_pin_r1_range[] = {
1166 	PIN_FIELD_BASE(10, 10, 6, 0x0040, 0x10, 0, 1),
1167 	PIN_FIELD_BASE(11, 11, 6, 0x0040, 0x10, 1, 1),
1168 	PIN_FIELD_BASE(12, 12, 6, 0x0040, 0x10, 2, 1),
1169 	PIN_FIELD_BASE(13, 13, 6, 0x0040, 0x10, 3, 1),
1170 	PIN_FIELD_BASE(14, 14, 6, 0x0040, 0x10, 4, 1),
1171 	PIN_FIELD_BASE(15, 15, 6, 0x0040, 0x10, 5, 1),
1172 	PIN_FIELD_BASE(45, 45, 1, 0x0090, 0x10, 9, 1),
1173 	PIN_FIELD_BASE(46, 46, 1, 0x0090, 0x10, 11, 1),
1174 	PIN_FIELD_BASE(47, 47, 1, 0x0090, 0x10, 10, 1),
1175 	PIN_FIELD_BASE(48, 48, 1, 0x0090, 0x10, 7, 1),
1176 	PIN_FIELD_BASE(49, 49, 1, 0x0090, 0x10, 8, 1),
1177 	PIN_FIELD_BASE(50, 50, 1, 0x0090, 0x10, 6, 1),
1178 	PIN_FIELD_BASE(51, 51, 1, 0x0090, 0x10, 0, 1),
1179 	PIN_FIELD_BASE(52, 52, 1, 0x0090, 0x10, 1, 1),
1180 	PIN_FIELD_BASE(53, 53, 1, 0x0090, 0x10, 5, 1),
1181 	PIN_FIELD_BASE(54, 54, 1, 0x0090, 0x10, 2, 1),
1182 	PIN_FIELD_BASE(55, 55, 1, 0x0090, 0x10, 4, 1),
1183 	PIN_FIELD_BASE(56, 56, 1, 0x0090, 0x10, 3, 1),
1184 	PIN_FIELD_BASE(152, 152, 7, 0x00d0, 0x10, 3, 1),
1185 	PIN_FIELD_BASE(153, 153, 7, 0x00d0, 0x10, 2, 1),
1186 	PIN_FIELD_BASE(154, 154, 7, 0x00d0, 0x10, 0, 1),
1187 	PIN_FIELD_BASE(155, 155, 7, 0x00d0, 0x10, 1, 1),
1188 	PIN_FIELD_BASE(183, 183, 9, 0x0050, 0x10, 1, 1),
1189 	PIN_FIELD_BASE(184, 184, 9, 0x0050, 0x10, 2, 1),
1190 	PIN_FIELD_BASE(185, 185, 9, 0x0050, 0x10, 4, 1),
1191 	PIN_FIELD_BASE(186, 186, 9, 0x0050, 0x10, 6, 1),
1192 	PIN_FIELD_BASE(187, 187, 9, 0x0050, 0x10, 8, 1),
1193 	PIN_FIELD_BASE(188, 188, 9, 0x0050, 0x10, 3, 1),
1194 	PIN_FIELD_BASE(189, 189, 9, 0x0050, 0x10, 7, 1),
1195 	PIN_FIELD_BASE(190, 190, 9, 0x0050, 0x10, 9, 1),
1196 	PIN_FIELD_BASE(191, 191, 9, 0x0050, 0x10, 10, 1),
1197 	PIN_FIELD_BASE(192, 192, 9, 0x0050, 0x10, 0, 1),
1198 	PIN_FIELD_BASE(193, 193, 9, 0x0050, 0x10, 5, 1),
1199 	PIN_FIELD_BASE(194, 194, 9, 0x0050, 0x10, 11, 1),
1200 };
1201 
1202 static const struct mtk_pin_field_calc mt8192_pin_drv_adv_range[] = {
1203 	PIN_FIELD_BASE(89, 89, 2, 0x0040, 0x10, 0, 5),
1204 	PIN_FIELD_BASE(90, 90, 2, 0x0040, 0x10, 5, 5),
1205 
1206 	PIN_FIELD_BASE(118, 118, 4, 0x0040, 0x10, 0, 3),
1207 	PIN_FIELD_BASE(119, 119, 4, 0x0040, 0x10, 18, 3),
1208 	PIN_FIELD_BASE(120, 120, 4, 0x0040, 0x10, 15, 3),
1209 	PIN_FIELD_BASE(121, 121, 4, 0x0050, 0x10, 3, 3),
1210 	PIN_FIELD_BASE(122, 122, 4, 0x0040, 0x10, 12, 3),
1211 	PIN_FIELD_BASE(123, 123, 4, 0x0050, 0x10, 0, 3),
1212 	PIN_FIELD_BASE(124, 124, 4, 0x0040, 0x10, 9, 3),
1213 	PIN_FIELD_BASE(125, 125, 4, 0x0040, 0x10, 27, 3),
1214 	PIN_FIELD_BASE(139, 139, 4, 0x0040, 0x10, 6, 3),
1215 	PIN_FIELD_BASE(140, 140, 4, 0x0040, 0x10, 24, 3),
1216 	PIN_FIELD_BASE(141, 141, 4, 0x0040, 0x10, 3, 3),
1217 	PIN_FIELD_BASE(142, 142, 4, 0x0040, 0x10, 21, 3),
1218 	PIN_FIELD_BASE(160, 160, 7, 0x0030, 0x10, 0, 3),
1219 	PIN_FIELD_BASE(161, 161, 7, 0x0030, 0x10, 3, 3),
1220 	PIN_FIELD_BASE(200, 200, 8, 0x0010, 0x10, 3, 3),
1221 	PIN_FIELD_BASE(201, 201, 8, 0x0010, 0x10, 9, 3),
1222 	PIN_FIELD_BASE(202, 202, 5, 0x0020, 0x10, 0, 3),
1223 	PIN_FIELD_BASE(203, 203, 5, 0x0020, 0x10, 3, 3),
1224 	PIN_FIELD_BASE(204, 204, 8, 0x0010, 0x10, 0, 3),
1225 	PIN_FIELD_BASE(205, 205, 8, 0x0010, 0x10, 6, 3),
1226 };
1227 
1228 static const struct mtk_pin_field_calc mt8192_pin_rsel_range[] = {
1229 	PIN_FIELD_BASE(118, 118, 4, 0x00e0, 0x10, 0, 2),
1230 	PIN_FIELD_BASE(119, 119, 4, 0x00e0, 0x10, 12, 2),
1231 	PIN_FIELD_BASE(120, 120, 4, 0x00e0, 0x10, 10, 2),
1232 	PIN_FIELD_BASE(121, 121, 4, 0x00e0, 0x10, 22, 2),
1233 	PIN_FIELD_BASE(122, 122, 4, 0x00e0, 0x10, 8, 2),
1234 	PIN_FIELD_BASE(123, 123, 4, 0x00e0, 0x10, 20, 2),
1235 	PIN_FIELD_BASE(124, 124, 4, 0x00e0, 0x10, 6, 2),
1236 	PIN_FIELD_BASE(125, 125, 4, 0x00e0, 0x10, 18, 2),
1237 	PIN_FIELD_BASE(139, 139, 4, 0x00e0, 0x10, 4, 2),
1238 	PIN_FIELD_BASE(140, 140, 4, 0x00e0, 0x10, 16, 2),
1239 	PIN_FIELD_BASE(141, 141, 4, 0x00e0, 0x10, 2, 2),
1240 	PIN_FIELD_BASE(142, 142, 4, 0x00e0, 0x10, 14, 2),
1241 	PIN_FIELD_BASE(160, 160, 7, 0x00f0, 0x10, 0, 2),
1242 	PIN_FIELD_BASE(161, 161, 7, 0x00f0, 0x10, 2, 2),
1243 	PIN_FIELD_BASE(200, 200, 8, 0x0070, 0x10, 2, 2),
1244 	PIN_FIELD_BASE(201, 201, 8, 0x0070, 0x10, 6, 2),
1245 	PIN_FIELD_BASE(202, 202, 5, 0x0070, 0x10, 0, 2),
1246 	PIN_FIELD_BASE(203, 203, 5, 0x0070, 0x10, 2, 2),
1247 	PIN_FIELD_BASE(204, 204, 8, 0x0070, 0x10, 0, 2),
1248 	PIN_FIELD_BASE(205, 205, 8, 0x0070, 0x10, 4, 2),
1249 };
1250 
1251 static const unsigned int mt8192_pull_type[] = {
1252 	MTK_PULL_PU_PD_TYPE,/*0*/ MTK_PULL_PU_PD_TYPE,/*1*/
1253 	MTK_PULL_PU_PD_TYPE,/*2*/ MTK_PULL_PU_PD_TYPE,/*3*/
1254 	MTK_PULL_PU_PD_TYPE,/*4*/ MTK_PULL_PU_PD_TYPE,/*5*/
1255 	MTK_PULL_PU_PD_TYPE,/*6*/ MTK_PULL_PU_PD_TYPE,/*7*/
1256 	MTK_PULL_PU_PD_TYPE,/*8*/ MTK_PULL_PU_PD_TYPE,/*9*/
1257 	MTK_PULL_PUPD_R1R0_TYPE,/*10*/ MTK_PULL_PUPD_R1R0_TYPE,/*11*/
1258 	MTK_PULL_PUPD_R1R0_TYPE,/*12*/ MTK_PULL_PUPD_R1R0_TYPE,/*13*/
1259 	MTK_PULL_PUPD_R1R0_TYPE,/*14*/ MTK_PULL_PUPD_R1R0_TYPE,/*15*/
1260 	MTK_PULL_PU_PD_TYPE,/*16*/ MTK_PULL_PU_PD_TYPE,/*17*/
1261 	MTK_PULL_PU_PD_TYPE,/*18*/ MTK_PULL_PU_PD_TYPE,/*19*/
1262 	MTK_PULL_PU_PD_TYPE,/*20*/ MTK_PULL_PU_PD_TYPE,/*21*/
1263 	MTK_PULL_PU_PD_TYPE,/*22*/ MTK_PULL_PU_PD_TYPE,/*23*/
1264 	MTK_PULL_PU_PD_TYPE,/*24*/ MTK_PULL_PU_PD_TYPE,/*25*/
1265 	MTK_PULL_PU_PD_TYPE,/*26*/ MTK_PULL_PU_PD_TYPE,/*27*/
1266 	MTK_PULL_PU_PD_TYPE,/*28*/ MTK_PULL_PU_PD_TYPE,/*29*/
1267 	MTK_PULL_PU_PD_TYPE,/*30*/ MTK_PULL_PU_PD_TYPE,/*31*/
1268 	MTK_PULL_PU_PD_TYPE,/*32*/ MTK_PULL_PU_PD_TYPE,/*33*/
1269 	MTK_PULL_PU_PD_TYPE,/*34*/ MTK_PULL_PU_PD_TYPE,/*35*/
1270 	MTK_PULL_PU_PD_TYPE,/*36*/ MTK_PULL_PU_PD_TYPE,/*37*/
1271 	MTK_PULL_PU_PD_TYPE,/*38*/ MTK_PULL_PU_PD_TYPE,/*39*/
1272 	MTK_PULL_PU_PD_TYPE,/*40*/ MTK_PULL_PU_PD_TYPE,/*41*/
1273 	MTK_PULL_PU_PD_TYPE,/*42*/ MTK_PULL_PU_PD_TYPE,/*43*/
1274 	MTK_PULL_PU_PD_TYPE,/*44*/ MTK_PULL_PUPD_R1R0_TYPE,/*45*/
1275 	MTK_PULL_PUPD_R1R0_TYPE,/*46*/ MTK_PULL_PUPD_R1R0_TYPE,/*47*/
1276 	MTK_PULL_PUPD_R1R0_TYPE,/*48*/ MTK_PULL_PUPD_R1R0_TYPE,/*49*/
1277 	MTK_PULL_PUPD_R1R0_TYPE,/*50*/ MTK_PULL_PUPD_R1R0_TYPE,/*51*/
1278 	MTK_PULL_PUPD_R1R0_TYPE,/*52*/ MTK_PULL_PUPD_R1R0_TYPE,/*53*/
1279 	MTK_PULL_PUPD_R1R0_TYPE,/*54*/ MTK_PULL_PUPD_R1R0_TYPE,/*55*/
1280 	MTK_PULL_PUPD_R1R0_TYPE,/*56*/ MTK_PULL_PU_PD_TYPE,/*57*/
1281 	MTK_PULL_PU_PD_TYPE,/*58*/ MTK_PULL_PU_PD_TYPE,/*59*/
1282 	MTK_PULL_PU_PD_TYPE,/*60*/ MTK_PULL_PU_PD_TYPE,/*61*/
1283 	MTK_PULL_PU_PD_TYPE,/*62*/ MTK_PULL_PU_PD_TYPE,/*63*/
1284 	MTK_PULL_PU_PD_TYPE,/*64*/ MTK_PULL_PU_PD_TYPE,/*65*/
1285 	MTK_PULL_PU_PD_TYPE,/*66*/ MTK_PULL_PU_PD_TYPE,/*67*/
1286 	MTK_PULL_PU_PD_TYPE,/*68*/ MTK_PULL_PU_PD_TYPE,/*69*/
1287 	MTK_PULL_PU_PD_TYPE,/*70*/ MTK_PULL_PU_PD_TYPE,/*71*/
1288 	MTK_PULL_PU_PD_TYPE,/*72*/ MTK_PULL_PU_PD_TYPE,/*73*/
1289 	MTK_PULL_PU_PD_TYPE,/*74*/ MTK_PULL_PU_PD_TYPE,/*75*/
1290 	MTK_PULL_PU_PD_TYPE,/*76*/ MTK_PULL_PU_PD_TYPE,/*77*/
1291 	MTK_PULL_PU_PD_TYPE,/*78*/ MTK_PULL_PU_PD_TYPE,/*79*/
1292 	MTK_PULL_PU_PD_TYPE,/*80*/ MTK_PULL_PU_PD_TYPE,/*81*/
1293 	MTK_PULL_PU_PD_TYPE,/*82*/ MTK_PULL_PU_PD_TYPE,/*83*/
1294 	MTK_PULL_PU_PD_TYPE,/*84*/ MTK_PULL_PU_PD_TYPE,/*85*/
1295 	MTK_PULL_PU_PD_TYPE,/*86*/ MTK_PULL_PU_PD_TYPE,/*87*/
1296 	MTK_PULL_PU_PD_TYPE,/*88*/ MTK_PULL_PU_PD_TYPE,/*89*/
1297 	MTK_PULL_PU_PD_TYPE,/*90*/ MTK_PULL_PU_PD_TYPE,/*91*/
1298 	MTK_PULL_PU_PD_TYPE,/*92*/ MTK_PULL_PU_PD_TYPE,/*93*/
1299 	MTK_PULL_PU_PD_TYPE,/*94*/ MTK_PULL_PU_PD_TYPE,/*95*/
1300 	MTK_PULL_PU_PD_TYPE,/*96*/ MTK_PULL_PU_PD_TYPE,/*97*/
1301 	MTK_PULL_PU_PD_TYPE,/*98*/ MTK_PULL_PU_PD_TYPE,/*99*/
1302 	MTK_PULL_PU_PD_TYPE,/*100*/ MTK_PULL_PU_PD_TYPE,/*101*/
1303 	MTK_PULL_PU_PD_TYPE,/*102*/ MTK_PULL_PU_PD_TYPE,/*103*/
1304 	MTK_PULL_PU_PD_TYPE,/*104*/ MTK_PULL_PU_PD_TYPE,/*105*/
1305 	MTK_PULL_PU_PD_TYPE,/*106*/ MTK_PULL_PU_PD_TYPE,/*107*/
1306 	MTK_PULL_PU_PD_TYPE,/*108*/ MTK_PULL_PU_PD_TYPE,/*109*/
1307 	MTK_PULL_PU_PD_TYPE,/*110*/ MTK_PULL_PU_PD_TYPE,/*111*/
1308 	MTK_PULL_PU_PD_TYPE,/*112*/ MTK_PULL_PU_PD_TYPE,/*113*/
1309 	MTK_PULL_PU_PD_TYPE,/*114*/ MTK_PULL_PU_PD_TYPE,/*115*/
1310 	MTK_PULL_PU_PD_TYPE,/*116*/ MTK_PULL_PU_PD_TYPE,/*117*/
1311 	MTK_PULL_PU_PD_RSEL_TYPE,/*118*/ MTK_PULL_PU_PD_RSEL_TYPE,/*119*/
1312 	MTK_PULL_PU_PD_RSEL_TYPE,/*120*/ MTK_PULL_PU_PD_RSEL_TYPE,/*121*/
1313 	MTK_PULL_PU_PD_RSEL_TYPE,/*122*/ MTK_PULL_PU_PD_RSEL_TYPE,/*123*/
1314 	MTK_PULL_PU_PD_RSEL_TYPE,/*124*/ MTK_PULL_PU_PD_RSEL_TYPE,/*125*/
1315 	MTK_PULL_PU_PD_TYPE,/*126*/ MTK_PULL_PU_PD_TYPE,/*127*/
1316 	MTK_PULL_PU_PD_TYPE,/*128*/ MTK_PULL_PU_PD_TYPE,/*129*/
1317 	MTK_PULL_PU_PD_TYPE,/*130*/ MTK_PULL_PU_PD_TYPE,/*131*/
1318 	MTK_PULL_PU_PD_TYPE,/*132*/ MTK_PULL_PU_PD_TYPE,/*133*/
1319 	MTK_PULL_PU_PD_TYPE,/*134*/ MTK_PULL_PU_PD_TYPE,/*135*/
1320 	MTK_PULL_PU_PD_TYPE,/*136*/ MTK_PULL_PU_PD_TYPE,/*137*/
1321 	MTK_PULL_PU_PD_TYPE,/*138*/ MTK_PULL_PU_PD_RSEL_TYPE,/*139*/
1322 	MTK_PULL_PU_PD_RSEL_TYPE,/*140*/ MTK_PULL_PU_PD_RSEL_TYPE,/*141*/
1323 	MTK_PULL_PU_PD_RSEL_TYPE,/*142*/ MTK_PULL_PU_PD_TYPE,/*143*/
1324 	MTK_PULL_PU_PD_TYPE,/*144*/ MTK_PULL_PU_PD_TYPE,/*145*/
1325 	MTK_PULL_PU_PD_TYPE,/*146*/ MTK_PULL_PU_PD_TYPE,/*147*/
1326 	MTK_PULL_PU_PD_TYPE,/*148*/ MTK_PULL_PU_PD_TYPE,/*149*/
1327 	MTK_PULL_PU_PD_TYPE,/*150*/ MTK_PULL_PU_PD_TYPE,/*151*/
1328 	MTK_PULL_PUPD_R1R0_TYPE,/*152*/ MTK_PULL_PUPD_R1R0_TYPE,/*153*/
1329 	MTK_PULL_PUPD_R1R0_TYPE,/*154*/ MTK_PULL_PUPD_R1R0_TYPE,/*155*/
1330 	MTK_PULL_PU_PD_TYPE,/*156*/ MTK_PULL_PU_PD_TYPE,/*157*/
1331 	MTK_PULL_PU_PD_TYPE,/*158*/ MTK_PULL_PU_PD_TYPE,/*159*/
1332 	MTK_PULL_PU_PD_RSEL_TYPE,/*160*/ MTK_PULL_PU_PD_RSEL_TYPE,/*161*/
1333 	MTK_PULL_PU_PD_TYPE,/*162*/ MTK_PULL_PU_PD_TYPE,/*163*/
1334 	MTK_PULL_PU_PD_TYPE,/*164*/ MTK_PULL_PU_PD_TYPE,/*165*/
1335 	MTK_PULL_PU_PD_TYPE,/*166*/ MTK_PULL_PU_PD_TYPE,/*167*/
1336 	MTK_PULL_PU_PD_TYPE,/*168*/ MTK_PULL_PU_PD_TYPE,/*169*/
1337 	MTK_PULL_PU_PD_TYPE,/*170*/ MTK_PULL_PU_PD_TYPE,/*171*/
1338 	MTK_PULL_PU_PD_TYPE,/*172*/ MTK_PULL_PU_PD_TYPE,/*173*/
1339 	MTK_PULL_PU_PD_TYPE,/*174*/ MTK_PULL_PU_PD_TYPE,/*175*/
1340 	MTK_PULL_PU_PD_TYPE,/*176*/ MTK_PULL_PU_PD_TYPE,/*177*/
1341 	MTK_PULL_PU_PD_TYPE,/*178*/ MTK_PULL_PU_PD_TYPE,/*179*/
1342 	MTK_PULL_PU_PD_TYPE,/*180*/ MTK_PULL_PU_PD_TYPE,/*181*/
1343 	MTK_PULL_PU_PD_TYPE,/*182*/ MTK_PULL_PUPD_R1R0_TYPE,/*183*/
1344 	MTK_PULL_PUPD_R1R0_TYPE,/*184*/ MTK_PULL_PUPD_R1R0_TYPE,/*185*/
1345 	MTK_PULL_PUPD_R1R0_TYPE,/*186*/ MTK_PULL_PUPD_R1R0_TYPE,/*187*/
1346 	MTK_PULL_PUPD_R1R0_TYPE,/*188*/ MTK_PULL_PUPD_R1R0_TYPE,/*189*/
1347 	MTK_PULL_PUPD_R1R0_TYPE,/*190*/ MTK_PULL_PUPD_R1R0_TYPE,/*191*/
1348 	MTK_PULL_PUPD_R1R0_TYPE,/*192*/ MTK_PULL_PUPD_R1R0_TYPE,/*193*/
1349 	MTK_PULL_PUPD_R1R0_TYPE,/*194*/ MTK_PULL_PU_PD_TYPE,/*195*/
1350 	MTK_PULL_PU_PD_TYPE,/*196*/ MTK_PULL_PU_PD_TYPE,/*197*/
1351 	MTK_PULL_PU_PD_TYPE,/*198*/ MTK_PULL_PU_PD_TYPE,/*199*/
1352 	MTK_PULL_PU_PD_RSEL_TYPE,/*200*/ MTK_PULL_PU_PD_RSEL_TYPE,/*201*/
1353 	MTK_PULL_PU_PD_RSEL_TYPE,/*202*/ MTK_PULL_PU_PD_RSEL_TYPE,/*203*/
1354 	MTK_PULL_PU_PD_RSEL_TYPE,/*204*/ MTK_PULL_PU_PD_RSEL_TYPE,/*205*/
1355 	MTK_PULL_PU_PD_TYPE,/*206*/ MTK_PULL_PU_PD_TYPE,/*207*/
1356 	MTK_PULL_PU_PD_TYPE,/*208*/ MTK_PULL_PU_PD_TYPE,/*209*/
1357 	MTK_PULL_PU_PD_TYPE,/*210*/ MTK_PULL_PU_PD_TYPE,/*211*/
1358 	MTK_PULL_PU_PD_TYPE,/*212*/ MTK_PULL_PU_PD_TYPE,/*213*/
1359 	MTK_PULL_PU_PD_TYPE,/*214*/ MTK_PULL_PU_PD_TYPE,/*215*/
1360 	MTK_PULL_PU_PD_TYPE,/*216*/ MTK_PULL_PU_PD_TYPE,/*217*/
1361 	MTK_PULL_PU_PD_TYPE,/*218*/ MTK_PULL_PU_PD_TYPE,/*219*/
1362 };
1363 
1364 static const char * const mt8192_pinctrl_register_base_names[] = {
1365 	"iocfg0", "iocfg_rm", "iocfg_bm", "iocfg_bl", "iocfg_br",
1366 	"iocfg_lm", "iocfg_lb", "iocfg_rt", "iocfg_lt", "iocfg_tl",
1367 };
1368 
1369 static const struct mtk_eint_hw mt8192_eint_hw = {
1370 	.port_mask = 7,
1371 	.ports     = 7,
1372 	.ap_num    = 224,
1373 	.db_cnt    = 32,
1374 	.db_time   = debounce_time_mt6765,
1375 };
1376 
1377 static const struct mtk_pin_reg_calc mt8192_reg_cals[PINCTRL_PIN_REG_MAX] = {
1378 	[PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt8192_pin_mode_range),
1379 	[PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt8192_pin_dir_range),
1380 	[PINCTRL_PIN_REG_DI] = MTK_RANGE(mt8192_pin_di_range),
1381 	[PINCTRL_PIN_REG_DO] = MTK_RANGE(mt8192_pin_do_range),
1382 	[PINCTRL_PIN_REG_SR] = MTK_RANGE(mt8192_pin_dir_range),
1383 	[PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt8192_pin_smt_range),
1384 	[PINCTRL_PIN_REG_IES] = MTK_RANGE(mt8192_pin_ies_range),
1385 	[PINCTRL_PIN_REG_PU] = MTK_RANGE(mt8192_pin_pu_range),
1386 	[PINCTRL_PIN_REG_PD] = MTK_RANGE(mt8192_pin_pd_range),
1387 	[PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt8192_pin_drv_range),
1388 	[PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt8192_pin_pupd_range),
1389 	[PINCTRL_PIN_REG_R0] = MTK_RANGE(mt8192_pin_r0_range),
1390 	[PINCTRL_PIN_REG_R1] = MTK_RANGE(mt8192_pin_r1_range),
1391 	[PINCTRL_PIN_REG_DRV_ADV] = MTK_RANGE(mt8192_pin_drv_adv_range),
1392 	[PINCTRL_PIN_REG_RSEL] = MTK_RANGE(mt8192_pin_rsel_range),
1393 };
1394 
1395 static const struct mtk_pin_soc mt8192_data = {
1396 	.reg_cal = mt8192_reg_cals,
1397 	.pins = mtk_pins_mt8192,
1398 	.npins = ARRAY_SIZE(mtk_pins_mt8192),
1399 	.ngrps = ARRAY_SIZE(mtk_pins_mt8192),
1400 	.base_names = mt8192_pinctrl_register_base_names,
1401 	.nbase_names = ARRAY_SIZE(mt8192_pinctrl_register_base_names),
1402 	.pull_type = mt8192_pull_type,
1403 	.eint_hw = &mt8192_eint_hw,
1404 	.nfuncs = 8,
1405 	.gpio_m = 0,
1406 	.bias_set_combo = mtk_pinconf_bias_set_combo,
1407 	.bias_get_combo = mtk_pinconf_bias_get_combo,
1408 	.drive_set = mtk_pinconf_drive_set_rev1,
1409 	.drive_get = mtk_pinconf_drive_get_rev1,
1410 	.adv_drive_get = mtk_pinconf_adv_drive_get_raw,
1411 	.adv_drive_set = mtk_pinconf_adv_drive_set_raw,
1412 };
1413 
1414 static const struct of_device_id mt8192_pinctrl_of_match[] = {
1415 	{ .compatible = "mediatek,mt8192-pinctrl", .data = &mt8192_data },
1416 	{ }
1417 };
1418 
1419 static struct platform_driver mt8192_pinctrl_driver = {
1420 	.driver = {
1421 		.name = "mt8192-pinctrl",
1422 		.of_match_table = mt8192_pinctrl_of_match,
1423 		.pm = &mtk_paris_pinctrl_pm_ops,
1424 	},
1425 	.probe = mtk_paris_pinctrl_probe,
1426 };
1427 
1428 static int __init mt8192_pinctrl_init(void)
1429 {
1430 	return platform_driver_register(&mt8192_pinctrl_driver);
1431 }
1432 arch_initcall(mt8192_pinctrl_init);
1433 
1434 MODULE_LICENSE("GPL v2");
1435 MODULE_DESCRIPTION("MediaTek MT8192 Pinctrl Driver");
1436