1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * Copyright (C) 2020 MediaTek Inc. 4 * 5 * Author: Zhiyong Tao <zhiyong.tao@mediatek.com> 6 * 7 */ 8 9 #include "pinctrl-mtk-mt8195.h" 10 #include "pinctrl-paris.h" 11 12 /* MT8195 have multiple bases to program pin configuration listed as the below: 13 * iocfg[0]:0x10005000, iocfg[1]:0x11d10000, iocfg[2]:0x11d30000, 14 * iocfg[3]:0x11d40000, iocfg[4]:0x11e20000, iocfg[5]:0x11eb0000, 15 * iocfg[6]:0x11f40000. 16 * _i_based could be used to indicate what base the pin should be mapped into. 17 */ 18 19 #define PIN_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \ 20 PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, \ 21 32, 0) 22 23 #define PINS_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \ 24 PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, \ 25 32, 1) 26 27 static const struct mtk_pin_field_calc mt8195_pin_mode_range[] = { 28 PIN_FIELD(0, 144, 0x300, 0x10, 0, 4), 29 }; 30 31 static const struct mtk_pin_field_calc mt8195_pin_dir_range[] = { 32 PIN_FIELD(0, 144, 0x0, 0x10, 0, 1), 33 }; 34 35 static const struct mtk_pin_field_calc mt8195_pin_di_range[] = { 36 PIN_FIELD(0, 144, 0x200, 0x10, 0, 1), 37 }; 38 39 static const struct mtk_pin_field_calc mt8195_pin_do_range[] = { 40 PIN_FIELD(0, 144, 0x100, 0x10, 0, 1), 41 }; 42 43 static const struct mtk_pin_field_calc mt8195_pin_ies_range[] = { 44 PIN_FIELD_BASE(0, 0, 4, 0x040, 0x10, 0, 1), 45 PIN_FIELD_BASE(1, 1, 4, 0x040, 0x10, 1, 1), 46 PIN_FIELD_BASE(2, 2, 4, 0x040, 0x10, 2, 1), 47 PIN_FIELD_BASE(3, 3, 4, 0x040, 0x10, 3, 1), 48 PIN_FIELD_BASE(4, 4, 4, 0x040, 0x10, 4, 1), 49 PIN_FIELD_BASE(5, 5, 4, 0x040, 0x10, 5, 1), 50 PIN_FIELD_BASE(6, 6, 4, 0x040, 0x10, 6, 1), 51 PIN_FIELD_BASE(7, 7, 4, 0x040, 0x10, 7, 1), 52 PIN_FIELD_BASE(8, 8, 4, 0x040, 0x10, 13, 1), 53 PIN_FIELD_BASE(9, 9, 4, 0x040, 0x10, 8, 1), 54 PIN_FIELD_BASE(10, 10, 4, 0x040, 0x10, 14, 1), 55 PIN_FIELD_BASE(11, 11, 4, 0x040, 0x10, 9, 1), 56 PIN_FIELD_BASE(12, 12, 4, 0x040, 0x10, 15, 1), 57 PIN_FIELD_BASE(13, 13, 4, 0x040, 0x10, 10, 1), 58 PIN_FIELD_BASE(14, 14, 4, 0x040, 0x10, 16, 1), 59 PIN_FIELD_BASE(15, 15, 4, 0x040, 0x10, 11, 1), 60 PIN_FIELD_BASE(16, 16, 4, 0x040, 0x10, 17, 1), 61 PIN_FIELD_BASE(17, 17, 4, 0x040, 0x10, 12, 1), 62 PIN_FIELD_BASE(18, 18, 2, 0x040, 0x10, 5, 1), 63 PIN_FIELD_BASE(19, 19, 2, 0x040, 0x10, 12, 1), 64 PIN_FIELD_BASE(20, 20, 2, 0x040, 0x10, 11, 1), 65 PIN_FIELD_BASE(21, 21, 2, 0x040, 0x10, 10, 1), 66 PIN_FIELD_BASE(22, 22, 2, 0x040, 0x10, 0, 1), 67 PIN_FIELD_BASE(23, 23, 2, 0x040, 0x10, 1, 1), 68 PIN_FIELD_BASE(24, 24, 2, 0x040, 0x10, 2, 1), 69 PIN_FIELD_BASE(25, 25, 2, 0x040, 0x10, 4, 1), 70 PIN_FIELD_BASE(26, 26, 2, 0x040, 0x10, 3, 1), 71 PIN_FIELD_BASE(27, 27, 2, 0x040, 0x10, 6, 1), 72 PIN_FIELD_BASE(28, 28, 2, 0x040, 0x10, 7, 1), 73 PIN_FIELD_BASE(29, 29, 2, 0x040, 0x10, 8, 1), 74 PIN_FIELD_BASE(30, 30, 2, 0x040, 0x10, 9, 1), 75 PIN_FIELD_BASE(31, 31, 1, 0x060, 0x10, 13, 1), 76 PIN_FIELD_BASE(32, 32, 1, 0x060, 0x10, 12, 1), 77 PIN_FIELD_BASE(33, 33, 1, 0x060, 0x10, 11, 1), 78 PIN_FIELD_BASE(34, 34, 1, 0x060, 0x10, 14, 1), 79 PIN_FIELD_BASE(35, 35, 1, 0x060, 0x10, 15, 1), 80 PIN_FIELD_BASE(36, 36, 1, 0x070, 0x10, 3, 1), 81 PIN_FIELD_BASE(37, 37, 1, 0x070, 0x10, 6, 1), 82 PIN_FIELD_BASE(38, 38, 1, 0x070, 0x10, 4, 1), 83 PIN_FIELD_BASE(39, 39, 1, 0x070, 0x10, 5, 1), 84 PIN_FIELD_BASE(40, 40, 1, 0x070, 0x10, 8, 1), 85 PIN_FIELD_BASE(41, 41, 1, 0x070, 0x10, 7, 1), 86 PIN_FIELD_BASE(42, 42, 1, 0x070, 0x10, 10, 1), 87 PIN_FIELD_BASE(43, 43, 1, 0x070, 0x10, 9, 1), 88 PIN_FIELD_BASE(44, 44, 1, 0x070, 0x10, 20, 1), 89 PIN_FIELD_BASE(45, 45, 1, 0x070, 0x10, 21, 1), 90 PIN_FIELD_BASE(46, 46, 1, 0x060, 0x10, 18, 1), 91 PIN_FIELD_BASE(47, 47, 1, 0x060, 0x10, 16, 1), 92 PIN_FIELD_BASE(48, 48, 1, 0x060, 0x10, 19, 1), 93 PIN_FIELD_BASE(49, 49, 1, 0x060, 0x10, 17, 1), 94 PIN_FIELD_BASE(50, 50, 1, 0x060, 0x10, 25, 1), 95 PIN_FIELD_BASE(51, 51, 1, 0x060, 0x10, 20, 1), 96 PIN_FIELD_BASE(52, 52, 1, 0x060, 0x10, 26, 1), 97 PIN_FIELD_BASE(53, 53, 1, 0x060, 0x10, 21, 1), 98 PIN_FIELD_BASE(54, 54, 1, 0x060, 0x10, 22, 1), 99 PIN_FIELD_BASE(55, 55, 1, 0x060, 0x10, 23, 1), 100 PIN_FIELD_BASE(56, 56, 1, 0x060, 0x10, 24, 1), 101 PIN_FIELD_BASE(57, 57, 1, 0x060, 0x10, 29, 1), 102 PIN_FIELD_BASE(58, 58, 1, 0x060, 0x10, 27, 1), 103 PIN_FIELD_BASE(59, 59, 1, 0x060, 0x10, 30, 1), 104 PIN_FIELD_BASE(60, 60, 1, 0x060, 0x10, 28, 1), 105 PIN_FIELD_BASE(61, 61, 1, 0x060, 0x10, 8, 1), 106 PIN_FIELD_BASE(62, 62, 1, 0x060, 0x10, 7, 1), 107 PIN_FIELD_BASE(63, 63, 1, 0x060, 0x10, 10, 1), 108 PIN_FIELD_BASE(64, 64, 1, 0x060, 0x10, 9, 1), 109 PIN_FIELD_BASE(65, 65, 1, 0x070, 0x10, 1, 1), 110 PIN_FIELD_BASE(66, 66, 1, 0x060, 0x10, 31, 1), 111 PIN_FIELD_BASE(67, 67, 1, 0x070, 0x10, 0, 1), 112 PIN_FIELD_BASE(68, 68, 1, 0x070, 0x10, 2, 1), 113 PIN_FIELD_BASE(69, 69, 1, 0x060, 0x10, 0, 1), 114 PIN_FIELD_BASE(70, 70, 1, 0x060, 0x10, 6, 1), 115 PIN_FIELD_BASE(71, 71, 1, 0x060, 0x10, 4, 1), 116 PIN_FIELD_BASE(72, 72, 1, 0x060, 0x10, 5, 1), 117 PIN_FIELD_BASE(73, 73, 1, 0x060, 0x10, 1, 1), 118 PIN_FIELD_BASE(74, 74, 1, 0x060, 0x10, 2, 1), 119 PIN_FIELD_BASE(75, 75, 1, 0x060, 0x10, 3, 1), 120 PIN_FIELD_BASE(76, 76, 1, 0x070, 0x10, 11, 1), 121 PIN_FIELD_BASE(77, 77, 3, 0x030, 0x10, 1, 1), 122 PIN_FIELD_BASE(78, 78, 3, 0x030, 0x10, 2, 1), 123 PIN_FIELD_BASE(79, 79, 3, 0x030, 0x10, 9, 1), 124 PIN_FIELD_BASE(80, 80, 3, 0x030, 0x10, 10, 1), 125 PIN_FIELD_BASE(81, 81, 3, 0x030, 0x10, 11, 1), 126 PIN_FIELD_BASE(82, 82, 3, 0x030, 0x10, 12, 1), 127 PIN_FIELD_BASE(83, 83, 3, 0x030, 0x10, 13, 1), 128 PIN_FIELD_BASE(84, 84, 3, 0x030, 0x10, 14, 1), 129 PIN_FIELD_BASE(85, 85, 3, 0x030, 0x10, 15, 1), 130 PIN_FIELD_BASE(86, 86, 3, 0x030, 0x10, 16, 1), 131 PIN_FIELD_BASE(87, 87, 3, 0x030, 0x10, 3, 1), 132 PIN_FIELD_BASE(88, 88, 3, 0x030, 0x10, 4, 1), 133 PIN_FIELD_BASE(89, 89, 3, 0x030, 0x10, 5, 1), 134 PIN_FIELD_BASE(90, 90, 3, 0x030, 0x10, 6, 1), 135 PIN_FIELD_BASE(91, 91, 3, 0x030, 0x10, 7, 1), 136 PIN_FIELD_BASE(92, 92, 3, 0x030, 0x10, 8, 1), 137 PIN_FIELD_BASE(93, 93, 3, 0x030, 0x10, 18, 1), 138 PIN_FIELD_BASE(94, 94, 3, 0x030, 0x10, 19, 1), 139 PIN_FIELD_BASE(95, 95, 3, 0x030, 0x10, 17, 1), 140 PIN_FIELD_BASE(96, 96, 3, 0x030, 0x10, 0, 1), 141 PIN_FIELD_BASE(97, 97, 3, 0x030, 0x10, 20, 1), 142 PIN_FIELD_BASE(98, 98, 3, 0x030, 0x10, 28, 1), 143 PIN_FIELD_BASE(99, 99, 3, 0x030, 0x10, 27, 1), 144 PIN_FIELD_BASE(100, 100, 3, 0x030, 0x10, 30, 1), 145 PIN_FIELD_BASE(101, 101, 3, 0x030, 0x10, 29, 1), 146 PIN_FIELD_BASE(102, 102, 3, 0x040, 0x10, 0, 1), 147 PIN_FIELD_BASE(103, 103, 3, 0x030, 0x10, 31, 1), 148 PIN_FIELD_BASE(104, 104, 3, 0x030, 0x10, 25, 1), 149 PIN_FIELD_BASE(105, 105, 3, 0x030, 0x10, 26, 1), 150 PIN_FIELD_BASE(106, 106, 3, 0x030, 0x10, 23, 1), 151 PIN_FIELD_BASE(107, 107, 3, 0x030, 0x10, 24, 1), 152 PIN_FIELD_BASE(108, 108, 3, 0x030, 0x10, 22, 1), 153 PIN_FIELD_BASE(109, 109, 3, 0x030, 0x10, 21, 1), 154 PIN_FIELD_BASE(110, 110, 5, 0x010, 0x10, 1, 1), 155 PIN_FIELD_BASE(111, 111, 5, 0x010, 0x10, 0, 1), 156 PIN_FIELD_BASE(112, 112, 5, 0x010, 0x10, 2, 1), 157 PIN_FIELD_BASE(113, 113, 5, 0x010, 0x10, 3, 1), 158 PIN_FIELD_BASE(114, 114, 5, 0x010, 0x10, 4, 1), 159 PIN_FIELD_BASE(115, 115, 5, 0x010, 0x10, 5, 1), 160 PIN_FIELD_BASE(116, 116, 6, 0x030, 0x10, 9, 1), 161 PIN_FIELD_BASE(117, 117, 6, 0x030, 0x10, 8, 1), 162 PIN_FIELD_BASE(118, 118, 6, 0x030, 0x10, 7, 1), 163 PIN_FIELD_BASE(119, 119, 6, 0x030, 0x10, 6, 1), 164 PIN_FIELD_BASE(120, 120, 6, 0x030, 0x10, 11, 1), 165 PIN_FIELD_BASE(121, 121, 6, 0x030, 0x10, 1, 1), 166 PIN_FIELD_BASE(122, 122, 6, 0x030, 0x10, 0, 1), 167 PIN_FIELD_BASE(123, 123, 6, 0x030, 0x10, 5, 1), 168 PIN_FIELD_BASE(124, 124, 6, 0x030, 0x10, 4, 1), 169 PIN_FIELD_BASE(125, 125, 6, 0x030, 0x10, 3, 1), 170 PIN_FIELD_BASE(126, 126, 6, 0x030, 0x10, 2, 1), 171 PIN_FIELD_BASE(127, 127, 6, 0x030, 0x10, 10, 1), 172 PIN_FIELD_BASE(128, 128, 3, 0x040, 0x10, 3, 1), 173 PIN_FIELD_BASE(129, 129, 3, 0x040, 0x10, 1, 1), 174 PIN_FIELD_BASE(130, 130, 3, 0x040, 0x10, 4, 1), 175 PIN_FIELD_BASE(131, 131, 3, 0x040, 0x10, 2, 1), 176 PIN_FIELD_BASE(132, 132, 6, 0x030, 0x10, 13, 1), 177 PIN_FIELD_BASE(133, 133, 6, 0x030, 0x10, 12, 1), 178 PIN_FIELD_BASE(134, 134, 6, 0x030, 0x10, 15, 1), 179 PIN_FIELD_BASE(135, 135, 6, 0x030, 0x10, 14, 1), 180 PIN_FIELD_BASE(136, 136, 1, 0x070, 0x10, 13, 1), 181 PIN_FIELD_BASE(137, 137, 1, 0x070, 0x10, 12, 1), 182 PIN_FIELD_BASE(138, 138, 1, 0x070, 0x10, 15, 1), 183 PIN_FIELD_BASE(139, 139, 1, 0x070, 0x10, 14, 1), 184 PIN_FIELD_BASE(140, 140, 1, 0x070, 0x10, 17, 1), 185 PIN_FIELD_BASE(141, 141, 1, 0x070, 0x10, 16, 1), 186 PIN_FIELD_BASE(142, 142, 1, 0x070, 0x10, 19, 1), 187 PIN_FIELD_BASE(143, 143, 1, 0x070, 0x10, 18, 1), 188 }; 189 190 static const struct mtk_pin_field_calc mt8195_pin_smt_range[] = { 191 PIN_FIELD_BASE(0, 0, 4, 0x0d0, 0x10, 0, 1), 192 PIN_FIELD_BASE(1, 1, 4, 0x0d0, 0x10, 1, 1), 193 PIN_FIELD_BASE(2, 2, 4, 0x0d0, 0x10, 2, 1), 194 PIN_FIELD_BASE(3, 3, 4, 0x0d0, 0x10, 3, 1), 195 PIN_FIELD_BASE(4, 4, 4, 0x0d0, 0x10, 4, 1), 196 PIN_FIELD_BASE(5, 5, 4, 0x0d0, 0x10, 5, 1), 197 PINS_FIELD_BASE(6, 7, 4, 0x0d0, 0x10, 6, 1), 198 PIN_FIELD_BASE(8, 8, 4, 0x0d0, 0x10, 12, 1), 199 PIN_FIELD_BASE(9, 9, 4, 0x0d0, 0x10, 7, 1), 200 PIN_FIELD_BASE(10, 10, 4, 0x0d0, 0x10, 13, 1), 201 PIN_FIELD_BASE(11, 11, 4, 0x0d0, 0x10, 8, 1), 202 PIN_FIELD_BASE(12, 12, 4, 0x0d0, 0x10, 14, 1), 203 PIN_FIELD_BASE(13, 13, 4, 0x0d0, 0x10, 9, 1), 204 PIN_FIELD_BASE(14, 14, 4, 0x0d0, 0x10, 15, 1), 205 PIN_FIELD_BASE(15, 15, 4, 0x0d0, 0x10, 10, 1), 206 PIN_FIELD_BASE(16, 16, 4, 0x0d0, 0x10, 16, 1), 207 PIN_FIELD_BASE(17, 17, 4, 0x0d0, 0x10, 11, 1), 208 PIN_FIELD_BASE(18, 18, 2, 0x090, 0x10, 11, 1), 209 PIN_FIELD_BASE(19, 19, 2, 0x090, 0x10, 10, 1), 210 PIN_FIELD_BASE(20, 20, 2, 0x090, 0x10, 9, 1), 211 PIN_FIELD_BASE(21, 21, 2, 0x090, 0x10, 11, 1), 212 PIN_FIELD_BASE(22, 22, 2, 0x090, 0x10, 0, 1), 213 PIN_FIELD_BASE(23, 23, 2, 0x090, 0x10, 1, 1), 214 PIN_FIELD_BASE(24, 24, 2, 0x090, 0x10, 2, 1), 215 PIN_FIELD_BASE(25, 25, 2, 0x090, 0x10, 4, 1), 216 PIN_FIELD_BASE(26, 26, 2, 0x090, 0x10, 3, 1), 217 PIN_FIELD_BASE(27, 27, 2, 0x090, 0x10, 5, 1), 218 PIN_FIELD_BASE(28, 28, 2, 0x090, 0x10, 6, 1), 219 PIN_FIELD_BASE(29, 29, 2, 0x090, 0x10, 7, 1), 220 PIN_FIELD_BASE(30, 30, 2, 0x090, 0x10, 8, 1), 221 PINS_FIELD_BASE(31, 33, 1, 0x0f0, 0x10, 4, 1), 222 PIN_FIELD_BASE(34, 34, 1, 0x0f0, 0x10, 0, 1), 223 PIN_FIELD_BASE(35, 35, 1, 0x0f0, 0x10, 1, 1), 224 PIN_FIELD_BASE(36, 36, 1, 0x0f0, 0x10, 4, 1), 225 PIN_FIELD_BASE(37, 37, 1, 0x0f0, 0x10, 2, 1), 226 PINS_FIELD_BASE(38, 39, 1, 0x0f0, 0x10, 5, 1), 227 PIN_FIELD_BASE(40, 40, 1, 0x0f0, 0x10, 14, 1), 228 PIN_FIELD_BASE(41, 41, 1, 0x0f0, 0x10, 13, 1), 229 PIN_FIELD_BASE(42, 42, 1, 0x0f0, 0x10, 16, 1), 230 PIN_FIELD_BASE(43, 43, 1, 0x0f0, 0x10, 15, 1), 231 PIN_FIELD_BASE(44, 44, 1, 0x0f0, 0x10, 25, 1), 232 PIN_FIELD_BASE(45, 45, 1, 0x0f0, 0x10, 26, 1), 233 PINS_FIELD_BASE(46, 47, 1, 0x0f0, 0x10, 5, 1), 234 PINS_FIELD_BASE(48, 51, 1, 0x0f0, 0x10, 6, 1), 235 PINS_FIELD_BASE(52, 55, 1, 0x0f0, 0x10, 7, 1), 236 PINS_FIELD_BASE(56, 59, 1, 0x0f0, 0x10, 8, 1), 237 PINS_FIELD_BASE(60, 63, 1, 0x0f0, 0x10, 9, 1), 238 PIN_FIELD_BASE(64, 64, 1, 0x0f0, 0x10, 10, 1), 239 PINS_FIELD_BASE(65, 68, 1, 0x0f0, 0x10, 3, 1), 240 PINS_FIELD_BASE(69, 71, 1, 0x0f0, 0x10, 10, 1), 241 PINS_FIELD_BASE(72, 75, 1, 0x0f0, 0x10, 11, 1), 242 PIN_FIELD_BASE(76, 76, 1, 0x0f0, 0x10, 12, 1), 243 PIN_FIELD_BASE(77, 77, 3, 0x0e0, 0x10, 0, 1), 244 PIN_FIELD_BASE(78, 78, 3, 0x0e0, 0x10, 1, 1), 245 PIN_FIELD_BASE(79, 79, 3, 0x0e0, 0x10, 6, 1), 246 PIN_FIELD_BASE(80, 80, 3, 0x0e0, 0x10, 7, 1), 247 PIN_FIELD_BASE(81, 81, 3, 0x0e0, 0x10, 8, 1), 248 PIN_FIELD_BASE(82, 82, 3, 0x0e0, 0x10, 9, 1), 249 PIN_FIELD_BASE(83, 83, 3, 0x0e0, 0x10, 10, 1), 250 PIN_FIELD_BASE(84, 84, 3, 0x0e0, 0x10, 11, 1), 251 PINS_FIELD_BASE(85, 88, 3, 0x0e0, 0x10, 14, 1), 252 PIN_FIELD_BASE(89, 89, 3, 0x0e0, 0x10, 2, 1), 253 PIN_FIELD_BASE(90, 90, 3, 0x0e0, 0x10, 3, 1), 254 PIN_FIELD_BASE(91, 91, 3, 0x0e0, 0x10, 4, 1), 255 PIN_FIELD_BASE(92, 92, 3, 0x0e0, 0x10, 5, 1), 256 PIN_FIELD_BASE(93, 93, 3, 0x0e0, 0x10, 12, 1), 257 PIN_FIELD_BASE(94, 94, 3, 0x0e0, 0x10, 13, 1), 258 PINS_FIELD_BASE(95, 98, 3, 0x0e0, 0x10, 15, 1), 259 PINS_FIELD_BASE(99, 102, 3, 0x0e0, 0x10, 16, 1), 260 PINS_FIELD_BASE(103, 104, 3, 0x0e0, 0x10, 17, 1), 261 PIN_FIELD_BASE(105, 105, 3, 0x0e0, 0x10, 18, 1), 262 PINS_FIELD_BASE(106, 107, 3, 0x0e0, 0x10, 17, 1), 263 PINS_FIELD_BASE(108, 109, 3, 0x0e0, 0x10, 18, 1), 264 PIN_FIELD_BASE(110, 110, 5, 0x070, 0x10, 1, 1), 265 PIN_FIELD_BASE(111, 111, 5, 0x070, 0x10, 0, 1), 266 PIN_FIELD_BASE(112, 112, 5, 0x070, 0x10, 2, 1), 267 PIN_FIELD_BASE(113, 113, 5, 0x070, 0x10, 3, 1), 268 PIN_FIELD_BASE(114, 114, 5, 0x070, 0x10, 4, 1), 269 PIN_FIELD_BASE(115, 115, 5, 0x070, 0x10, 5, 1), 270 PIN_FIELD_BASE(116, 116, 6, 0x0c0, 0x10, 9, 1), 271 PIN_FIELD_BASE(117, 117, 6, 0x0c0, 0x10, 8, 1), 272 PIN_FIELD_BASE(118, 118, 6, 0x0c0, 0x10, 7, 1), 273 PIN_FIELD_BASE(119, 119, 6, 0x0c0, 0x10, 6, 1), 274 PIN_FIELD_BASE(120, 120, 6, 0x0c0, 0x10, 11, 1), 275 PIN_FIELD_BASE(121, 121, 6, 0x0c0, 0x10, 1, 1), 276 PIN_FIELD_BASE(122, 122, 6, 0x0c0, 0x10, 0, 1), 277 PIN_FIELD_BASE(123, 123, 6, 0x0c0, 0x10, 5, 1), 278 PIN_FIELD_BASE(124, 124, 6, 0x0c0, 0x10, 4, 1), 279 PIN_FIELD_BASE(125, 125, 6, 0x0c0, 0x10, 3, 1), 280 PIN_FIELD_BASE(126, 126, 6, 0x0c0, 0x10, 2, 1), 281 PIN_FIELD_BASE(127, 127, 6, 0x0c0, 0x10, 10, 1), 282 PIN_FIELD_BASE(128, 128, 3, 0x0e0, 0x10, 18, 1), 283 PINS_FIELD_BASE(129, 131, 3, 0x0e0, 0x10, 19, 1), 284 PIN_FIELD_BASE(132, 132, 6, 0x0c0, 0x10, 13, 1), 285 PIN_FIELD_BASE(133, 133, 6, 0x0c0, 0x10, 12, 1), 286 PIN_FIELD_BASE(134, 134, 6, 0x0c0, 0x10, 15, 1), 287 PIN_FIELD_BASE(135, 135, 6, 0x0c0, 0x10, 14, 1), 288 PIN_FIELD_BASE(136, 136, 1, 0x0f0, 0x10, 18, 1), 289 PIN_FIELD_BASE(137, 137, 1, 0x0f0, 0x10, 17, 1), 290 PIN_FIELD_BASE(138, 138, 1, 0x0f0, 0x10, 20, 1), 291 PIN_FIELD_BASE(139, 139, 1, 0x0f0, 0x10, 19, 1), 292 PIN_FIELD_BASE(140, 140, 1, 0x0f0, 0x10, 22, 1), 293 PIN_FIELD_BASE(141, 141, 1, 0x0f0, 0x10, 21, 1), 294 PIN_FIELD_BASE(142, 142, 1, 0x0f0, 0x10, 24, 1), 295 PIN_FIELD_BASE(143, 143, 1, 0x0f0, 0x10, 23, 1), 296 }; 297 298 static const struct mtk_pin_field_calc mt8195_pin_pu_range[] = { 299 PIN_FIELD_BASE(6, 6, 4, 0x0070, 0x10, 0, 1), 300 PIN_FIELD_BASE(7, 7, 4, 0x0070, 0x10, 1, 1), 301 PIN_FIELD_BASE(8, 8, 4, 0x0070, 0x10, 7, 1), 302 PIN_FIELD_BASE(9, 9, 4, 0x0070, 0x10, 2, 1), 303 PIN_FIELD_BASE(10, 10, 4, 0x0070, 0x10, 8, 1), 304 PIN_FIELD_BASE(11, 11, 4, 0x0070, 0x10, 3, 1), 305 PIN_FIELD_BASE(12, 12, 4, 0x0070, 0x10, 9, 1), 306 PIN_FIELD_BASE(13, 13, 4, 0x0070, 0x10, 4, 1), 307 PIN_FIELD_BASE(14, 14, 4, 0x0070, 0x10, 10, 1), 308 PIN_FIELD_BASE(15, 15, 4, 0x0070, 0x10, 5, 1), 309 PIN_FIELD_BASE(16, 16, 4, 0x0070, 0x10, 11, 1), 310 PIN_FIELD_BASE(17, 17, 4, 0x0070, 0x10, 6, 1), 311 PIN_FIELD_BASE(18, 18, 2, 0x0060, 0x10, 5, 1), 312 PIN_FIELD_BASE(19, 19, 2, 0x0060, 0x10, 12, 1), 313 PIN_FIELD_BASE(20, 20, 2, 0x0060, 0x10, 11, 1), 314 PIN_FIELD_BASE(21, 21, 2, 0x0060, 0x10, 10, 1), 315 PIN_FIELD_BASE(22, 22, 2, 0x0060, 0x10, 0, 1), 316 PIN_FIELD_BASE(23, 23, 2, 0x0060, 0x10, 1, 1), 317 PIN_FIELD_BASE(24, 24, 2, 0x0060, 0x10, 2, 1), 318 PIN_FIELD_BASE(25, 25, 2, 0x0060, 0x10, 4, 1), 319 PIN_FIELD_BASE(26, 26, 2, 0x0060, 0x10, 3, 1), 320 PIN_FIELD_BASE(27, 27, 2, 0x0060, 0x10, 6, 1), 321 PIN_FIELD_BASE(28, 28, 2, 0x0060, 0x10, 7, 1), 322 PIN_FIELD_BASE(29, 29, 2, 0x0060, 0x10, 8, 1), 323 PIN_FIELD_BASE(30, 30, 2, 0x0060, 0x10, 9, 1), 324 PIN_FIELD_BASE(31, 31, 1, 0x00a0, 0x10, 13, 1), 325 PIN_FIELD_BASE(32, 32, 1, 0x00a0, 0x10, 12, 1), 326 PIN_FIELD_BASE(33, 33, 1, 0x00a0, 0x10, 11, 1), 327 PIN_FIELD_BASE(34, 34, 1, 0x00a0, 0x10, 14, 1), 328 PIN_FIELD_BASE(35, 35, 1, 0x00a0, 0x10, 15, 1), 329 PIN_FIELD_BASE(36, 36, 1, 0x00b0, 0x10, 3, 1), 330 PIN_FIELD_BASE(37, 37, 1, 0x00b0, 0x10, 6, 1), 331 PIN_FIELD_BASE(38, 38, 1, 0x00b0, 0x10, 4, 1), 332 PIN_FIELD_BASE(39, 39, 1, 0x00b0, 0x10, 5, 1), 333 PIN_FIELD_BASE(40, 40, 1, 0x00b0, 0x10, 8, 1), 334 PIN_FIELD_BASE(41, 41, 1, 0x00b0, 0x10, 7, 1), 335 PIN_FIELD_BASE(42, 42, 1, 0x00b0, 0x10, 10, 1), 336 PIN_FIELD_BASE(43, 43, 1, 0x00b0, 0x10, 9, 1), 337 PIN_FIELD_BASE(44, 44, 1, 0x00b0, 0x10, 21, 1), 338 PIN_FIELD_BASE(45, 45, 1, 0x00b0, 0x10, 22, 1), 339 PIN_FIELD_BASE(46, 46, 1, 0x00a0, 0x10, 18, 1), 340 PIN_FIELD_BASE(47, 47, 1, 0x00a0, 0x10, 16, 1), 341 PIN_FIELD_BASE(48, 48, 1, 0x00a0, 0x10, 19, 1), 342 PIN_FIELD_BASE(49, 49, 1, 0x00a0, 0x10, 17, 1), 343 PIN_FIELD_BASE(50, 50, 1, 0x00a0, 0x10, 25, 1), 344 PIN_FIELD_BASE(51, 51, 1, 0x00a0, 0x10, 20, 1), 345 PIN_FIELD_BASE(52, 52, 1, 0x00a0, 0x10, 26, 1), 346 PIN_FIELD_BASE(53, 53, 1, 0x00a0, 0x10, 21, 1), 347 PIN_FIELD_BASE(54, 54, 1, 0x00a0, 0x10, 22, 1), 348 PIN_FIELD_BASE(55, 55, 1, 0x00a0, 0x10, 23, 1), 349 PIN_FIELD_BASE(56, 56, 1, 0x00a0, 0x10, 24, 1), 350 PIN_FIELD_BASE(57, 57, 1, 0x00a0, 0x10, 29, 1), 351 PIN_FIELD_BASE(58, 58, 1, 0x00a0, 0x10, 27, 1), 352 PIN_FIELD_BASE(59, 59, 1, 0x00a0, 0x10, 30, 1), 353 PIN_FIELD_BASE(60, 60, 1, 0x00a0, 0x10, 28, 1), 354 PIN_FIELD_BASE(61, 61, 1, 0x00a0, 0x10, 8, 1), 355 PIN_FIELD_BASE(62, 62, 1, 0x00a0, 0x10, 7, 1), 356 PIN_FIELD_BASE(63, 63, 1, 0x00a0, 0x10, 10, 1), 357 PIN_FIELD_BASE(64, 64, 1, 0x00a0, 0x10, 9, 1), 358 PIN_FIELD_BASE(65, 65, 1, 0x00b0, 0x10, 1, 1), 359 PIN_FIELD_BASE(66, 66, 1, 0x00a0, 0x10, 31, 1), 360 PIN_FIELD_BASE(67, 67, 1, 0x00b0, 0x10, 0, 1), 361 PIN_FIELD_BASE(68, 68, 1, 0x00b0, 0x10, 2, 1), 362 PIN_FIELD_BASE(69, 69, 1, 0x00a0, 0x10, 0, 1), 363 PIN_FIELD_BASE(70, 70, 1, 0x00a0, 0x10, 6, 1), 364 PIN_FIELD_BASE(71, 71, 1, 0x00a0, 0x10, 4, 1), 365 PIN_FIELD_BASE(72, 72, 1, 0x00a0, 0x10, 5, 1), 366 PIN_FIELD_BASE(73, 73, 1, 0x00a0, 0x10, 1, 1), 367 PIN_FIELD_BASE(74, 74, 1, 0x00a0, 0x10, 2, 1), 368 PIN_FIELD_BASE(75, 75, 1, 0x00a0, 0x10, 3, 1), 369 PIN_FIELD_BASE(76, 76, 1, 0x00b0, 0x10, 11, 1), 370 PIN_FIELD_BASE(97, 97, 3, 0x0070, 0x10, 0, 1), 371 PIN_FIELD_BASE(98, 98, 3, 0x0070, 0x10, 4, 1), 372 PIN_FIELD_BASE(99, 99, 3, 0x0070, 0x10, 3, 1), 373 PIN_FIELD_BASE(100, 100, 3, 0x0070, 0x10, 6, 1), 374 PIN_FIELD_BASE(101, 101, 3, 0x0070, 0x10, 5, 1), 375 PIN_FIELD_BASE(102, 102, 3, 0x0070, 0x10, 8, 1), 376 PIN_FIELD_BASE(103, 103, 3, 0x0070, 0x10, 7, 1), 377 PIN_FIELD_BASE(108, 108, 3, 0x0070, 0x10, 2, 1), 378 PIN_FIELD_BASE(109, 109, 3, 0x0070, 0x10, 1, 1), 379 PIN_FIELD_BASE(128, 128, 3, 0x0070, 0x10, 11, 1), 380 PIN_FIELD_BASE(129, 129, 3, 0x0070, 0x10, 9, 1), 381 PIN_FIELD_BASE(130, 130, 3, 0x0070, 0x10, 12, 1), 382 PIN_FIELD_BASE(131, 131, 3, 0x0070, 0x10, 10, 1), 383 PIN_FIELD_BASE(132, 132, 6, 0x0060, 0x10, 1, 1), 384 PIN_FIELD_BASE(133, 133, 6, 0x0060, 0x10, 0, 1), 385 PIN_FIELD_BASE(134, 134, 6, 0x0060, 0x10, 3, 1), 386 PIN_FIELD_BASE(135, 135, 6, 0x0060, 0x10, 2, 1), 387 PIN_FIELD_BASE(136, 136, 1, 0x00b0, 0x10, 14, 1), 388 PIN_FIELD_BASE(137, 137, 1, 0x00b0, 0x10, 13, 1), 389 PIN_FIELD_BASE(138, 138, 1, 0x00b0, 0x10, 16, 1), 390 PIN_FIELD_BASE(139, 139, 1, 0x00b0, 0x10, 15, 1), 391 PIN_FIELD_BASE(140, 140, 1, 0x00b0, 0x10, 18, 1), 392 PIN_FIELD_BASE(141, 141, 1, 0x00b0, 0x10, 17, 1), 393 PIN_FIELD_BASE(142, 142, 1, 0x00b0, 0x10, 20, 1), 394 PIN_FIELD_BASE(143, 143, 1, 0x00b0, 0x10, 19, 1), 395 }; 396 397 static const struct mtk_pin_field_calc mt8195_pin_pd_range[] = { 398 PIN_FIELD_BASE(6, 6, 4, 0x0050, 0x10, 0, 1), 399 PIN_FIELD_BASE(7, 7, 4, 0x0050, 0x10, 1, 1), 400 PIN_FIELD_BASE(8, 8, 4, 0x0050, 0x10, 7, 1), 401 PIN_FIELD_BASE(9, 9, 4, 0x0050, 0x10, 2, 1), 402 PIN_FIELD_BASE(10, 10, 4, 0x0050, 0x10, 8, 1), 403 PIN_FIELD_BASE(11, 11, 4, 0x0050, 0x10, 3, 1), 404 PIN_FIELD_BASE(12, 12, 4, 0x0050, 0x10, 9, 1), 405 PIN_FIELD_BASE(13, 13, 4, 0x0050, 0x10, 4, 1), 406 PIN_FIELD_BASE(14, 14, 4, 0x0050, 0x10, 10, 1), 407 PIN_FIELD_BASE(15, 15, 4, 0x0050, 0x10, 5, 1), 408 PIN_FIELD_BASE(16, 16, 4, 0x0050, 0x10, 11, 1), 409 PIN_FIELD_BASE(17, 17, 4, 0x0050, 0x10, 6, 1), 410 PIN_FIELD_BASE(18, 18, 2, 0x0050, 0x10, 5, 1), 411 PIN_FIELD_BASE(19, 19, 2, 0x0050, 0x10, 12, 1), 412 PIN_FIELD_BASE(20, 20, 2, 0x0050, 0x10, 11, 1), 413 PIN_FIELD_BASE(21, 21, 2, 0x0050, 0x10, 10, 1), 414 PIN_FIELD_BASE(22, 22, 2, 0x0050, 0x10, 0, 1), 415 PIN_FIELD_BASE(23, 23, 2, 0x0050, 0x10, 1, 1), 416 PIN_FIELD_BASE(24, 24, 2, 0x0050, 0x10, 2, 1), 417 PIN_FIELD_BASE(25, 25, 2, 0x0050, 0x10, 4, 1), 418 PIN_FIELD_BASE(26, 26, 2, 0x0050, 0x10, 3, 1), 419 PIN_FIELD_BASE(27, 27, 2, 0x0050, 0x10, 6, 1), 420 PIN_FIELD_BASE(28, 28, 2, 0x0050, 0x10, 7, 1), 421 PIN_FIELD_BASE(29, 29, 2, 0x0050, 0x10, 8, 1), 422 PIN_FIELD_BASE(30, 30, 2, 0x0050, 0x10, 9, 1), 423 PIN_FIELD_BASE(31, 31, 1, 0x0080, 0x10, 13, 1), 424 PIN_FIELD_BASE(32, 32, 1, 0x0080, 0x10, 12, 1), 425 PIN_FIELD_BASE(33, 33, 1, 0x0080, 0x10, 11, 1), 426 PIN_FIELD_BASE(34, 34, 1, 0x0080, 0x10, 14, 1), 427 PIN_FIELD_BASE(35, 35, 1, 0x0080, 0x10, 15, 1), 428 PIN_FIELD_BASE(36, 36, 1, 0x0090, 0x10, 3, 1), 429 PIN_FIELD_BASE(37, 37, 1, 0x0090, 0x10, 6, 1), 430 PIN_FIELD_BASE(38, 38, 1, 0x0090, 0x10, 4, 1), 431 PIN_FIELD_BASE(39, 39, 1, 0x0090, 0x10, 5, 1), 432 PIN_FIELD_BASE(40, 40, 1, 0x0090, 0x10, 8, 1), 433 PIN_FIELD_BASE(41, 41, 1, 0x0090, 0x10, 7, 1), 434 PIN_FIELD_BASE(42, 42, 1, 0x0090, 0x10, 10, 1), 435 PIN_FIELD_BASE(43, 43, 1, 0x0090, 0x10, 9, 1), 436 PIN_FIELD_BASE(44, 44, 1, 0x0090, 0x10, 21, 1), 437 PIN_FIELD_BASE(45, 45, 1, 0x0090, 0x10, 22, 1), 438 PIN_FIELD_BASE(46, 46, 1, 0x0080, 0x10, 18, 1), 439 PIN_FIELD_BASE(47, 47, 1, 0x0080, 0x10, 16, 1), 440 PIN_FIELD_BASE(48, 48, 1, 0x0080, 0x10, 19, 1), 441 PIN_FIELD_BASE(49, 49, 1, 0x0080, 0x10, 17, 1), 442 PIN_FIELD_BASE(50, 50, 1, 0x0080, 0x10, 25, 1), 443 PIN_FIELD_BASE(51, 51, 1, 0x0080, 0x10, 20, 1), 444 PIN_FIELD_BASE(52, 52, 1, 0x0080, 0x10, 26, 1), 445 PIN_FIELD_BASE(53, 53, 1, 0x0080, 0x10, 21, 1), 446 PIN_FIELD_BASE(54, 54, 1, 0x0080, 0x10, 22, 1), 447 PIN_FIELD_BASE(55, 55, 1, 0x0080, 0x10, 23, 1), 448 PIN_FIELD_BASE(56, 56, 1, 0x0080, 0x10, 24, 1), 449 PIN_FIELD_BASE(57, 57, 1, 0x0080, 0x10, 29, 1), 450 PIN_FIELD_BASE(58, 58, 1, 0x0080, 0x10, 27, 1), 451 PIN_FIELD_BASE(59, 59, 1, 0x0080, 0x10, 30, 1), 452 PIN_FIELD_BASE(60, 60, 1, 0x0080, 0x10, 28, 1), 453 PIN_FIELD_BASE(61, 61, 1, 0x0080, 0x10, 8, 1), 454 PIN_FIELD_BASE(62, 62, 1, 0x0080, 0x10, 7, 1), 455 PIN_FIELD_BASE(63, 63, 1, 0x0080, 0x10, 10, 1), 456 PIN_FIELD_BASE(64, 64, 1, 0x0080, 0x10, 9, 1), 457 PIN_FIELD_BASE(65, 65, 1, 0x0090, 0x10, 1, 1), 458 PIN_FIELD_BASE(66, 66, 1, 0x0080, 0x10, 31, 1), 459 PIN_FIELD_BASE(67, 67, 1, 0x0090, 0x10, 0, 1), 460 PIN_FIELD_BASE(68, 68, 1, 0x0090, 0x10, 2, 1), 461 PIN_FIELD_BASE(69, 69, 1, 0x0080, 0x10, 0, 1), 462 PIN_FIELD_BASE(70, 70, 1, 0x0080, 0x10, 6, 1), 463 PIN_FIELD_BASE(71, 71, 1, 0x0080, 0x10, 4, 1), 464 PIN_FIELD_BASE(72, 72, 1, 0x0080, 0x10, 5, 1), 465 PIN_FIELD_BASE(73, 73, 1, 0x0080, 0x10, 1, 1), 466 PIN_FIELD_BASE(74, 74, 1, 0x0080, 0x10, 2, 1), 467 PIN_FIELD_BASE(75, 75, 1, 0x0080, 0x10, 3, 1), 468 PIN_FIELD_BASE(76, 76, 1, 0x0090, 0x10, 11, 1), 469 PIN_FIELD_BASE(97, 97, 3, 0x0050, 0x10, 0, 1), 470 PIN_FIELD_BASE(98, 98, 3, 0x0050, 0x10, 4, 1), 471 PIN_FIELD_BASE(99, 99, 3, 0x0050, 0x10, 3, 1), 472 PIN_FIELD_BASE(100, 100, 3, 0x0050, 0x10, 6, 1), 473 PIN_FIELD_BASE(101, 101, 3, 0x0050, 0x10, 5, 1), 474 PIN_FIELD_BASE(102, 102, 3, 0x0050, 0x10, 8, 1), 475 PIN_FIELD_BASE(103, 103, 3, 0x0050, 0x10, 7, 1), 476 PIN_FIELD_BASE(108, 108, 3, 0x0050, 0x10, 2, 1), 477 PIN_FIELD_BASE(109, 109, 3, 0x0050, 0x10, 1, 1), 478 PIN_FIELD_BASE(128, 128, 3, 0x0050, 0x10, 11, 1), 479 PIN_FIELD_BASE(129, 129, 3, 0x0050, 0x10, 9, 1), 480 PIN_FIELD_BASE(130, 130, 3, 0x0050, 0x10, 12, 1), 481 PIN_FIELD_BASE(131, 131, 3, 0x0050, 0x10, 10, 1), 482 PIN_FIELD_BASE(132, 132, 6, 0x0040, 0x10, 1, 1), 483 PIN_FIELD_BASE(133, 133, 6, 0x0040, 0x10, 0, 1), 484 PIN_FIELD_BASE(134, 134, 6, 0x0040, 0x10, 3, 1), 485 PIN_FIELD_BASE(135, 135, 6, 0x0040, 0x10, 2, 1), 486 PIN_FIELD_BASE(136, 136, 1, 0x0090, 0x10, 14, 1), 487 PIN_FIELD_BASE(137, 137, 1, 0x0090, 0x10, 13, 1), 488 PIN_FIELD_BASE(138, 138, 1, 0x0090, 0x10, 16, 1), 489 PIN_FIELD_BASE(139, 139, 1, 0x0090, 0x10, 15, 1), 490 PIN_FIELD_BASE(140, 140, 1, 0x0090, 0x10, 18, 1), 491 PIN_FIELD_BASE(141, 141, 1, 0x0090, 0x10, 17, 1), 492 PIN_FIELD_BASE(142, 142, 1, 0x0090, 0x10, 20, 1), 493 PIN_FIELD_BASE(143, 143, 1, 0x0090, 0x10, 19, 1), 494 }; 495 496 static const struct mtk_pin_field_calc mt8195_pin_pupd_range[] = { 497 PIN_FIELD_BASE(0, 0, 4, 0x0060, 0x10, 0, 1), 498 PIN_FIELD_BASE(1, 1, 4, 0x0060, 0x10, 1, 1), 499 PIN_FIELD_BASE(2, 2, 4, 0x0060, 0x10, 2, 1), 500 PIN_FIELD_BASE(3, 3, 4, 0x0060, 0x10, 3, 1), 501 PIN_FIELD_BASE(4, 4, 4, 0x0060, 0x10, 4, 1), 502 PIN_FIELD_BASE(5, 5, 4, 0x0060, 0x10, 5, 1), 503 PIN_FIELD_BASE(77, 77, 3, 0x0060, 0x10, 1, 1), 504 PIN_FIELD_BASE(78, 78, 3, 0x0060, 0x10, 2, 1), 505 PIN_FIELD_BASE(79, 79, 3, 0x0060, 0x10, 9, 1), 506 PIN_FIELD_BASE(80, 80, 3, 0x0060, 0x10, 10, 1), 507 PIN_FIELD_BASE(81, 81, 3, 0x0060, 0x10, 11, 1), 508 PIN_FIELD_BASE(82, 82, 3, 0x0060, 0x10, 12, 1), 509 PIN_FIELD_BASE(83, 83, 3, 0x0060, 0x10, 13, 1), 510 PIN_FIELD_BASE(84, 84, 3, 0x0060, 0x10, 14, 1), 511 PIN_FIELD_BASE(85, 85, 3, 0x0060, 0x10, 15, 1), 512 PIN_FIELD_BASE(86, 86, 3, 0x0060, 0x10, 16, 1), 513 PIN_FIELD_BASE(87, 87, 3, 0x0060, 0x10, 3, 1), 514 PIN_FIELD_BASE(88, 88, 3, 0x0060, 0x10, 4, 1), 515 PIN_FIELD_BASE(89, 89, 3, 0x0060, 0x10, 5, 1), 516 PIN_FIELD_BASE(90, 90, 3, 0x0060, 0x10, 6, 1), 517 PIN_FIELD_BASE(91, 91, 3, 0x0060, 0x10, 7, 1), 518 PIN_FIELD_BASE(92, 92, 3, 0x0060, 0x10, 8, 1), 519 PIN_FIELD_BASE(93, 93, 3, 0x0060, 0x10, 18, 1), 520 PIN_FIELD_BASE(94, 94, 3, 0x0060, 0x10, 19, 1), 521 PIN_FIELD_BASE(95, 95, 3, 0x0060, 0x10, 17, 1), 522 PIN_FIELD_BASE(96, 96, 3, 0x0060, 0x10, 0, 1), 523 PIN_FIELD_BASE(104, 104, 3, 0x0060, 0x10, 22, 1), 524 PIN_FIELD_BASE(105, 105, 3, 0x0060, 0x10, 23, 1), 525 PIN_FIELD_BASE(106, 106, 3, 0x0060, 0x10, 20, 1), 526 PIN_FIELD_BASE(107, 107, 3, 0x0060, 0x10, 21, 1), 527 PIN_FIELD_BASE(110, 110, 5, 0x0020, 0x10, 1, 1), 528 PIN_FIELD_BASE(111, 111, 5, 0x0020, 0x10, 0, 1), 529 PIN_FIELD_BASE(112, 112, 5, 0x0020, 0x10, 2, 1), 530 PIN_FIELD_BASE(113, 113, 5, 0x0020, 0x10, 3, 1), 531 PIN_FIELD_BASE(114, 114, 5, 0x0020, 0x10, 4, 1), 532 PIN_FIELD_BASE(115, 115, 5, 0x0020, 0x10, 5, 1), 533 PIN_FIELD_BASE(116, 116, 6, 0x0050, 0x10, 9, 1), 534 PIN_FIELD_BASE(117, 117, 6, 0x0050, 0x10, 8, 1), 535 PIN_FIELD_BASE(118, 118, 6, 0x0050, 0x10, 7, 1), 536 PIN_FIELD_BASE(119, 119, 6, 0x0050, 0x10, 6, 1), 537 PIN_FIELD_BASE(120, 120, 6, 0x0050, 0x10, 11, 1), 538 PIN_FIELD_BASE(121, 121, 6, 0x0050, 0x10, 1, 1), 539 PIN_FIELD_BASE(122, 122, 6, 0x0050, 0x10, 0, 1), 540 PIN_FIELD_BASE(123, 123, 6, 0x0050, 0x10, 5, 1), 541 PIN_FIELD_BASE(124, 124, 6, 0x0050, 0x10, 4, 1), 542 PIN_FIELD_BASE(125, 125, 6, 0x0050, 0x10, 3, 1), 543 PIN_FIELD_BASE(126, 126, 6, 0x0050, 0x10, 2, 1), 544 PIN_FIELD_BASE(127, 127, 6, 0x0050, 0x10, 10, 1), 545 }; 546 547 static const struct mtk_pin_field_calc mt8195_pin_r0_range[] = { 548 PIN_FIELD_BASE(0, 0, 4, 0x0080, 0x10, 0, 1), 549 PIN_FIELD_BASE(1, 1, 4, 0x0080, 0x10, 1, 1), 550 PIN_FIELD_BASE(2, 2, 4, 0x0080, 0x10, 2, 1), 551 PIN_FIELD_BASE(3, 3, 4, 0x0080, 0x10, 3, 1), 552 PIN_FIELD_BASE(4, 4, 4, 0x0080, 0x10, 4, 1), 553 PIN_FIELD_BASE(5, 5, 4, 0x0080, 0x10, 5, 1), 554 PIN_FIELD_BASE(77, 77, 3, 0x0080, 0x10, 1, 1), 555 PIN_FIELD_BASE(78, 78, 3, 0x0080, 0x10, 2, 1), 556 PIN_FIELD_BASE(79, 79, 3, 0x0080, 0x10, 9, 1), 557 PIN_FIELD_BASE(80, 80, 3, 0x0080, 0x10, 10, 1), 558 PIN_FIELD_BASE(81, 81, 3, 0x0080, 0x10, 11, 1), 559 PIN_FIELD_BASE(82, 82, 3, 0x0080, 0x10, 12, 1), 560 PIN_FIELD_BASE(83, 83, 3, 0x0080, 0x10, 13, 1), 561 PIN_FIELD_BASE(84, 84, 3, 0x0080, 0x10, 14, 1), 562 PIN_FIELD_BASE(85, 85, 3, 0x0080, 0x10, 15, 1), 563 PIN_FIELD_BASE(86, 86, 3, 0x0080, 0x10, 16, 1), 564 PIN_FIELD_BASE(87, 87, 3, 0x0080, 0x10, 3, 1), 565 PIN_FIELD_BASE(88, 88, 3, 0x0080, 0x10, 4, 1), 566 PIN_FIELD_BASE(89, 89, 3, 0x0080, 0x10, 5, 1), 567 PIN_FIELD_BASE(90, 90, 3, 0x0080, 0x10, 6, 1), 568 PIN_FIELD_BASE(91, 91, 3, 0x0080, 0x10, 7, 1), 569 PIN_FIELD_BASE(92, 92, 3, 0x0080, 0x10, 8, 1), 570 PIN_FIELD_BASE(93, 93, 3, 0x0080, 0x10, 18, 1), 571 PIN_FIELD_BASE(94, 94, 3, 0x0080, 0x10, 19, 1), 572 PIN_FIELD_BASE(95, 95, 3, 0x0080, 0x10, 17, 1), 573 PIN_FIELD_BASE(96, 96, 3, 0x0080, 0x10, 0, 1), 574 PIN_FIELD_BASE(104, 104, 3, 0x0080, 0x10, 22, 1), 575 PIN_FIELD_BASE(105, 105, 3, 0x0080, 0x10, 23, 1), 576 PIN_FIELD_BASE(106, 106, 3, 0x0080, 0x10, 20, 1), 577 PIN_FIELD_BASE(107, 107, 3, 0x0080, 0x10, 21, 1), 578 PIN_FIELD_BASE(110, 110, 5, 0x0030, 0x10, 1, 1), 579 PIN_FIELD_BASE(111, 111, 5, 0x0030, 0x10, 0, 1), 580 PIN_FIELD_BASE(112, 112, 5, 0x0030, 0x10, 2, 1), 581 PIN_FIELD_BASE(113, 113, 5, 0x0030, 0x10, 3, 1), 582 PIN_FIELD_BASE(114, 114, 5, 0x0030, 0x10, 4, 1), 583 PIN_FIELD_BASE(115, 115, 5, 0x0030, 0x10, 5, 1), 584 PIN_FIELD_BASE(116, 116, 6, 0x0070, 0x10, 9, 1), 585 PIN_FIELD_BASE(117, 117, 6, 0x0070, 0x10, 8, 1), 586 PIN_FIELD_BASE(118, 118, 6, 0x0070, 0x10, 7, 1), 587 PIN_FIELD_BASE(119, 119, 6, 0x0070, 0x10, 6, 1), 588 PIN_FIELD_BASE(120, 120, 6, 0x0070, 0x10, 11, 1), 589 PIN_FIELD_BASE(121, 121, 6, 0x0070, 0x10, 1, 1), 590 PIN_FIELD_BASE(122, 122, 6, 0x0070, 0x10, 0, 1), 591 PIN_FIELD_BASE(123, 123, 6, 0x0070, 0x10, 5, 1), 592 PIN_FIELD_BASE(124, 124, 6, 0x0070, 0x10, 4, 1), 593 PIN_FIELD_BASE(125, 125, 6, 0x0070, 0x10, 3, 1), 594 PIN_FIELD_BASE(126, 126, 6, 0x0070, 0x10, 2, 1), 595 PIN_FIELD_BASE(127, 127, 6, 0x0070, 0x10, 10, 1), 596 }; 597 598 static const struct mtk_pin_field_calc mt8195_pin_r1_range[] = { 599 PIN_FIELD_BASE(0, 0, 4, 0x0090, 0x10, 0, 1), 600 PIN_FIELD_BASE(1, 1, 4, 0x0090, 0x10, 1, 1), 601 PIN_FIELD_BASE(2, 2, 4, 0x0090, 0x10, 2, 1), 602 PIN_FIELD_BASE(3, 3, 4, 0x0090, 0x10, 3, 1), 603 PIN_FIELD_BASE(4, 4, 4, 0x0090, 0x10, 4, 1), 604 PIN_FIELD_BASE(5, 5, 4, 0x0090, 0x10, 5, 1), 605 PIN_FIELD_BASE(77, 77, 3, 0x0090, 0x10, 1, 1), 606 PIN_FIELD_BASE(78, 78, 3, 0x0090, 0x10, 2, 1), 607 PIN_FIELD_BASE(79, 79, 3, 0x0090, 0x10, 9, 1), 608 PIN_FIELD_BASE(80, 80, 3, 0x0090, 0x10, 10, 1), 609 PIN_FIELD_BASE(81, 81, 3, 0x0090, 0x10, 11, 1), 610 PIN_FIELD_BASE(82, 82, 3, 0x0090, 0x10, 12, 1), 611 PIN_FIELD_BASE(83, 83, 3, 0x0090, 0x10, 13, 1), 612 PIN_FIELD_BASE(84, 84, 3, 0x0090, 0x10, 14, 1), 613 PIN_FIELD_BASE(85, 85, 3, 0x0090, 0x10, 15, 1), 614 PIN_FIELD_BASE(86, 86, 3, 0x0090, 0x10, 16, 1), 615 PIN_FIELD_BASE(87, 87, 3, 0x0090, 0x10, 3, 1), 616 PIN_FIELD_BASE(88, 88, 3, 0x0090, 0x10, 4, 1), 617 PIN_FIELD_BASE(89, 89, 3, 0x0090, 0x10, 5, 1), 618 PIN_FIELD_BASE(90, 90, 3, 0x0090, 0x10, 6, 1), 619 PIN_FIELD_BASE(91, 91, 3, 0x0090, 0x10, 7, 1), 620 PIN_FIELD_BASE(92, 92, 3, 0x0090, 0x10, 8, 1), 621 PIN_FIELD_BASE(93, 93, 3, 0x0090, 0x10, 18, 1), 622 PIN_FIELD_BASE(94, 94, 3, 0x0090, 0x10, 19, 1), 623 PIN_FIELD_BASE(95, 95, 3, 0x0090, 0x10, 17, 1), 624 PIN_FIELD_BASE(96, 96, 3, 0x0090, 0x10, 0, 1), 625 PIN_FIELD_BASE(104, 104, 3, 0x0090, 0x10, 22, 1), 626 PIN_FIELD_BASE(105, 105, 3, 0x0090, 0x10, 23, 1), 627 PIN_FIELD_BASE(106, 106, 3, 0x0090, 0x10, 20, 1), 628 PIN_FIELD_BASE(107, 107, 3, 0x0090, 0x10, 21, 1), 629 PIN_FIELD_BASE(110, 110, 5, 0x0040, 0x10, 1, 1), 630 PIN_FIELD_BASE(111, 111, 5, 0x0040, 0x10, 0, 1), 631 PIN_FIELD_BASE(112, 112, 5, 0x0040, 0x10, 2, 1), 632 PIN_FIELD_BASE(113, 113, 5, 0x0040, 0x10, 3, 1), 633 PIN_FIELD_BASE(114, 114, 5, 0x0040, 0x10, 4, 1), 634 PIN_FIELD_BASE(115, 115, 5, 0x0040, 0x10, 5, 1), 635 PIN_FIELD_BASE(116, 116, 6, 0x0080, 0x10, 9, 1), 636 PIN_FIELD_BASE(117, 117, 6, 0x0080, 0x10, 8, 1), 637 PIN_FIELD_BASE(118, 118, 6, 0x0080, 0x10, 7, 1), 638 PIN_FIELD_BASE(119, 119, 6, 0x0080, 0x10, 6, 1), 639 PIN_FIELD_BASE(120, 120, 6, 0x0080, 0x10, 11, 1), 640 PIN_FIELD_BASE(121, 121, 6, 0x0080, 0x10, 1, 1), 641 PIN_FIELD_BASE(122, 122, 6, 0x0080, 0x10, 0, 1), 642 PIN_FIELD_BASE(123, 123, 6, 0x0080, 0x10, 5, 1), 643 PIN_FIELD_BASE(124, 124, 6, 0x0080, 0x10, 4, 1), 644 PIN_FIELD_BASE(125, 125, 6, 0x0080, 0x10, 3, 1), 645 PIN_FIELD_BASE(126, 126, 6, 0x0080, 0x10, 2, 1), 646 PIN_FIELD_BASE(127, 127, 6, 0x0080, 0x10, 10, 1), 647 }; 648 649 static const struct mtk_pin_field_calc mt8195_pin_drv_range[] = { 650 PIN_FIELD_BASE(0, 0, 4, 0x000, 0x10, 0, 3), 651 PIN_FIELD_BASE(1, 1, 4, 0x000, 0x10, 3, 3), 652 PIN_FIELD_BASE(2, 2, 4, 0x000, 0x10, 6, 3), 653 PIN_FIELD_BASE(3, 3, 4, 0x000, 0x10, 9, 3), 654 PIN_FIELD_BASE(4, 4, 4, 0x000, 0x10, 12, 3), 655 PIN_FIELD_BASE(5, 5, 4, 0x000, 0x10, 15, 3), 656 PINS_FIELD_BASE(6, 7, 4, 0x000, 0x10, 18, 3), 657 PIN_FIELD_BASE(8, 8, 4, 0x010, 0x10, 6, 3), 658 PIN_FIELD_BASE(9, 9, 4, 0x000, 0x10, 21, 3), 659 PIN_FIELD_BASE(10, 10, 4, 0x010, 0x10, 9, 3), 660 PIN_FIELD_BASE(11, 11, 4, 0x000, 0x10, 24, 3), 661 PIN_FIELD_BASE(12, 12, 4, 0x010, 0x10, 12, 3), 662 PIN_FIELD_BASE(13, 13, 4, 0x010, 0x10, 27, 3), 663 PIN_FIELD_BASE(14, 14, 4, 0x010, 0x10, 15, 3), 664 PIN_FIELD_BASE(15, 15, 4, 0x010, 0x10, 0, 3), 665 PIN_FIELD_BASE(16, 16, 4, 0x010, 0x10, 18, 3), 666 PIN_FIELD_BASE(17, 17, 4, 0x010, 0x10, 3, 3), 667 PIN_FIELD_BASE(18, 18, 2, 0x010, 0x10, 6, 3), 668 PIN_FIELD_BASE(19, 19, 2, 0x010, 0x10, 3, 3), 669 PIN_FIELD_BASE(20, 20, 2, 0x010, 0x10, 0, 3), 670 PIN_FIELD_BASE(21, 21, 2, 0x000, 0x10, 27, 3), 671 PIN_FIELD_BASE(22, 22, 2, 0x000, 0x10, 0, 3), 672 PIN_FIELD_BASE(23, 23, 2, 0x000, 0x10, 3, 3), 673 PIN_FIELD_BASE(24, 24, 2, 0x000, 0x10, 6, 3), 674 PIN_FIELD_BASE(25, 25, 2, 0x000, 0x10, 12, 3), 675 PIN_FIELD_BASE(26, 26, 2, 0x000, 0x10, 9, 3), 676 PIN_FIELD_BASE(27, 27, 2, 0x000, 0x10, 15, 3), 677 PIN_FIELD_BASE(28, 28, 2, 0x000, 0x10, 18, 3), 678 PIN_FIELD_BASE(29, 29, 2, 0x000, 0x10, 21, 3), 679 PIN_FIELD_BASE(30, 30, 2, 0x000, 0x10, 24, 3), 680 PINS_FIELD_BASE(31, 33, 1, 0x010, 0x10, 0, 3), 681 PIN_FIELD_BASE(34, 34, 1, 0x000, 0x10, 21, 3), 682 PIN_FIELD_BASE(35, 35, 1, 0x000, 0x10, 24, 3), 683 PIN_FIELD_BASE(36, 36, 1, 0x010, 0x10, 0, 3), 684 PIN_FIELD_BASE(37, 37, 1, 0x010, 0x10, 21, 3), 685 PINS_FIELD_BASE(38, 39, 1, 0x010, 0x10, 3, 3), 686 PIN_FIELD_BASE(40, 40, 1, 0x010, 0x10, 27, 3), 687 PIN_FIELD_BASE(41, 41, 1, 0x010, 0x10, 24, 3), 688 PIN_FIELD_BASE(42, 42, 1, 0x020, 0x10, 3, 3), 689 PIN_FIELD_BASE(43, 43, 1, 0x020, 0x10, 0, 3), 690 PIN_FIELD_BASE(44, 44, 1, 0x030, 0x10, 0, 3), 691 PIN_FIELD_BASE(45, 45, 1, 0x030, 0x10, 3, 3), 692 PINS_FIELD_BASE(46, 47, 1, 0x010, 0x10, 3, 3), 693 PINS_FIELD_BASE(48, 51, 1, 0x010, 0x10, 6, 3), 694 PINS_FIELD_BASE(52, 55, 1, 0x010, 0x10, 9, 3), 695 PINS_FIELD_BASE(56, 59, 1, 0x010, 0x10, 12, 3), 696 PINS_FIELD_BASE(60, 63, 1, 0x010, 0x10, 15, 3), 697 PIN_FIELD_BASE(64, 64, 1, 0x010, 0x10, 18, 3), 698 PINS_FIELD_BASE(65, 68, 1, 0x000, 0x10, 27, 3), 699 PIN_FIELD_BASE(69, 69, 1, 0x000, 0x10, 0, 3), 700 PIN_FIELD_BASE(70, 70, 1, 0x000, 0x10, 18, 3), 701 PIN_FIELD_BASE(71, 71, 1, 0x000, 0x10, 12, 3), 702 PIN_FIELD_BASE(72, 72, 1, 0x000, 0x10, 15, 3), 703 PIN_FIELD_BASE(73, 73, 1, 0x000, 0x10, 3, 3), 704 PIN_FIELD_BASE(74, 74, 1, 0x000, 0x10, 6, 3), 705 PIN_FIELD_BASE(75, 75, 1, 0x000, 0x10, 9, 3), 706 PIN_FIELD_BASE(76, 76, 1, 0x010, 0x10, 18, 3), 707 PIN_FIELD_BASE(77, 77, 3, 0x000, 0x10, 0, 3), 708 PIN_FIELD_BASE(78, 78, 3, 0x000, 0x10, 15, 3), 709 PIN_FIELD_BASE(79, 79, 3, 0x000, 0x10, 18, 3), 710 PIN_FIELD_BASE(80, 80, 3, 0x000, 0x10, 21, 3), 711 PIN_FIELD_BASE(81, 81, 3, 0x000, 0x10, 28, 3), 712 PIN_FIELD_BASE(82, 82, 3, 0x000, 0x10, 27, 3), 713 PIN_FIELD_BASE(83, 83, 3, 0x010, 0x10, 0, 3), 714 PIN_FIELD_BASE(84, 84, 3, 0x010, 0x10, 3, 3), 715 PINS_FIELD_BASE(85, 88, 3, 0x010, 0x10, 15, 3), 716 PIN_FIELD_BASE(89, 89, 3, 0x000, 0x10, 3, 3), 717 PIN_FIELD_BASE(90, 90, 3, 0x000, 0x10, 6, 3), 718 PIN_FIELD_BASE(91, 91, 3, 0x000, 0x10, 9, 3), 719 PIN_FIELD_BASE(92, 92, 3, 0x000, 0x10, 12, 3), 720 PIN_FIELD_BASE(93, 93, 3, 0x010, 0x10, 6, 3), 721 PIN_FIELD_BASE(94, 94, 3, 0x010, 0x10, 9, 3), 722 PINS_FIELD_BASE(95, 98, 3, 0x010, 0x10, 18, 3), 723 PINS_FIELD_BASE(99, 102, 3, 0x010, 0x10, 21, 3), 724 PINS_FIELD_BASE(103, 104, 3, 0x010, 0x10, 24, 3), 725 PIN_FIELD_BASE(105, 105, 3, 0x010, 0x10, 27, 3), 726 PINS_FIELD_BASE(106, 107, 3, 0x010, 0x10, 24, 3), 727 PINS_FIELD_BASE(108, 109, 3, 0x010, 0x10, 27, 3), 728 PIN_FIELD_BASE(110, 110, 5, 0x000, 0x10, 3, 3), 729 PIN_FIELD_BASE(111, 111, 5, 0x000, 0x10, 0, 3), 730 PIN_FIELD_BASE(112, 112, 5, 0x000, 0x10, 6, 3), 731 PIN_FIELD_BASE(113, 113, 5, 0x000, 0x10, 9, 3), 732 PIN_FIELD_BASE(114, 114, 5, 0x000, 0x10, 12, 3), 733 PIN_FIELD_BASE(115, 115, 5, 0x000, 0x10, 15, 3), 734 PIN_FIELD_BASE(116, 116, 6, 0x000, 0x10, 27, 3), 735 PIN_FIELD_BASE(117, 117, 6, 0x000, 0x10, 24, 3), 736 PIN_FIELD_BASE(118, 118, 6, 0x000, 0x10, 21, 3), 737 PIN_FIELD_BASE(119, 119, 6, 0x000, 0x10, 18, 3), 738 PIN_FIELD_BASE(120, 120, 6, 0x010, 0x10, 3, 3), 739 PIN_FIELD_BASE(121, 121, 6, 0x000, 0x10, 3, 3), 740 PIN_FIELD_BASE(122, 122, 6, 0x000, 0x10, 0, 3), 741 PIN_FIELD_BASE(123, 123, 6, 0x000, 0x10, 15, 3), 742 PIN_FIELD_BASE(124, 124, 6, 0x000, 0x10, 12, 3), 743 PIN_FIELD_BASE(125, 125, 6, 0x000, 0x10, 9, 3), 744 PIN_FIELD_BASE(126, 126, 6, 0x000, 0x10, 6, 3), 745 PIN_FIELD_BASE(127, 127, 6, 0x010, 0x10, 0, 3), 746 PIN_FIELD_BASE(128, 128, 3, 0x010, 0x10, 27, 3), 747 PINS_FIELD_BASE(129, 130, 3, 0x020, 0x10, 0, 3), 748 PINS_FIELD_BASE(131, 131, 3, 0x010, 0x10, 12, 3), 749 PIN_FIELD_BASE(132, 132, 6, 0x010, 0x10, 9, 3), 750 PIN_FIELD_BASE(133, 133, 6, 0x010, 0x10, 6, 3), 751 PIN_FIELD_BASE(134, 134, 6, 0x010, 0x10, 15, 3), 752 PIN_FIELD_BASE(135, 135, 6, 0x010, 0x10, 12, 3), 753 PIN_FIELD_BASE(136, 136, 1, 0x020, 0x10, 9, 3), 754 PIN_FIELD_BASE(137, 137, 1, 0x020, 0x10, 6, 3), 755 PIN_FIELD_BASE(138, 138, 1, 0x020, 0x10, 15, 3), 756 PIN_FIELD_BASE(139, 139, 1, 0x020, 0x10, 12, 3), 757 PIN_FIELD_BASE(140, 140, 1, 0x020, 0x10, 21, 3), 758 PIN_FIELD_BASE(141, 141, 1, 0x020, 0x10, 18, 3), 759 PIN_FIELD_BASE(142, 142, 1, 0x020, 0x10, 27, 3), 760 PIN_FIELD_BASE(143, 143, 1, 0x020, 0x10, 24, 3), 761 }; 762 763 static const struct mtk_pin_field_calc mt8195_pin_drv_adv_range[] = { 764 PIN_FIELD_BASE(8, 8, 4, 0x020, 0x10, 15, 3), 765 PIN_FIELD_BASE(9, 9, 4, 0x020, 0x10, 0, 3), 766 PIN_FIELD_BASE(10, 10, 4, 0x020, 0x10, 18, 3), 767 PIN_FIELD_BASE(11, 11, 4, 0x020, 0x10, 3, 3), 768 PIN_FIELD_BASE(12, 12, 4, 0x020, 0x10, 21, 3), 769 PIN_FIELD_BASE(13, 13, 4, 0x020, 0x10, 6, 3), 770 PIN_FIELD_BASE(14, 14, 4, 0x020, 0x10, 24, 3), 771 PIN_FIELD_BASE(15, 15, 4, 0x020, 0x10, 9, 3), 772 PIN_FIELD_BASE(16, 16, 4, 0x020, 0x10, 27, 3), 773 PIN_FIELD_BASE(17, 17, 4, 0x020, 0x10, 12, 3), 774 PIN_FIELD_BASE(29, 29, 2, 0x020, 0x10, 0, 3), 775 PIN_FIELD_BASE(30, 30, 2, 0x020, 0x10, 3, 3), 776 PIN_FIELD_BASE(34, 34, 1, 0x040, 0x10, 0, 3), 777 PIN_FIELD_BASE(35, 35, 1, 0x040, 0x10, 3, 3), 778 PIN_FIELD_BASE(44, 44, 1, 0x040, 0x10, 6, 3), 779 PIN_FIELD_BASE(45, 45, 1, 0x040, 0x10, 9, 3), 780 }; 781 782 static const struct mtk_pin_reg_calc mt8195_reg_cals[PINCTRL_PIN_REG_MAX] = { 783 [PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt8195_pin_mode_range), 784 [PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt8195_pin_dir_range), 785 [PINCTRL_PIN_REG_DI] = MTK_RANGE(mt8195_pin_di_range), 786 [PINCTRL_PIN_REG_DO] = MTK_RANGE(mt8195_pin_do_range), 787 [PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt8195_pin_smt_range), 788 [PINCTRL_PIN_REG_IES] = MTK_RANGE(mt8195_pin_ies_range), 789 [PINCTRL_PIN_REG_PU] = MTK_RANGE(mt8195_pin_pu_range), 790 [PINCTRL_PIN_REG_PD] = MTK_RANGE(mt8195_pin_pd_range), 791 [PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt8195_pin_drv_range), 792 [PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt8195_pin_pupd_range), 793 [PINCTRL_PIN_REG_R0] = MTK_RANGE(mt8195_pin_r0_range), 794 [PINCTRL_PIN_REG_R1] = MTK_RANGE(mt8195_pin_r1_range), 795 [PINCTRL_PIN_REG_DRV_ADV] = MTK_RANGE(mt8195_pin_drv_adv_range), 796 }; 797 798 static const char * const mt8195_pinctrl_register_base_names[] = { 799 "iocfg0", "iocfg_bm", "iocfg_bl", "iocfg_br", "iocfg_lm", 800 "iocfg_rb", "iocfg_tl", 801 }; 802 803 static const struct mtk_eint_hw mt8195_eint_hw = { 804 .port_mask = 0xf, 805 .ports = 7, 806 .ap_num = 225, 807 .db_cnt = 32, 808 }; 809 810 static const struct mtk_pin_soc mt8195_data = { 811 .reg_cal = mt8195_reg_cals, 812 .pins = mtk_pins_mt8195, 813 .npins = ARRAY_SIZE(mtk_pins_mt8195), 814 .ngrps = ARRAY_SIZE(mtk_pins_mt8195), 815 .eint_hw = &mt8195_eint_hw, 816 .nfuncs = 8, 817 .gpio_m = 0, 818 .base_names = mt8195_pinctrl_register_base_names, 819 .nbase_names = ARRAY_SIZE(mt8195_pinctrl_register_base_names), 820 .bias_set_combo = mtk_pinconf_bias_set_combo, 821 .bias_get_combo = mtk_pinconf_bias_get_combo, 822 .drive_set = mtk_pinconf_drive_set_rev1, 823 .drive_get = mtk_pinconf_drive_get_rev1, 824 .adv_drive_get = mtk_pinconf_adv_drive_get_raw, 825 .adv_drive_set = mtk_pinconf_adv_drive_set_raw, 826 }; 827 828 static const struct of_device_id mt8195_pinctrl_of_match[] = { 829 { .compatible = "mediatek,mt8195-pinctrl", }, 830 { } 831 }; 832 833 static int mt8195_pinctrl_probe(struct platform_device *pdev) 834 { 835 return mtk_paris_pinctrl_probe(pdev, &mt8195_data); 836 } 837 838 static struct platform_driver mt8195_pinctrl_driver = { 839 .driver = { 840 .name = "mt8195-pinctrl", 841 .of_match_table = mt8195_pinctrl_of_match, 842 }, 843 .probe = mt8195_pinctrl_probe, 844 }; 845 846 static int __init mt8195_pinctrl_init(void) 847 { 848 return platform_driver_register(&mt8195_pinctrl_driver); 849 } 850 arch_initcall(mt8195_pinctrl_init); 851