xref: /linux/drivers/pinctrl/mediatek/pinctrl-mt8195.c (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
16cf5e9efSZhiyong Tao // SPDX-License-Identifier: GPL-2.0
26cf5e9efSZhiyong Tao /*
36cf5e9efSZhiyong Tao  * Copyright (C) 2020 MediaTek Inc.
46cf5e9efSZhiyong Tao  *
56cf5e9efSZhiyong Tao  * Author: Zhiyong Tao <zhiyong.tao@mediatek.com>
66cf5e9efSZhiyong Tao  *
76cf5e9efSZhiyong Tao  */
86cf5e9efSZhiyong Tao 
96cf5e9efSZhiyong Tao #include "pinctrl-mtk-mt8195.h"
106cf5e9efSZhiyong Tao #include "pinctrl-paris.h"
116cf5e9efSZhiyong Tao 
126cf5e9efSZhiyong Tao /* MT8195 have multiple bases to program pin configuration listed as the below:
136cf5e9efSZhiyong Tao  * iocfg[0]:0x10005000, iocfg[1]:0x11d10000, iocfg[2]:0x11d30000,
146cf5e9efSZhiyong Tao  * iocfg[3]:0x11d40000, iocfg[4]:0x11e20000, iocfg[5]:0x11eb0000,
156cf5e9efSZhiyong Tao  * iocfg[6]:0x11f40000.
166cf5e9efSZhiyong Tao  * _i_based could be used to indicate what base the pin should be mapped into.
176cf5e9efSZhiyong Tao  */
186cf5e9efSZhiyong Tao 
196cf5e9efSZhiyong Tao #define PIN_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \
206cf5e9efSZhiyong Tao 	PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, \
216cf5e9efSZhiyong Tao 		       32, 0)
226cf5e9efSZhiyong Tao 
236cf5e9efSZhiyong Tao #define PINS_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \
246cf5e9efSZhiyong Tao 	PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits,  \
256cf5e9efSZhiyong Tao 		       32, 1)
266cf5e9efSZhiyong Tao 
276cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_mode_range[] = {
286cf5e9efSZhiyong Tao 	PIN_FIELD(0, 144, 0x300, 0x10, 0, 4),
296cf5e9efSZhiyong Tao };
306cf5e9efSZhiyong Tao 
316cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_dir_range[] = {
326cf5e9efSZhiyong Tao 	PIN_FIELD(0, 144, 0x0, 0x10, 0, 1),
336cf5e9efSZhiyong Tao };
346cf5e9efSZhiyong Tao 
356cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_di_range[] = {
366cf5e9efSZhiyong Tao 	PIN_FIELD(0, 144, 0x200, 0x10, 0, 1),
376cf5e9efSZhiyong Tao };
386cf5e9efSZhiyong Tao 
396cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_do_range[] = {
406cf5e9efSZhiyong Tao 	PIN_FIELD(0, 144, 0x100, 0x10, 0, 1),
416cf5e9efSZhiyong Tao };
426cf5e9efSZhiyong Tao 
436cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_ies_range[] = {
446cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(0, 0, 4, 0x040, 0x10, 0, 1),
456cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(1, 1, 4, 0x040, 0x10, 1, 1),
466cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(2, 2, 4, 0x040, 0x10, 2, 1),
476cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(3, 3, 4, 0x040, 0x10, 3, 1),
486cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(4, 4, 4, 0x040, 0x10, 4, 1),
496cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(5, 5, 4, 0x040, 0x10, 5, 1),
506cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(6, 6, 4, 0x040, 0x10, 6, 1),
516cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(7, 7, 4, 0x040, 0x10, 7, 1),
526cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(8, 8, 4, 0x040, 0x10, 13, 1),
536cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(9, 9, 4, 0x040, 0x10, 8, 1),
546cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(10, 10, 4, 0x040, 0x10, 14, 1),
556cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(11, 11, 4, 0x040, 0x10, 9, 1),
566cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(12, 12, 4, 0x040, 0x10, 15, 1),
576cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(13, 13, 4, 0x040, 0x10, 10, 1),
586cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(14, 14, 4, 0x040, 0x10, 16, 1),
596cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(15, 15, 4, 0x040, 0x10, 11, 1),
606cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(16, 16, 4, 0x040, 0x10, 17, 1),
616cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(17, 17, 4, 0x040, 0x10, 12, 1),
626cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(18, 18, 2, 0x040, 0x10, 5, 1),
636cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(19, 19, 2, 0x040, 0x10, 12, 1),
646cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(20, 20, 2, 0x040, 0x10, 11, 1),
656cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(21, 21, 2, 0x040, 0x10, 10, 1),
666cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(22, 22, 2, 0x040, 0x10, 0, 1),
676cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(23, 23, 2, 0x040, 0x10, 1, 1),
686cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(24, 24, 2, 0x040, 0x10, 2, 1),
696cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(25, 25, 2, 0x040, 0x10, 4, 1),
706cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(26, 26, 2, 0x040, 0x10, 3, 1),
716cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(27, 27, 2, 0x040, 0x10, 6, 1),
726cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(28, 28, 2, 0x040, 0x10, 7, 1),
736cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(29, 29, 2, 0x040, 0x10, 8, 1),
746cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(30, 30, 2, 0x040, 0x10, 9, 1),
756cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(31, 31, 1, 0x060, 0x10, 13, 1),
766cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(32, 32, 1, 0x060, 0x10, 12, 1),
776cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(33, 33, 1, 0x060, 0x10, 11, 1),
786cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(34, 34, 1, 0x060, 0x10, 14, 1),
796cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(35, 35, 1, 0x060, 0x10, 15, 1),
806cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(36, 36, 1, 0x070, 0x10, 3, 1),
816cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(37, 37, 1, 0x070, 0x10, 6, 1),
826cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(38, 38, 1, 0x070, 0x10, 4, 1),
836cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(39, 39, 1, 0x070, 0x10, 5, 1),
846cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(40, 40, 1, 0x070, 0x10, 8, 1),
856cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(41, 41, 1, 0x070, 0x10, 7, 1),
866cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(42, 42, 1, 0x070, 0x10, 10, 1),
876cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(43, 43, 1, 0x070, 0x10, 9, 1),
886cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(44, 44, 1, 0x070, 0x10, 20, 1),
896cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(45, 45, 1, 0x070, 0x10, 21, 1),
906cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(46, 46, 1, 0x060, 0x10, 18, 1),
916cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(47, 47, 1, 0x060, 0x10, 16, 1),
926cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(48, 48, 1, 0x060, 0x10, 19, 1),
936cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(49, 49, 1, 0x060, 0x10, 17, 1),
946cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(50, 50, 1, 0x060, 0x10, 25, 1),
956cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(51, 51, 1, 0x060, 0x10, 20, 1),
966cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(52, 52, 1, 0x060, 0x10, 26, 1),
976cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(53, 53, 1, 0x060, 0x10, 21, 1),
986cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(54, 54, 1, 0x060, 0x10, 22, 1),
996cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(55, 55, 1, 0x060, 0x10, 23, 1),
1006cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(56, 56, 1, 0x060, 0x10, 24, 1),
1016cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(57, 57, 1, 0x060, 0x10, 29, 1),
1026cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(58, 58, 1, 0x060, 0x10, 27, 1),
1036cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(59, 59, 1, 0x060, 0x10, 30, 1),
1046cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(60, 60, 1, 0x060, 0x10, 28, 1),
1056cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(61, 61, 1, 0x060, 0x10, 8, 1),
1066cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(62, 62, 1, 0x060, 0x10, 7, 1),
1076cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(63, 63, 1, 0x060, 0x10, 10, 1),
1086cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(64, 64, 1, 0x060, 0x10, 9, 1),
1096cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(65, 65, 1, 0x070, 0x10, 1, 1),
1106cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(66, 66, 1, 0x060, 0x10, 31, 1),
1116cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(67, 67, 1, 0x070, 0x10, 0, 1),
1126cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(68, 68, 1, 0x070, 0x10, 2, 1),
1136cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(69, 69, 1, 0x060, 0x10, 0, 1),
1146cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(70, 70, 1, 0x060, 0x10, 6, 1),
1156cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(71, 71, 1, 0x060, 0x10, 4, 1),
1166cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(72, 72, 1, 0x060, 0x10, 5, 1),
1176cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(73, 73, 1, 0x060, 0x10, 1, 1),
1186cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(74, 74, 1, 0x060, 0x10, 2, 1),
1196cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(75, 75, 1, 0x060, 0x10, 3, 1),
1206cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(76, 76, 1, 0x070, 0x10, 11, 1),
1216cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(77, 77, 3, 0x030, 0x10, 1, 1),
1226cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(78, 78, 3, 0x030, 0x10, 2, 1),
1236cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(79, 79, 3, 0x030, 0x10, 9, 1),
1246cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(80, 80, 3, 0x030, 0x10, 10, 1),
1256cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(81, 81, 3, 0x030, 0x10, 11, 1),
1266cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(82, 82, 3, 0x030, 0x10, 12, 1),
1276cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(83, 83, 3, 0x030, 0x10, 13, 1),
1286cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(84, 84, 3, 0x030, 0x10, 14, 1),
1296cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(85, 85, 3, 0x030, 0x10, 15, 1),
1306cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(86, 86, 3, 0x030, 0x10, 16, 1),
1316cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(87, 87, 3, 0x030, 0x10, 3, 1),
1326cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(88, 88, 3, 0x030, 0x10, 4, 1),
1336cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(89, 89, 3, 0x030, 0x10, 5, 1),
1346cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(90, 90, 3, 0x030, 0x10, 6, 1),
1356cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(91, 91, 3, 0x030, 0x10, 7, 1),
1366cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(92, 92, 3, 0x030, 0x10, 8, 1),
1376cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(93, 93, 3, 0x030, 0x10, 18, 1),
1386cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(94, 94, 3, 0x030, 0x10, 19, 1),
1396cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(95, 95, 3, 0x030, 0x10, 17, 1),
1406cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(96, 96, 3, 0x030, 0x10, 0, 1),
1416cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(97, 97, 3, 0x030, 0x10, 20, 1),
1426cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(98, 98, 3, 0x030, 0x10, 28, 1),
1436cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(99, 99, 3, 0x030, 0x10, 27, 1),
1446cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(100, 100, 3, 0x030, 0x10, 30, 1),
1456cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(101, 101, 3, 0x030, 0x10, 29, 1),
1466cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(102, 102, 3, 0x040, 0x10, 0, 1),
1476cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(103, 103, 3, 0x030, 0x10, 31, 1),
1486cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(104, 104, 3, 0x030, 0x10, 25, 1),
1496cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(105, 105, 3, 0x030, 0x10, 26, 1),
1506cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(106, 106, 3, 0x030, 0x10, 23, 1),
1516cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(107, 107, 3, 0x030, 0x10, 24, 1),
1526cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(108, 108, 3, 0x030, 0x10, 22, 1),
1536cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(109, 109, 3, 0x030, 0x10, 21, 1),
1546cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(110, 110, 5, 0x010, 0x10, 1, 1),
1556cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(111, 111, 5, 0x010, 0x10, 0, 1),
1566cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(112, 112, 5, 0x010, 0x10, 2, 1),
1576cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(113, 113, 5, 0x010, 0x10, 3, 1),
1586cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(114, 114, 5, 0x010, 0x10, 4, 1),
1596cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(115, 115, 5, 0x010, 0x10, 5, 1),
1606cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(116, 116, 6, 0x030, 0x10, 9, 1),
1616cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(117, 117, 6, 0x030, 0x10, 8, 1),
1626cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(118, 118, 6, 0x030, 0x10, 7, 1),
1636cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(119, 119, 6, 0x030, 0x10, 6, 1),
1646cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(120, 120, 6, 0x030, 0x10, 11, 1),
1656cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(121, 121, 6, 0x030, 0x10, 1, 1),
1666cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(122, 122, 6, 0x030, 0x10, 0, 1),
1676cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(123, 123, 6, 0x030, 0x10, 5, 1),
1686cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(124, 124, 6, 0x030, 0x10, 4, 1),
1696cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(125, 125, 6, 0x030, 0x10, 3, 1),
1706cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(126, 126, 6, 0x030, 0x10, 2, 1),
1716cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(127, 127, 6, 0x030, 0x10, 10, 1),
1726cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(128, 128, 3, 0x040, 0x10, 3, 1),
1736cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(129, 129, 3, 0x040, 0x10, 1, 1),
1746cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(130, 130, 3, 0x040, 0x10, 4, 1),
1756cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(131, 131, 3, 0x040, 0x10, 2, 1),
1766cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(132, 132, 6, 0x030, 0x10, 13, 1),
1776cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(133, 133, 6, 0x030, 0x10, 12, 1),
1786cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(134, 134, 6, 0x030, 0x10, 15, 1),
1796cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(135, 135, 6, 0x030, 0x10, 14, 1),
1806cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(136, 136, 1, 0x070, 0x10, 13, 1),
1816cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(137, 137, 1, 0x070, 0x10, 12, 1),
1826cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(138, 138, 1, 0x070, 0x10, 15, 1),
1836cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(139, 139, 1, 0x070, 0x10, 14, 1),
1846cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(140, 140, 1, 0x070, 0x10, 17, 1),
1856cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(141, 141, 1, 0x070, 0x10, 16, 1),
1866cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(142, 142, 1, 0x070, 0x10, 19, 1),
1876cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(143, 143, 1, 0x070, 0x10, 18, 1),
1886cf5e9efSZhiyong Tao };
1896cf5e9efSZhiyong Tao 
1906cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_smt_range[] = {
1916cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(0, 0, 4, 0x0d0, 0x10, 0, 1),
1926cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(1, 1, 4, 0x0d0, 0x10, 1, 1),
1936cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(2, 2, 4, 0x0d0, 0x10, 2, 1),
1946cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(3, 3, 4, 0x0d0, 0x10, 3, 1),
1956cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(4, 4, 4, 0x0d0, 0x10, 4, 1),
1966cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(5, 5, 4, 0x0d0, 0x10, 5, 1),
1976cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(6, 7, 4, 0x0d0, 0x10, 6, 1),
1986cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(8, 8, 4, 0x0d0, 0x10, 12, 1),
1996cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(9, 9, 4, 0x0d0, 0x10, 7, 1),
2006cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(10, 10, 4, 0x0d0, 0x10, 13, 1),
2016cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(11, 11, 4, 0x0d0, 0x10, 8, 1),
2026cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(12, 12, 4, 0x0d0, 0x10, 14, 1),
2036cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(13, 13, 4, 0x0d0, 0x10, 9, 1),
2046cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(14, 14, 4, 0x0d0, 0x10, 15, 1),
2056cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(15, 15, 4, 0x0d0, 0x10, 10, 1),
2066cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(16, 16, 4, 0x0d0, 0x10, 16, 1),
2076cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(17, 17, 4, 0x0d0, 0x10, 11, 1),
2086cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(18, 18, 2, 0x090, 0x10, 11, 1),
2096cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(19, 19, 2, 0x090, 0x10, 10, 1),
2106cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(20, 20, 2, 0x090, 0x10, 9, 1),
2116cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(21, 21, 2, 0x090, 0x10, 11, 1),
2126cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(22, 22, 2, 0x090, 0x10, 0, 1),
2136cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(23, 23, 2, 0x090, 0x10, 1, 1),
2146cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(24, 24, 2, 0x090, 0x10, 2, 1),
2156cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(25, 25, 2, 0x090, 0x10, 4, 1),
2166cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(26, 26, 2, 0x090, 0x10, 3, 1),
2176cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(27, 27, 2, 0x090, 0x10, 5, 1),
2186cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(28, 28, 2, 0x090, 0x10, 6, 1),
2196cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(29, 29, 2, 0x090, 0x10, 7, 1),
2206cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(30, 30, 2, 0x090, 0x10, 8, 1),
2216cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(31, 33, 1, 0x0f0, 0x10, 4, 1),
2226cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(34, 34, 1, 0x0f0, 0x10, 0, 1),
2236cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(35, 35, 1, 0x0f0, 0x10, 1, 1),
2246cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(36, 36, 1, 0x0f0, 0x10, 4, 1),
2256cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(37, 37, 1, 0x0f0, 0x10, 2, 1),
2266cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(38, 39, 1, 0x0f0, 0x10, 5, 1),
2276cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(40, 40, 1, 0x0f0, 0x10, 14, 1),
2286cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(41, 41, 1, 0x0f0, 0x10, 13, 1),
2296cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(42, 42, 1, 0x0f0, 0x10, 16, 1),
2306cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(43, 43, 1, 0x0f0, 0x10, 15, 1),
2316cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(44, 44, 1, 0x0f0, 0x10, 25, 1),
2326cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(45, 45, 1, 0x0f0, 0x10, 26, 1),
2336cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(46, 47, 1, 0x0f0, 0x10, 5, 1),
2346cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(48, 51, 1, 0x0f0, 0x10, 6, 1),
2356cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(52, 55, 1, 0x0f0, 0x10, 7, 1),
2366cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(56, 59, 1, 0x0f0, 0x10, 8, 1),
2376cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(60, 63, 1, 0x0f0, 0x10, 9, 1),
2386cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(64, 64, 1, 0x0f0, 0x10, 10, 1),
2396cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(65, 68, 1, 0x0f0, 0x10, 3, 1),
2406cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(69, 71, 1, 0x0f0, 0x10, 10, 1),
2416cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(72, 75, 1, 0x0f0, 0x10, 11, 1),
2426cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(76, 76, 1, 0x0f0, 0x10, 12, 1),
2436cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(77, 77, 3, 0x0e0, 0x10, 0, 1),
2446cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(78, 78, 3, 0x0e0, 0x10, 1, 1),
2456cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(79, 79, 3, 0x0e0, 0x10, 6, 1),
2466cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(80, 80, 3, 0x0e0, 0x10, 7, 1),
2476cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(81, 81, 3, 0x0e0, 0x10, 8, 1),
2486cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(82, 82, 3, 0x0e0, 0x10, 9, 1),
2496cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(83, 83, 3, 0x0e0, 0x10, 10, 1),
2506cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(84, 84, 3, 0x0e0, 0x10, 11, 1),
2516cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(85, 88, 3, 0x0e0, 0x10, 14, 1),
2526cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(89, 89, 3, 0x0e0, 0x10, 2, 1),
2536cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(90, 90, 3, 0x0e0, 0x10, 3, 1),
2546cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(91, 91, 3, 0x0e0, 0x10, 4, 1),
2556cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(92, 92, 3, 0x0e0, 0x10, 5, 1),
2566cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(93, 93, 3, 0x0e0, 0x10, 12, 1),
2576cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(94, 94, 3, 0x0e0, 0x10, 13, 1),
2586cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(95, 98, 3, 0x0e0, 0x10, 15, 1),
2596cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(99, 102, 3, 0x0e0, 0x10, 16, 1),
2606cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(103, 104, 3, 0x0e0, 0x10, 17, 1),
2616cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(105, 105, 3, 0x0e0, 0x10, 18, 1),
2626cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(106, 107, 3, 0x0e0, 0x10, 17, 1),
2636cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(108, 109, 3, 0x0e0, 0x10, 18, 1),
2646cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(110, 110, 5, 0x070, 0x10, 1, 1),
2656cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(111, 111, 5, 0x070, 0x10, 0, 1),
2666cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(112, 112, 5, 0x070, 0x10, 2, 1),
2676cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(113, 113, 5, 0x070, 0x10, 3, 1),
2686cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(114, 114, 5, 0x070, 0x10, 4, 1),
2696cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(115, 115, 5, 0x070, 0x10, 5, 1),
2706cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(116, 116, 6, 0x0c0, 0x10, 9, 1),
2716cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(117, 117, 6, 0x0c0, 0x10, 8, 1),
2726cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(118, 118, 6, 0x0c0, 0x10, 7, 1),
2736cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(119, 119, 6, 0x0c0, 0x10, 6, 1),
2746cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(120, 120, 6, 0x0c0, 0x10, 11, 1),
2756cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(121, 121, 6, 0x0c0, 0x10, 1, 1),
2766cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(122, 122, 6, 0x0c0, 0x10, 0, 1),
2776cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(123, 123, 6, 0x0c0, 0x10, 5, 1),
2786cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(124, 124, 6, 0x0c0, 0x10, 4, 1),
2796cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(125, 125, 6, 0x0c0, 0x10, 3, 1),
2806cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(126, 126, 6, 0x0c0, 0x10, 2, 1),
2816cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(127, 127, 6, 0x0c0, 0x10, 10, 1),
2826cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(128, 128, 3, 0x0e0, 0x10, 18, 1),
2836cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(129, 131, 3, 0x0e0, 0x10, 19, 1),
2846cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(132, 132, 6, 0x0c0, 0x10, 13, 1),
2856cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(133, 133, 6, 0x0c0, 0x10, 12, 1),
2866cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(134, 134, 6, 0x0c0, 0x10, 15, 1),
2876cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(135, 135, 6, 0x0c0, 0x10, 14, 1),
2886cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(136, 136, 1, 0x0f0, 0x10, 18, 1),
2896cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(137, 137, 1, 0x0f0, 0x10, 17, 1),
2906cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(138, 138, 1, 0x0f0, 0x10, 20, 1),
2916cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(139, 139, 1, 0x0f0, 0x10, 19, 1),
2926cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(140, 140, 1, 0x0f0, 0x10, 22, 1),
2936cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(141, 141, 1, 0x0f0, 0x10, 21, 1),
2946cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(142, 142, 1, 0x0f0, 0x10, 24, 1),
2956cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(143, 143, 1, 0x0f0, 0x10, 23, 1),
2966cf5e9efSZhiyong Tao };
2976cf5e9efSZhiyong Tao 
2986cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_pu_range[] = {
2996cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(6, 6, 4, 0x0070, 0x10, 0, 1),
3006cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(7, 7, 4, 0x0070, 0x10, 1, 1),
3016cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(8, 8, 4, 0x0070, 0x10, 7, 1),
3026cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(9, 9, 4, 0x0070, 0x10, 2, 1),
3036cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(10, 10, 4, 0x0070, 0x10, 8, 1),
3046cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(11, 11, 4, 0x0070, 0x10, 3, 1),
3056cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(12, 12, 4, 0x0070, 0x10, 9, 1),
3066cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(13, 13, 4, 0x0070, 0x10, 4, 1),
3076cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(14, 14, 4, 0x0070, 0x10, 10, 1),
3086cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(15, 15, 4, 0x0070, 0x10, 5, 1),
3096cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(16, 16, 4, 0x0070, 0x10, 11, 1),
3106cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(17, 17, 4, 0x0070, 0x10, 6, 1),
3116cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(18, 18, 2, 0x0060, 0x10, 5, 1),
3126cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(19, 19, 2, 0x0060, 0x10, 12, 1),
3136cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(20, 20, 2, 0x0060, 0x10, 11, 1),
3146cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(21, 21, 2, 0x0060, 0x10, 10, 1),
3156cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(22, 22, 2, 0x0060, 0x10, 0, 1),
3166cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(23, 23, 2, 0x0060, 0x10, 1, 1),
3176cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(24, 24, 2, 0x0060, 0x10, 2, 1),
3186cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(25, 25, 2, 0x0060, 0x10, 4, 1),
3196cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(26, 26, 2, 0x0060, 0x10, 3, 1),
3206cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(27, 27, 2, 0x0060, 0x10, 6, 1),
3216cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(28, 28, 2, 0x0060, 0x10, 7, 1),
3226cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(29, 29, 2, 0x0060, 0x10, 8, 1),
3236cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(30, 30, 2, 0x0060, 0x10, 9, 1),
3246cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(31, 31, 1, 0x00a0, 0x10, 13, 1),
3256cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(32, 32, 1, 0x00a0, 0x10, 12, 1),
3266cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(33, 33, 1, 0x00a0, 0x10, 11, 1),
3276cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(34, 34, 1, 0x00a0, 0x10, 14, 1),
3286cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(35, 35, 1, 0x00a0, 0x10, 15, 1),
3296cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(36, 36, 1, 0x00b0, 0x10, 3, 1),
3306cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(37, 37, 1, 0x00b0, 0x10, 6, 1),
3316cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(38, 38, 1, 0x00b0, 0x10, 4, 1),
3326cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(39, 39, 1, 0x00b0, 0x10, 5, 1),
3336cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(40, 40, 1, 0x00b0, 0x10, 8, 1),
3346cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(41, 41, 1, 0x00b0, 0x10, 7, 1),
3356cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(42, 42, 1, 0x00b0, 0x10, 10, 1),
3366cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(43, 43, 1, 0x00b0, 0x10, 9, 1),
3376cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(44, 44, 1, 0x00b0, 0x10, 21, 1),
3386cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(45, 45, 1, 0x00b0, 0x10, 22, 1),
3396cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(46, 46, 1, 0x00a0, 0x10, 18, 1),
3406cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(47, 47, 1, 0x00a0, 0x10, 16, 1),
3416cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(48, 48, 1, 0x00a0, 0x10, 19, 1),
3426cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(49, 49, 1, 0x00a0, 0x10, 17, 1),
3436cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(50, 50, 1, 0x00a0, 0x10, 25, 1),
3446cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(51, 51, 1, 0x00a0, 0x10, 20, 1),
3456cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(52, 52, 1, 0x00a0, 0x10, 26, 1),
3466cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(53, 53, 1, 0x00a0, 0x10, 21, 1),
3476cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(54, 54, 1, 0x00a0, 0x10, 22, 1),
3486cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(55, 55, 1, 0x00a0, 0x10, 23, 1),
3496cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(56, 56, 1, 0x00a0, 0x10, 24, 1),
3506cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(57, 57, 1, 0x00a0, 0x10, 29, 1),
3516cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(58, 58, 1, 0x00a0, 0x10, 27, 1),
3526cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(59, 59, 1, 0x00a0, 0x10, 30, 1),
3536cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(60, 60, 1, 0x00a0, 0x10, 28, 1),
3546cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(61, 61, 1, 0x00a0, 0x10, 8, 1),
3556cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(62, 62, 1, 0x00a0, 0x10, 7, 1),
3566cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(63, 63, 1, 0x00a0, 0x10, 10, 1),
3576cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(64, 64, 1, 0x00a0, 0x10, 9, 1),
3586cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(65, 65, 1, 0x00b0, 0x10, 1, 1),
3596cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(66, 66, 1, 0x00a0, 0x10, 31, 1),
3606cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(67, 67, 1, 0x00b0, 0x10, 0, 1),
3616cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(68, 68, 1, 0x00b0, 0x10, 2, 1),
3626cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(69, 69, 1, 0x00a0, 0x10, 0, 1),
3636cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(70, 70, 1, 0x00a0, 0x10, 6, 1),
3646cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(71, 71, 1, 0x00a0, 0x10, 4, 1),
3656cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(72, 72, 1, 0x00a0, 0x10, 5, 1),
3666cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(73, 73, 1, 0x00a0, 0x10, 1, 1),
3676cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(74, 74, 1, 0x00a0, 0x10, 2, 1),
3686cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(75, 75, 1, 0x00a0, 0x10, 3, 1),
3696cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(76, 76, 1, 0x00b0, 0x10, 11, 1),
3706cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(97, 97, 3, 0x0070, 0x10, 0, 1),
3716cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(98, 98, 3, 0x0070, 0x10, 4, 1),
3726cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(99, 99, 3, 0x0070, 0x10, 3, 1),
3736cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(100, 100, 3, 0x0070, 0x10, 6, 1),
3746cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(101, 101, 3, 0x0070, 0x10, 5, 1),
3756cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(102, 102, 3, 0x0070, 0x10, 8, 1),
3766cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(103, 103, 3, 0x0070, 0x10, 7, 1),
3776cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(108, 108, 3, 0x0070, 0x10, 2, 1),
3786cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(109, 109, 3, 0x0070, 0x10, 1, 1),
3796cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(128, 128, 3, 0x0070, 0x10, 11, 1),
3806cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(129, 129, 3, 0x0070, 0x10, 9, 1),
3816cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(130, 130, 3, 0x0070, 0x10, 12, 1),
3826cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(131, 131, 3, 0x0070, 0x10, 10, 1),
3836cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(132, 132, 6, 0x0060, 0x10, 1, 1),
3846cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(133, 133, 6, 0x0060, 0x10, 0, 1),
3856cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(134, 134, 6, 0x0060, 0x10, 3, 1),
3866cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(135, 135, 6, 0x0060, 0x10, 2, 1),
3876cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(136, 136, 1, 0x00b0, 0x10, 14, 1),
3886cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(137, 137, 1, 0x00b0, 0x10, 13, 1),
3896cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(138, 138, 1, 0x00b0, 0x10, 16, 1),
3906cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(139, 139, 1, 0x00b0, 0x10, 15, 1),
3916cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(140, 140, 1, 0x00b0, 0x10, 18, 1),
3926cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(141, 141, 1, 0x00b0, 0x10, 17, 1),
3936cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(142, 142, 1, 0x00b0, 0x10, 20, 1),
3946cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(143, 143, 1, 0x00b0, 0x10, 19, 1),
3956cf5e9efSZhiyong Tao };
3966cf5e9efSZhiyong Tao 
3976cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_pd_range[] = {
3986cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(6, 6, 4, 0x0050, 0x10, 0, 1),
3996cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(7, 7, 4, 0x0050, 0x10, 1, 1),
4006cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(8, 8, 4, 0x0050, 0x10, 7, 1),
4016cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(9, 9, 4, 0x0050, 0x10, 2, 1),
4026cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(10, 10, 4, 0x0050, 0x10, 8, 1),
4036cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(11, 11, 4, 0x0050, 0x10, 3, 1),
4046cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(12, 12, 4, 0x0050, 0x10, 9, 1),
4056cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(13, 13, 4, 0x0050, 0x10, 4, 1),
4066cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(14, 14, 4, 0x0050, 0x10, 10, 1),
4076cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(15, 15, 4, 0x0050, 0x10, 5, 1),
4086cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(16, 16, 4, 0x0050, 0x10, 11, 1),
4096cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(17, 17, 4, 0x0050, 0x10, 6, 1),
4106cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(18, 18, 2, 0x0050, 0x10, 5, 1),
4116cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(19, 19, 2, 0x0050, 0x10, 12, 1),
4126cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(20, 20, 2, 0x0050, 0x10, 11, 1),
4136cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(21, 21, 2, 0x0050, 0x10, 10, 1),
4146cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(22, 22, 2, 0x0050, 0x10, 0, 1),
4156cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(23, 23, 2, 0x0050, 0x10, 1, 1),
4166cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(24, 24, 2, 0x0050, 0x10, 2, 1),
4176cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(25, 25, 2, 0x0050, 0x10, 4, 1),
4186cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(26, 26, 2, 0x0050, 0x10, 3, 1),
4196cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(27, 27, 2, 0x0050, 0x10, 6, 1),
4206cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(28, 28, 2, 0x0050, 0x10, 7, 1),
4216cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(29, 29, 2, 0x0050, 0x10, 8, 1),
4226cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(30, 30, 2, 0x0050, 0x10, 9, 1),
4236cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(31, 31, 1, 0x0080, 0x10, 13, 1),
4246cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(32, 32, 1, 0x0080, 0x10, 12, 1),
4256cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(33, 33, 1, 0x0080, 0x10, 11, 1),
4266cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(34, 34, 1, 0x0080, 0x10, 14, 1),
4276cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(35, 35, 1, 0x0080, 0x10, 15, 1),
4286cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(36, 36, 1, 0x0090, 0x10, 3, 1),
4296cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(37, 37, 1, 0x0090, 0x10, 6, 1),
4306cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(38, 38, 1, 0x0090, 0x10, 4, 1),
4316cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(39, 39, 1, 0x0090, 0x10, 5, 1),
4326cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(40, 40, 1, 0x0090, 0x10, 8, 1),
4336cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(41, 41, 1, 0x0090, 0x10, 7, 1),
4346cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(42, 42, 1, 0x0090, 0x10, 10, 1),
4356cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(43, 43, 1, 0x0090, 0x10, 9, 1),
4366cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(44, 44, 1, 0x0090, 0x10, 21, 1),
4376cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(45, 45, 1, 0x0090, 0x10, 22, 1),
4386cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(46, 46, 1, 0x0080, 0x10, 18, 1),
4396cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(47, 47, 1, 0x0080, 0x10, 16, 1),
4406cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(48, 48, 1, 0x0080, 0x10, 19, 1),
4416cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(49, 49, 1, 0x0080, 0x10, 17, 1),
4426cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(50, 50, 1, 0x0080, 0x10, 25, 1),
4436cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(51, 51, 1, 0x0080, 0x10, 20, 1),
4446cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(52, 52, 1, 0x0080, 0x10, 26, 1),
4456cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(53, 53, 1, 0x0080, 0x10, 21, 1),
4466cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(54, 54, 1, 0x0080, 0x10, 22, 1),
4476cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(55, 55, 1, 0x0080, 0x10, 23, 1),
4486cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(56, 56, 1, 0x0080, 0x10, 24, 1),
4496cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(57, 57, 1, 0x0080, 0x10, 29, 1),
4506cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(58, 58, 1, 0x0080, 0x10, 27, 1),
4516cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(59, 59, 1, 0x0080, 0x10, 30, 1),
4526cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(60, 60, 1, 0x0080, 0x10, 28, 1),
4536cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(61, 61, 1, 0x0080, 0x10, 8, 1),
4546cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(62, 62, 1, 0x0080, 0x10, 7, 1),
4556cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(63, 63, 1, 0x0080, 0x10, 10, 1),
4566cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(64, 64, 1, 0x0080, 0x10, 9, 1),
4576cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(65, 65, 1, 0x0090, 0x10, 1, 1),
4586cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(66, 66, 1, 0x0080, 0x10, 31, 1),
4596cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(67, 67, 1, 0x0090, 0x10, 0, 1),
4606cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(68, 68, 1, 0x0090, 0x10, 2, 1),
4616cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(69, 69, 1, 0x0080, 0x10, 0, 1),
4626cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(70, 70, 1, 0x0080, 0x10, 6, 1),
4636cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(71, 71, 1, 0x0080, 0x10, 4, 1),
4646cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(72, 72, 1, 0x0080, 0x10, 5, 1),
4656cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(73, 73, 1, 0x0080, 0x10, 1, 1),
4666cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(74, 74, 1, 0x0080, 0x10, 2, 1),
4676cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(75, 75, 1, 0x0080, 0x10, 3, 1),
4686cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(76, 76, 1, 0x0090, 0x10, 11, 1),
4696cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(97, 97, 3, 0x0050, 0x10, 0, 1),
4706cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(98, 98, 3, 0x0050, 0x10, 4, 1),
4716cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(99, 99, 3, 0x0050, 0x10, 3, 1),
4726cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(100, 100, 3, 0x0050, 0x10, 6, 1),
4736cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(101, 101, 3, 0x0050, 0x10, 5, 1),
4746cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(102, 102, 3, 0x0050, 0x10, 8, 1),
4756cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(103, 103, 3, 0x0050, 0x10, 7, 1),
4766cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(108, 108, 3, 0x0050, 0x10, 2, 1),
4776cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(109, 109, 3, 0x0050, 0x10, 1, 1),
4786cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(128, 128, 3, 0x0050, 0x10, 11, 1),
4796cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(129, 129, 3, 0x0050, 0x10, 9, 1),
4806cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(130, 130, 3, 0x0050, 0x10, 12, 1),
4816cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(131, 131, 3, 0x0050, 0x10, 10, 1),
4826cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(132, 132, 6, 0x0040, 0x10, 1, 1),
4836cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(133, 133, 6, 0x0040, 0x10, 0, 1),
4846cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(134, 134, 6, 0x0040, 0x10, 3, 1),
4856cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(135, 135, 6, 0x0040, 0x10, 2, 1),
4866cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(136, 136, 1, 0x0090, 0x10, 14, 1),
4876cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(137, 137, 1, 0x0090, 0x10, 13, 1),
4886cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(138, 138, 1, 0x0090, 0x10, 16, 1),
4896cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(139, 139, 1, 0x0090, 0x10, 15, 1),
4906cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(140, 140, 1, 0x0090, 0x10, 18, 1),
4916cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(141, 141, 1, 0x0090, 0x10, 17, 1),
4926cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(142, 142, 1, 0x0090, 0x10, 20, 1),
4936cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(143, 143, 1, 0x0090, 0x10, 19, 1),
4946cf5e9efSZhiyong Tao };
4956cf5e9efSZhiyong Tao 
4966cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_pupd_range[] = {
4976cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(0, 0, 4, 0x0060, 0x10, 0, 1),
4986cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(1, 1, 4, 0x0060, 0x10, 1, 1),
4996cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(2, 2, 4, 0x0060, 0x10, 2, 1),
5006cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(3, 3, 4, 0x0060, 0x10, 3, 1),
5016cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(4, 4, 4, 0x0060, 0x10, 4, 1),
5026cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(5, 5, 4, 0x0060, 0x10, 5, 1),
5036cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(77, 77, 3, 0x0060, 0x10, 1, 1),
5046cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(78, 78, 3, 0x0060, 0x10, 2, 1),
5056cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(79, 79, 3, 0x0060, 0x10, 9, 1),
5066cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(80, 80, 3, 0x0060, 0x10, 10, 1),
5076cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(81, 81, 3, 0x0060, 0x10, 11, 1),
5086cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(82, 82, 3, 0x0060, 0x10, 12, 1),
5096cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(83, 83, 3, 0x0060, 0x10, 13, 1),
5106cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(84, 84, 3, 0x0060, 0x10, 14, 1),
5116cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(85, 85, 3, 0x0060, 0x10, 15, 1),
5126cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(86, 86, 3, 0x0060, 0x10, 16, 1),
5136cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(87, 87, 3, 0x0060, 0x10, 3, 1),
5146cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(88, 88, 3, 0x0060, 0x10, 4, 1),
5156cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(89, 89, 3, 0x0060, 0x10, 5, 1),
5166cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(90, 90, 3, 0x0060, 0x10, 6, 1),
5176cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(91, 91, 3, 0x0060, 0x10, 7, 1),
5186cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(92, 92, 3, 0x0060, 0x10, 8, 1),
5196cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(93, 93, 3, 0x0060, 0x10, 18, 1),
5206cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(94, 94, 3, 0x0060, 0x10, 19, 1),
5216cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(95, 95, 3, 0x0060, 0x10, 17, 1),
5226cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(96, 96, 3, 0x0060, 0x10, 0, 1),
5236cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(104, 104, 3, 0x0060, 0x10, 22, 1),
5246cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(105, 105, 3, 0x0060, 0x10, 23, 1),
5256cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(106, 106, 3, 0x0060, 0x10, 20, 1),
5266cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(107, 107, 3, 0x0060, 0x10, 21, 1),
5276cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(110, 110, 5, 0x0020, 0x10, 1, 1),
5286cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(111, 111, 5, 0x0020, 0x10, 0, 1),
5296cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(112, 112, 5, 0x0020, 0x10, 2, 1),
5306cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(113, 113, 5, 0x0020, 0x10, 3, 1),
5316cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(114, 114, 5, 0x0020, 0x10, 4, 1),
5326cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(115, 115, 5, 0x0020, 0x10, 5, 1),
5336cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(116, 116, 6, 0x0050, 0x10, 9, 1),
5346cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(117, 117, 6, 0x0050, 0x10, 8, 1),
5356cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(118, 118, 6, 0x0050, 0x10, 7, 1),
5366cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(119, 119, 6, 0x0050, 0x10, 6, 1),
5376cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(120, 120, 6, 0x0050, 0x10, 11, 1),
5386cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(121, 121, 6, 0x0050, 0x10, 1, 1),
5396cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(122, 122, 6, 0x0050, 0x10, 0, 1),
5406cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(123, 123, 6, 0x0050, 0x10, 5, 1),
5416cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(124, 124, 6, 0x0050, 0x10, 4, 1),
5426cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(125, 125, 6, 0x0050, 0x10, 3, 1),
5436cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(126, 126, 6, 0x0050, 0x10, 2, 1),
5446cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(127, 127, 6, 0x0050, 0x10, 10, 1),
5456cf5e9efSZhiyong Tao };
5466cf5e9efSZhiyong Tao 
5476cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_r0_range[] = {
5486cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(0, 0, 4, 0x0080, 0x10, 0, 1),
5496cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(1, 1, 4, 0x0080, 0x10, 1, 1),
5506cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(2, 2, 4, 0x0080, 0x10, 2, 1),
5516cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(3, 3, 4, 0x0080, 0x10, 3, 1),
5526cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(4, 4, 4, 0x0080, 0x10, 4, 1),
5536cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(5, 5, 4, 0x0080, 0x10, 5, 1),
5546cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(77, 77, 3, 0x0080, 0x10, 1, 1),
5556cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(78, 78, 3, 0x0080, 0x10, 2, 1),
5566cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(79, 79, 3, 0x0080, 0x10, 9, 1),
5576cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(80, 80, 3, 0x0080, 0x10, 10, 1),
5586cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(81, 81, 3, 0x0080, 0x10, 11, 1),
5596cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(82, 82, 3, 0x0080, 0x10, 12, 1),
5606cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(83, 83, 3, 0x0080, 0x10, 13, 1),
5616cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(84, 84, 3, 0x0080, 0x10, 14, 1),
5626cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(85, 85, 3, 0x0080, 0x10, 15, 1),
5636cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(86, 86, 3, 0x0080, 0x10, 16, 1),
5646cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(87, 87, 3, 0x0080, 0x10, 3, 1),
5656cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(88, 88, 3, 0x0080, 0x10, 4, 1),
5666cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(89, 89, 3, 0x0080, 0x10, 5, 1),
5676cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(90, 90, 3, 0x0080, 0x10, 6, 1),
5686cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(91, 91, 3, 0x0080, 0x10, 7, 1),
5696cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(92, 92, 3, 0x0080, 0x10, 8, 1),
5706cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(93, 93, 3, 0x0080, 0x10, 18, 1),
5716cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(94, 94, 3, 0x0080, 0x10, 19, 1),
5726cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(95, 95, 3, 0x0080, 0x10, 17, 1),
5736cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(96, 96, 3, 0x0080, 0x10, 0, 1),
5746cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(104, 104, 3, 0x0080, 0x10, 22, 1),
5756cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(105, 105, 3, 0x0080, 0x10, 23, 1),
5766cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(106, 106, 3, 0x0080, 0x10, 20, 1),
5776cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(107, 107, 3, 0x0080, 0x10, 21, 1),
5786cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(110, 110, 5, 0x0030, 0x10, 1, 1),
5796cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(111, 111, 5, 0x0030, 0x10, 0, 1),
5806cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(112, 112, 5, 0x0030, 0x10, 2, 1),
5816cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(113, 113, 5, 0x0030, 0x10, 3, 1),
5826cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(114, 114, 5, 0x0030, 0x10, 4, 1),
5836cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(115, 115, 5, 0x0030, 0x10, 5, 1),
5846cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(116, 116, 6, 0x0070, 0x10, 9, 1),
5856cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(117, 117, 6, 0x0070, 0x10, 8, 1),
5866cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(118, 118, 6, 0x0070, 0x10, 7, 1),
5876cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(119, 119, 6, 0x0070, 0x10, 6, 1),
5886cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(120, 120, 6, 0x0070, 0x10, 11, 1),
5896cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(121, 121, 6, 0x0070, 0x10, 1, 1),
5906cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(122, 122, 6, 0x0070, 0x10, 0, 1),
5916cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(123, 123, 6, 0x0070, 0x10, 5, 1),
5926cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(124, 124, 6, 0x0070, 0x10, 4, 1),
5936cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(125, 125, 6, 0x0070, 0x10, 3, 1),
5946cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(126, 126, 6, 0x0070, 0x10, 2, 1),
5956cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(127, 127, 6, 0x0070, 0x10, 10, 1),
5966cf5e9efSZhiyong Tao };
5976cf5e9efSZhiyong Tao 
5986cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_r1_range[] = {
5996cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(0, 0, 4, 0x0090, 0x10, 0, 1),
6006cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(1, 1, 4, 0x0090, 0x10, 1, 1),
6016cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(2, 2, 4, 0x0090, 0x10, 2, 1),
6026cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(3, 3, 4, 0x0090, 0x10, 3, 1),
6036cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(4, 4, 4, 0x0090, 0x10, 4, 1),
6046cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(5, 5, 4, 0x0090, 0x10, 5, 1),
6056cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(77, 77, 3, 0x0090, 0x10, 1, 1),
6066cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(78, 78, 3, 0x0090, 0x10, 2, 1),
6076cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(79, 79, 3, 0x0090, 0x10, 9, 1),
6086cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(80, 80, 3, 0x0090, 0x10, 10, 1),
6096cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(81, 81, 3, 0x0090, 0x10, 11, 1),
6106cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(82, 82, 3, 0x0090, 0x10, 12, 1),
6116cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(83, 83, 3, 0x0090, 0x10, 13, 1),
6126cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(84, 84, 3, 0x0090, 0x10, 14, 1),
6136cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(85, 85, 3, 0x0090, 0x10, 15, 1),
6146cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(86, 86, 3, 0x0090, 0x10, 16, 1),
6156cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(87, 87, 3, 0x0090, 0x10, 3, 1),
6166cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(88, 88, 3, 0x0090, 0x10, 4, 1),
6176cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(89, 89, 3, 0x0090, 0x10, 5, 1),
6186cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(90, 90, 3, 0x0090, 0x10, 6, 1),
6196cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(91, 91, 3, 0x0090, 0x10, 7, 1),
6206cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(92, 92, 3, 0x0090, 0x10, 8, 1),
6216cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(93, 93, 3, 0x0090, 0x10, 18, 1),
6226cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(94, 94, 3, 0x0090, 0x10, 19, 1),
6236cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(95, 95, 3, 0x0090, 0x10, 17, 1),
6246cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(96, 96, 3, 0x0090, 0x10, 0, 1),
6256cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(104, 104, 3, 0x0090, 0x10, 22, 1),
6266cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(105, 105, 3, 0x0090, 0x10, 23, 1),
6276cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(106, 106, 3, 0x0090, 0x10, 20, 1),
6286cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(107, 107, 3, 0x0090, 0x10, 21, 1),
6296cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(110, 110, 5, 0x0040, 0x10, 1, 1),
6306cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(111, 111, 5, 0x0040, 0x10, 0, 1),
6316cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(112, 112, 5, 0x0040, 0x10, 2, 1),
6326cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(113, 113, 5, 0x0040, 0x10, 3, 1),
6336cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(114, 114, 5, 0x0040, 0x10, 4, 1),
6346cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(115, 115, 5, 0x0040, 0x10, 5, 1),
6356cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(116, 116, 6, 0x0080, 0x10, 9, 1),
6366cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(117, 117, 6, 0x0080, 0x10, 8, 1),
6376cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(118, 118, 6, 0x0080, 0x10, 7, 1),
6386cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(119, 119, 6, 0x0080, 0x10, 6, 1),
6396cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(120, 120, 6, 0x0080, 0x10, 11, 1),
6406cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(121, 121, 6, 0x0080, 0x10, 1, 1),
6416cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(122, 122, 6, 0x0080, 0x10, 0, 1),
6426cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(123, 123, 6, 0x0080, 0x10, 5, 1),
6436cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(124, 124, 6, 0x0080, 0x10, 4, 1),
6446cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(125, 125, 6, 0x0080, 0x10, 3, 1),
6456cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(126, 126, 6, 0x0080, 0x10, 2, 1),
6466cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(127, 127, 6, 0x0080, 0x10, 10, 1),
6476cf5e9efSZhiyong Tao };
6486cf5e9efSZhiyong Tao 
6496cf5e9efSZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_drv_range[] = {
6506cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(0, 0, 4, 0x000, 0x10, 0, 3),
6516cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(1, 1, 4, 0x000, 0x10, 3, 3),
6526cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(2, 2, 4, 0x000, 0x10, 6, 3),
6536cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(3, 3, 4, 0x000, 0x10, 9, 3),
6546cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(4, 4, 4, 0x000, 0x10, 12, 3),
6556cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(5, 5, 4, 0x000, 0x10, 15, 3),
6566cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(6, 7, 4, 0x000, 0x10, 18, 3),
6576cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(8, 8, 4, 0x010, 0x10, 6, 3),
6586cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(9, 9, 4, 0x000, 0x10, 21, 3),
6596cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(10, 10, 4, 0x010, 0x10, 9, 3),
6606cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(11, 11, 4, 0x000, 0x10, 24, 3),
6616cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(12, 12, 4, 0x010, 0x10, 12, 3),
6626cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(13, 13, 4, 0x010, 0x10, 27, 3),
6636cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(14, 14, 4, 0x010, 0x10, 15, 3),
6646cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(15, 15, 4, 0x010, 0x10, 0, 3),
6656cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(16, 16, 4, 0x010, 0x10, 18, 3),
6666cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(17, 17, 4, 0x010, 0x10, 3, 3),
6676cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(18, 18, 2, 0x010, 0x10, 6, 3),
6686cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(19, 19, 2, 0x010, 0x10, 3, 3),
6696cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(20, 20, 2, 0x010, 0x10, 0, 3),
6706cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(21, 21, 2, 0x000, 0x10, 27, 3),
6716cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(22, 22, 2, 0x000, 0x10, 0, 3),
6726cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(23, 23, 2, 0x000, 0x10, 3, 3),
6736cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(24, 24, 2, 0x000, 0x10, 6, 3),
6746cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(25, 25, 2, 0x000, 0x10, 12, 3),
6756cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(26, 26, 2, 0x000, 0x10, 9, 3),
6766cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(27, 27, 2, 0x000, 0x10, 15, 3),
6776cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(28, 28, 2, 0x000, 0x10, 18, 3),
6786cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(29, 29, 2, 0x000, 0x10, 21, 3),
6796cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(30, 30, 2, 0x000, 0x10, 24, 3),
6806cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(31, 33, 1, 0x010, 0x10, 0, 3),
6816cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(34, 34, 1, 0x000, 0x10, 21, 3),
6826cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(35, 35, 1, 0x000, 0x10, 24, 3),
6836cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(36, 36, 1, 0x010, 0x10, 0, 3),
6846cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(37, 37, 1, 0x010, 0x10, 21, 3),
6856cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(38, 39, 1, 0x010, 0x10, 3, 3),
6866cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(40, 40, 1, 0x010, 0x10, 27, 3),
6876cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(41, 41, 1, 0x010, 0x10, 24, 3),
6886cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(42, 42, 1, 0x020, 0x10, 3, 3),
6896cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(43, 43, 1, 0x020, 0x10, 0, 3),
6906cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(44, 44, 1, 0x030, 0x10, 0, 3),
6916cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(45, 45, 1, 0x030, 0x10, 3, 3),
6926cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(46, 47, 1, 0x010, 0x10, 3, 3),
6936cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(48, 51, 1, 0x010, 0x10, 6, 3),
6946cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(52, 55, 1, 0x010, 0x10, 9, 3),
6956cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(56, 59, 1, 0x010, 0x10, 12, 3),
6966cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(60, 63, 1, 0x010, 0x10, 15, 3),
6976cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(64, 64, 1, 0x010, 0x10, 18, 3),
6986cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(65, 68, 1, 0x000, 0x10, 27, 3),
6996cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(69, 69, 1, 0x000, 0x10, 0, 3),
7006cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(70, 70, 1, 0x000, 0x10, 18, 3),
7016cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(71, 71, 1, 0x000, 0x10, 12, 3),
7026cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(72, 72, 1, 0x000, 0x10, 15, 3),
7036cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(73, 73, 1, 0x000, 0x10, 3, 3),
7046cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(74, 74, 1, 0x000, 0x10, 6, 3),
7056cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(75, 75, 1, 0x000, 0x10, 9, 3),
7066cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(76, 76, 1, 0x010, 0x10, 18, 3),
7076cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(77, 77, 3, 0x000, 0x10, 0, 3),
7086cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(78, 78, 3, 0x000, 0x10, 15, 3),
7096cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(79, 79, 3, 0x000, 0x10, 18, 3),
7106cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(80, 80, 3, 0x000, 0x10, 21, 3),
7116cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(81, 81, 3, 0x000, 0x10, 28, 3),
7126cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(82, 82, 3, 0x000, 0x10, 27, 3),
7136cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(83, 83, 3, 0x010, 0x10, 0, 3),
7146cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(84, 84, 3, 0x010, 0x10, 3, 3),
7156cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(85, 88, 3, 0x010, 0x10, 15, 3),
7166cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(89, 89, 3, 0x000, 0x10, 3, 3),
7176cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(90, 90, 3, 0x000, 0x10, 6, 3),
7186cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(91, 91, 3, 0x000, 0x10, 9, 3),
7196cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(92, 92, 3, 0x000, 0x10, 12, 3),
7206cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(93, 93, 3, 0x010, 0x10, 6, 3),
7216cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(94, 94, 3, 0x010, 0x10, 9, 3),
7226cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(95, 98, 3, 0x010, 0x10, 18, 3),
7236cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(99, 102, 3, 0x010, 0x10, 21, 3),
7246cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(103, 104, 3, 0x010, 0x10, 24, 3),
7256cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(105, 105, 3, 0x010, 0x10, 27, 3),
7266cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(106, 107, 3, 0x010, 0x10, 24, 3),
7276cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(108, 109, 3, 0x010, 0x10, 27, 3),
7286cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(110, 110, 5, 0x000, 0x10, 3, 3),
7296cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(111, 111, 5, 0x000, 0x10, 0, 3),
7306cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(112, 112, 5, 0x000, 0x10, 6, 3),
7316cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(113, 113, 5, 0x000, 0x10, 9, 3),
7326cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(114, 114, 5, 0x000, 0x10, 12, 3),
7336cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(115, 115, 5, 0x000, 0x10, 15, 3),
7346cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(116, 116, 6, 0x000, 0x10, 27, 3),
7356cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(117, 117, 6, 0x000, 0x10, 24, 3),
7366cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(118, 118, 6, 0x000, 0x10, 21, 3),
7376cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(119, 119, 6, 0x000, 0x10, 18, 3),
7386cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(120, 120, 6, 0x010, 0x10, 3, 3),
7396cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(121, 121, 6, 0x000, 0x10, 3, 3),
7406cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(122, 122, 6, 0x000, 0x10, 0, 3),
7416cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(123, 123, 6, 0x000, 0x10, 15, 3),
7426cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(124, 124, 6, 0x000, 0x10, 12, 3),
7436cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(125, 125, 6, 0x000, 0x10, 9, 3),
7446cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(126, 126, 6, 0x000, 0x10, 6, 3),
7456cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(127, 127, 6, 0x010, 0x10, 0, 3),
7466cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(128, 128, 3, 0x010, 0x10, 27, 3),
7476cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(129, 130, 3, 0x020, 0x10, 0, 3),
7486cf5e9efSZhiyong Tao 	PINS_FIELD_BASE(131, 131, 3, 0x010, 0x10, 12, 3),
7496cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(132, 132, 6, 0x010, 0x10, 9, 3),
7506cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(133, 133, 6, 0x010, 0x10, 6, 3),
7516cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(134, 134, 6, 0x010, 0x10, 15, 3),
7526cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(135, 135, 6, 0x010, 0x10, 12, 3),
7536cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(136, 136, 1, 0x020, 0x10, 9, 3),
7546cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(137, 137, 1, 0x020, 0x10, 6, 3),
7556cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(138, 138, 1, 0x020, 0x10, 15, 3),
7566cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(139, 139, 1, 0x020, 0x10, 12, 3),
7576cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(140, 140, 1, 0x020, 0x10, 21, 3),
7586cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(141, 141, 1, 0x020, 0x10, 18, 3),
7596cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(142, 142, 1, 0x020, 0x10, 27, 3),
7606cf5e9efSZhiyong Tao 	PIN_FIELD_BASE(143, 143, 1, 0x020, 0x10, 24, 3),
7616cf5e9efSZhiyong Tao };
7626cf5e9efSZhiyong Tao 
763ea9d2ed4SZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_drv_adv_range[] = {
764ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(8, 8, 4, 0x020, 0x10, 15, 3),
765ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(9, 9, 4, 0x020, 0x10, 0, 3),
766ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(10, 10, 4, 0x020, 0x10, 18, 3),
767ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(11, 11, 4, 0x020, 0x10, 3, 3),
768ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(12, 12, 4, 0x020, 0x10, 21, 3),
769ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(13, 13, 4, 0x020, 0x10, 6, 3),
770ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(14, 14, 4, 0x020, 0x10, 24, 3),
771ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(15, 15, 4, 0x020, 0x10, 9, 3),
772ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(16, 16, 4, 0x020, 0x10, 27, 3),
773ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(17, 17, 4, 0x020, 0x10, 12, 3),
774ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(29, 29, 2, 0x020, 0x10, 0, 3),
775ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(30, 30, 2, 0x020, 0x10, 3, 3),
776ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(34, 34, 1, 0x040, 0x10, 0, 3),
777ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(35, 35, 1, 0x040, 0x10, 3, 3),
778ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(44, 44, 1, 0x040, 0x10, 6, 3),
779ea9d2ed4SZhiyong Tao 	PIN_FIELD_BASE(45, 45, 1, 0x040, 0x10, 9, 3),
780ea9d2ed4SZhiyong Tao };
781ea9d2ed4SZhiyong Tao 
782387292c3SZhiyong Tao static const struct mtk_pin_field_calc mt8195_pin_rsel_range[] = {
783387292c3SZhiyong Tao 	PIN_FIELD_BASE(8, 8, 4, 0x0c0, 0x10, 15, 3),
784387292c3SZhiyong Tao 	PIN_FIELD_BASE(9, 9, 4, 0x0c0, 0x10, 0, 3),
785387292c3SZhiyong Tao 	PIN_FIELD_BASE(10, 10, 4, 0x0c0, 0x10, 18, 3),
786387292c3SZhiyong Tao 	PIN_FIELD_BASE(11, 11, 4, 0x0c0, 0x10, 3, 3),
787387292c3SZhiyong Tao 	PIN_FIELD_BASE(12, 12, 4, 0x0c0, 0x10, 21, 3),
788387292c3SZhiyong Tao 	PIN_FIELD_BASE(13, 13, 4, 0x0c0, 0x10, 6, 3),
789387292c3SZhiyong Tao 	PIN_FIELD_BASE(14, 14, 4, 0x0c0, 0x10, 24, 3),
790387292c3SZhiyong Tao 	PIN_FIELD_BASE(15, 15, 4, 0x0c0, 0x10, 9, 3),
791387292c3SZhiyong Tao 	PIN_FIELD_BASE(16, 16, 4, 0x0c0, 0x10, 27, 3),
792387292c3SZhiyong Tao 	PIN_FIELD_BASE(17, 17, 4, 0x0c0, 0x10, 12, 3),
793387292c3SZhiyong Tao 	PIN_FIELD_BASE(29, 29, 2, 0x080, 0x10, 0, 3),
794387292c3SZhiyong Tao 	PIN_FIELD_BASE(30, 30, 2, 0x080, 0x10, 3, 3),
795387292c3SZhiyong Tao 	PIN_FIELD_BASE(34, 34, 1, 0x0e0, 0x10, 0, 3),
796387292c3SZhiyong Tao 	PIN_FIELD_BASE(35, 35, 1, 0x0e0, 0x10, 3, 3),
797387292c3SZhiyong Tao 	PIN_FIELD_BASE(44, 44, 1, 0x0e0, 0x10, 6, 3),
798387292c3SZhiyong Tao 	PIN_FIELD_BASE(45, 45, 1, 0x0e0, 0x10, 9, 3),
799387292c3SZhiyong Tao };
800387292c3SZhiyong Tao 
801387292c3SZhiyong Tao static const struct mtk_pin_rsel mt8195_pin_rsel_val_range[] = {
802387292c3SZhiyong Tao 	PIN_RSEL(8, 17, 0x0, 75000, 75000),
803387292c3SZhiyong Tao 	PIN_RSEL(8, 17, 0x1, 10000, 5000),
804387292c3SZhiyong Tao 	PIN_RSEL(8, 17, 0x2, 5000, 75000),
805387292c3SZhiyong Tao 	PIN_RSEL(8, 17, 0x3, 4000, 5000),
806387292c3SZhiyong Tao 	PIN_RSEL(8, 17, 0x4, 3000, 75000),
807387292c3SZhiyong Tao 	PIN_RSEL(8, 17, 0x5, 2000, 5000),
808387292c3SZhiyong Tao 	PIN_RSEL(8, 17, 0x6, 1500, 75000),
809387292c3SZhiyong Tao 	PIN_RSEL(8, 17, 0x7, 1000, 5000),
810387292c3SZhiyong Tao 	PIN_RSEL(29, 30, 0x0, 75000, 75000),
811387292c3SZhiyong Tao 	PIN_RSEL(29, 30, 0x1, 10000, 5000),
812387292c3SZhiyong Tao 	PIN_RSEL(29, 30, 0x2, 5000, 75000),
813387292c3SZhiyong Tao 	PIN_RSEL(29, 30, 0x3, 4000, 5000),
814387292c3SZhiyong Tao 	PIN_RSEL(29, 30, 0x4, 3000, 75000),
815387292c3SZhiyong Tao 	PIN_RSEL(29, 30, 0x5, 2000, 5000),
816387292c3SZhiyong Tao 	PIN_RSEL(29, 30, 0x6, 1500, 75000),
817387292c3SZhiyong Tao 	PIN_RSEL(29, 30, 0x7, 1000, 5000),
818387292c3SZhiyong Tao 	PIN_RSEL(34, 35, 0x0, 75000, 75000),
819387292c3SZhiyong Tao 	PIN_RSEL(34, 35, 0x1, 10000, 5000),
820387292c3SZhiyong Tao 	PIN_RSEL(34, 35, 0x2, 5000, 75000),
821387292c3SZhiyong Tao 	PIN_RSEL(34, 35, 0x3, 4000, 5000),
822387292c3SZhiyong Tao 	PIN_RSEL(34, 35, 0x4, 3000, 75000),
823387292c3SZhiyong Tao 	PIN_RSEL(34, 35, 0x5, 2000, 5000),
824387292c3SZhiyong Tao 	PIN_RSEL(34, 35, 0x6, 1500, 75000),
825387292c3SZhiyong Tao 	PIN_RSEL(34, 35, 0x7, 1000, 5000),
826387292c3SZhiyong Tao 	PIN_RSEL(44, 45, 0x0, 75000, 75000),
827387292c3SZhiyong Tao 	PIN_RSEL(44, 45, 0x1, 10000, 5000),
828387292c3SZhiyong Tao 	PIN_RSEL(44, 45, 0x2, 5000, 75000),
829387292c3SZhiyong Tao 	PIN_RSEL(44, 45, 0x3, 4000, 5000),
830387292c3SZhiyong Tao 	PIN_RSEL(44, 45, 0x4, 3000, 75000),
831387292c3SZhiyong Tao 	PIN_RSEL(44, 45, 0x5, 2000, 5000),
832387292c3SZhiyong Tao 	PIN_RSEL(44, 45, 0x6, 1500, 75000),
833387292c3SZhiyong Tao 	PIN_RSEL(44, 45, 0x7, 1000, 5000),
834387292c3SZhiyong Tao };
835387292c3SZhiyong Tao 
836387292c3SZhiyong Tao static const unsigned int mt8195_pull_type[] = {
837387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 0 */, MTK_PULL_PUPD_R1R0_TYPE /* 1 */,
838387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 2 */, MTK_PULL_PUPD_R1R0_TYPE /* 3 */,
839387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 4 */, MTK_PULL_PUPD_R1R0_TYPE /* 5 */,
840387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 6 */, MTK_PULL_PU_PD_TYPE /* 7 */,
841387292c3SZhiyong Tao 	MTK_PULL_PU_PD_RSEL_TYPE /* 8 */, MTK_PULL_PU_PD_RSEL_TYPE /* 9 */,
842387292c3SZhiyong Tao 	MTK_PULL_PU_PD_RSEL_TYPE /* 10 */, MTK_PULL_PU_PD_RSEL_TYPE /* 11 */,
843387292c3SZhiyong Tao 	MTK_PULL_PU_PD_RSEL_TYPE /* 12 */, MTK_PULL_PU_PD_RSEL_TYPE /* 13 */,
844387292c3SZhiyong Tao 	MTK_PULL_PU_PD_RSEL_TYPE /* 14 */, MTK_PULL_PU_PD_RSEL_TYPE /* 15 */,
845387292c3SZhiyong Tao 	MTK_PULL_PU_PD_RSEL_TYPE /* 16 */, MTK_PULL_PU_PD_RSEL_TYPE /* 17 */,
846387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 18 */, MTK_PULL_PU_PD_TYPE /* 19 */,
847387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 20 */, MTK_PULL_PU_PD_TYPE /* 21 */,
848387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 22 */, MTK_PULL_PU_PD_TYPE /* 23 */,
849387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 24 */, MTK_PULL_PU_PD_TYPE /* 25 */,
850387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 26 */, MTK_PULL_PU_PD_TYPE /* 27 */,
851387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 28 */, MTK_PULL_PU_PD_RSEL_TYPE /* 29 */,
852387292c3SZhiyong Tao 	MTK_PULL_PU_PD_RSEL_TYPE /* 30 */, MTK_PULL_PU_PD_TYPE /* 31 */,
853387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 32 */, MTK_PULL_PU_PD_TYPE /* 33 */,
854387292c3SZhiyong Tao 	MTK_PULL_PU_PD_RSEL_TYPE /* 34 */, MTK_PULL_PU_PD_RSEL_TYPE /* 35 */,
855387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 36 */, MTK_PULL_PU_PD_TYPE /* 37 */,
856387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 38 */, MTK_PULL_PU_PD_TYPE /* 39 */,
857387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 40 */, MTK_PULL_PU_PD_TYPE /* 41 */,
858387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 42 */, MTK_PULL_PU_PD_TYPE /* 43 */,
859387292c3SZhiyong Tao 	MTK_PULL_PU_PD_RSEL_TYPE /* 44 */, MTK_PULL_PU_PD_RSEL_TYPE /* 45 */,
860387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 46 */, MTK_PULL_PU_PD_TYPE /* 47 */,
861387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 48 */, MTK_PULL_PU_PD_TYPE /* 49 */,
862387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 50 */, MTK_PULL_PU_PD_TYPE /* 51 */,
863387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 52 */, MTK_PULL_PU_PD_TYPE /* 53 */,
864387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 54 */, MTK_PULL_PU_PD_TYPE /* 55 */,
865387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 56 */, MTK_PULL_PU_PD_TYPE /* 57 */,
866387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 58 */, MTK_PULL_PU_PD_TYPE /* 59 */,
867387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 60 */, MTK_PULL_PU_PD_TYPE /* 61 */,
868387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 62 */, MTK_PULL_PU_PD_TYPE /* 63 */,
869387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 64 */, MTK_PULL_PU_PD_TYPE /* 65 */,
870387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 66 */, MTK_PULL_PU_PD_TYPE /* 67 */,
871387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 68 */, MTK_PULL_PU_PD_TYPE /* 69 */,
872387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 70 */, MTK_PULL_PU_PD_TYPE /* 71 */,
873387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 72 */, MTK_PULL_PU_PD_TYPE /* 73 */,
874387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 74 */, MTK_PULL_PU_PD_TYPE /* 75 */,
875387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 76 */, MTK_PULL_PUPD_R1R0_TYPE /* 77 */,
876387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 78 */, MTK_PULL_PUPD_R1R0_TYPE /* 79 */,
877387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 80 */, MTK_PULL_PUPD_R1R0_TYPE /* 81 */,
878387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 82 */, MTK_PULL_PUPD_R1R0_TYPE /* 83 */,
879387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 84 */, MTK_PULL_PUPD_R1R0_TYPE /* 85 */,
880387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 86 */, MTK_PULL_PUPD_R1R0_TYPE /* 87 */,
881387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 88 */, MTK_PULL_PUPD_R1R0_TYPE /* 89 */,
882387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 90 */, MTK_PULL_PUPD_R1R0_TYPE /* 91 */,
883387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 92 */, MTK_PULL_PUPD_R1R0_TYPE /* 93 */,
884387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 94 */, MTK_PULL_PUPD_R1R0_TYPE /* 95 */,
885387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 96 */, MTK_PULL_PU_PD_TYPE /* 97 */,
886387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 98 */, MTK_PULL_PU_PD_TYPE /* 99 */,
887387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 100 */, MTK_PULL_PU_PD_TYPE /* 101 */,
888387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 102 */, MTK_PULL_PU_PD_TYPE /* 103 */,
889387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 104 */, MTK_PULL_PUPD_R1R0_TYPE /* 105 */,
890387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 106 */, MTK_PULL_PUPD_R1R0_TYPE /* 107 */,
891387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 108 */, MTK_PULL_PU_PD_TYPE /* 109 */,
892387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 110 */, MTK_PULL_PUPD_R1R0_TYPE /* 111 */,
893387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 112 */, MTK_PULL_PUPD_R1R0_TYPE /* 113 */,
894387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 114 */, MTK_PULL_PUPD_R1R0_TYPE /* 115 */,
895387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 116 */, MTK_PULL_PUPD_R1R0_TYPE /* 117 */,
896387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 118 */, MTK_PULL_PUPD_R1R0_TYPE /* 119 */,
897387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 120 */, MTK_PULL_PUPD_R1R0_TYPE /* 121 */,
898387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 122 */, MTK_PULL_PUPD_R1R0_TYPE /* 123 */,
899387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 124 */, MTK_PULL_PUPD_R1R0_TYPE /* 125 */,
900387292c3SZhiyong Tao 	MTK_PULL_PUPD_R1R0_TYPE /* 126 */, MTK_PULL_PUPD_R1R0_TYPE /* 127 */,
901387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 128 */, MTK_PULL_PU_PD_TYPE /* 129 */,
902387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 130 */, MTK_PULL_PU_PD_TYPE /* 131 */,
903387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 132 */, MTK_PULL_PU_PD_TYPE /* 133 */,
904387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 134 */, MTK_PULL_PU_PD_TYPE /* 135 */,
905387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 136 */, MTK_PULL_PU_PD_TYPE /* 137 */,
906387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 138 */, MTK_PULL_PU_PD_TYPE /* 139 */,
907387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 140 */, MTK_PULL_PU_PD_TYPE /* 141 */,
908387292c3SZhiyong Tao 	MTK_PULL_PU_PD_TYPE /* 142 */, MTK_PULL_PU_PD_TYPE /* 143 */,
909387292c3SZhiyong Tao };
910387292c3SZhiyong Tao 
9116cf5e9efSZhiyong Tao static const struct mtk_pin_reg_calc mt8195_reg_cals[PINCTRL_PIN_REG_MAX] = {
9126cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt8195_pin_mode_range),
9136cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt8195_pin_dir_range),
9146cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_DI] = MTK_RANGE(mt8195_pin_di_range),
9156cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_DO] = MTK_RANGE(mt8195_pin_do_range),
9166cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt8195_pin_smt_range),
9176cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_IES] = MTK_RANGE(mt8195_pin_ies_range),
9186cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_PU] = MTK_RANGE(mt8195_pin_pu_range),
9196cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_PD] = MTK_RANGE(mt8195_pin_pd_range),
9206cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt8195_pin_drv_range),
9216cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt8195_pin_pupd_range),
9226cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_R0] = MTK_RANGE(mt8195_pin_r0_range),
9236cf5e9efSZhiyong Tao 	[PINCTRL_PIN_REG_R1] = MTK_RANGE(mt8195_pin_r1_range),
924ea9d2ed4SZhiyong Tao 	[PINCTRL_PIN_REG_DRV_ADV] = MTK_RANGE(mt8195_pin_drv_adv_range),
925387292c3SZhiyong Tao 	[PINCTRL_PIN_REG_RSEL] = MTK_RANGE(mt8195_pin_rsel_range),
9266cf5e9efSZhiyong Tao };
9276cf5e9efSZhiyong Tao 
9286cf5e9efSZhiyong Tao static const char * const mt8195_pinctrl_register_base_names[] = {
9296cf5e9efSZhiyong Tao 	"iocfg0", "iocfg_bm", "iocfg_bl", "iocfg_br", "iocfg_lm",
9306cf5e9efSZhiyong Tao 	"iocfg_rb", "iocfg_tl",
9316cf5e9efSZhiyong Tao };
9326cf5e9efSZhiyong Tao 
9336cf5e9efSZhiyong Tao static const struct mtk_eint_hw mt8195_eint_hw = {
9346cf5e9efSZhiyong Tao 	.port_mask = 0xf,
9356cf5e9efSZhiyong Tao 	.ports     = 7,
9366cf5e9efSZhiyong Tao 	.ap_num    = 225,
9376cf5e9efSZhiyong Tao 	.db_cnt    = 32,
9386cf5e9efSZhiyong Tao };
9396cf5e9efSZhiyong Tao 
9406cf5e9efSZhiyong Tao static const struct mtk_pin_soc mt8195_data = {
9416cf5e9efSZhiyong Tao 	.reg_cal = mt8195_reg_cals,
9426cf5e9efSZhiyong Tao 	.pins = mtk_pins_mt8195,
9436cf5e9efSZhiyong Tao 	.npins = ARRAY_SIZE(mtk_pins_mt8195),
9446cf5e9efSZhiyong Tao 	.ngrps = ARRAY_SIZE(mtk_pins_mt8195),
9456cf5e9efSZhiyong Tao 	.eint_hw = &mt8195_eint_hw,
9466cf5e9efSZhiyong Tao 	.nfuncs = 8,
9476cf5e9efSZhiyong Tao 	.gpio_m = 0,
9486cf5e9efSZhiyong Tao 	.base_names = mt8195_pinctrl_register_base_names,
9496cf5e9efSZhiyong Tao 	.nbase_names = ARRAY_SIZE(mt8195_pinctrl_register_base_names),
950387292c3SZhiyong Tao 	.pull_type = mt8195_pull_type,
951387292c3SZhiyong Tao 	.pin_rsel = mt8195_pin_rsel_val_range,
952387292c3SZhiyong Tao 	.npin_rsel = ARRAY_SIZE(mt8195_pin_rsel_val_range),
9536cf5e9efSZhiyong Tao 	.bias_set_combo = mtk_pinconf_bias_set_combo,
9546cf5e9efSZhiyong Tao 	.bias_get_combo = mtk_pinconf_bias_get_combo,
9556cf5e9efSZhiyong Tao 	.drive_set = mtk_pinconf_drive_set_rev1,
9566cf5e9efSZhiyong Tao 	.drive_get = mtk_pinconf_drive_get_rev1,
957ea9d2ed4SZhiyong Tao 	.adv_drive_get = mtk_pinconf_adv_drive_get_raw,
958ea9d2ed4SZhiyong Tao 	.adv_drive_set = mtk_pinconf_adv_drive_set_raw,
9596cf5e9efSZhiyong Tao };
9606cf5e9efSZhiyong Tao 
9616cf5e9efSZhiyong Tao static const struct of_device_id mt8195_pinctrl_of_match[] = {
962*78df7bbaSAngeloGioacchino Del Regno 	{ .compatible = "mediatek,mt8195-pinctrl", .data = &mt8195_data },
9636cf5e9efSZhiyong Tao 	{ }
9646cf5e9efSZhiyong Tao };
9656cf5e9efSZhiyong Tao 
9666cf5e9efSZhiyong Tao static struct platform_driver mt8195_pinctrl_driver = {
9676cf5e9efSZhiyong Tao 	.driver = {
9686cf5e9efSZhiyong Tao 		.name = "mt8195-pinctrl",
9696cf5e9efSZhiyong Tao 		.of_match_table = mt8195_pinctrl_of_match,
970d9608eabSZhiyong Tao 		.pm = &mtk_paris_pinctrl_pm_ops,
9716cf5e9efSZhiyong Tao 	},
972*78df7bbaSAngeloGioacchino Del Regno 	.probe = mtk_paris_pinctrl_probe,
9736cf5e9efSZhiyong Tao };
9746cf5e9efSZhiyong Tao 
9756cf5e9efSZhiyong Tao static int __init mt8195_pinctrl_init(void)
9766cf5e9efSZhiyong Tao {
9776cf5e9efSZhiyong Tao 	return platform_driver_register(&mt8195_pinctrl_driver);
9786cf5e9efSZhiyong Tao }
9796cf5e9efSZhiyong Tao arch_initcall(mt8195_pinctrl_init);
980