18b483bdaSGuodong Liu // SPDX-License-Identifier: GPL-2.0
28b483bdaSGuodong Liu /*
38b483bdaSGuodong Liu * Copyright (C) 2021 MediaTek Inc.
48b483bdaSGuodong Liu *
58b483bdaSGuodong Liu * Author: Guodong Liu <guodong.liu@mediatek.com>
68b483bdaSGuodong Liu *
78b483bdaSGuodong Liu */
88b483bdaSGuodong Liu
98b483bdaSGuodong Liu #include "pinctrl-mtk-mt8186.h"
108b483bdaSGuodong Liu #include "pinctrl-paris.h"
118b483bdaSGuodong Liu
128b483bdaSGuodong Liu /* MT8186 have multiple bases to program pin configuration listed as the below:
138b483bdaSGuodong Liu * iocfg[0]:0x10005000, iocfg[1]:0x10002000, iocfg[2]:0x10002200,
148b483bdaSGuodong Liu * iocfg[3]:0x10002400, iocfg[4]:0x10002600, iocfg[5]:0x10002800,
158b483bdaSGuodong Liu * iocfg[6]:0x10002C00.
168b483bdaSGuodong Liu * _i_based could be used to indicate what base the pin should be mapped into.
178b483bdaSGuodong Liu */
188b483bdaSGuodong Liu
198b483bdaSGuodong Liu #define PIN_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \
208b483bdaSGuodong Liu PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, 32, 0)
218b483bdaSGuodong Liu
228b483bdaSGuodong Liu #define PINS_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \
238b483bdaSGuodong Liu PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, 32, 1)
248b483bdaSGuodong Liu
258b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_mode_range[] = {
268b483bdaSGuodong Liu PIN_FIELD(0, 184, 0x300, 0x10, 0, 4),
278b483bdaSGuodong Liu };
288b483bdaSGuodong Liu
298b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_dir_range[] = {
308b483bdaSGuodong Liu PIN_FIELD(0, 184, 0x0, 0x10, 0, 1),
318b483bdaSGuodong Liu };
328b483bdaSGuodong Liu
338b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_di_range[] = {
348b483bdaSGuodong Liu PIN_FIELD(0, 184, 0x200, 0x10, 0, 1),
358b483bdaSGuodong Liu };
368b483bdaSGuodong Liu
378b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_do_range[] = {
388b483bdaSGuodong Liu PIN_FIELD(0, 184, 0x100, 0x10, 0, 1),
398b483bdaSGuodong Liu };
408b483bdaSGuodong Liu
418b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_ies_range[] = {
428b483bdaSGuodong Liu PIN_FIELD_BASE(0, 0, 6, 0x0030, 0x10, 13, 1),
438b483bdaSGuodong Liu PIN_FIELD_BASE(1, 1, 6, 0x0030, 0x10, 14, 1),
448b483bdaSGuodong Liu PIN_FIELD_BASE(2, 2, 6, 0x0030, 0x10, 17, 1),
458b483bdaSGuodong Liu PIN_FIELD_BASE(3, 3, 6, 0x0030, 0x10, 18, 1),
468b483bdaSGuodong Liu PIN_FIELD_BASE(4, 4, 6, 0x0030, 0x10, 19, 1),
478b483bdaSGuodong Liu PIN_FIELD_BASE(5, 5, 6, 0x0030, 0x10, 20, 1),
488b483bdaSGuodong Liu PIN_FIELD_BASE(6, 6, 4, 0x0020, 0x10, 19, 1),
498b483bdaSGuodong Liu PIN_FIELD_BASE(7, 7, 4, 0x0020, 0x10, 20, 1),
508b483bdaSGuodong Liu PIN_FIELD_BASE(8, 8, 4, 0x0020, 0x10, 21, 1),
518b483bdaSGuodong Liu PIN_FIELD_BASE(9, 9, 4, 0x0020, 0x10, 22, 1),
528b483bdaSGuodong Liu PIN_FIELD_BASE(10, 10, 4, 0x0020, 0x10, 16, 1),
538b483bdaSGuodong Liu PIN_FIELD_BASE(11, 11, 4, 0x0020, 0x10, 17, 1),
548b483bdaSGuodong Liu PIN_FIELD_BASE(12, 12, 4, 0x0020, 0x10, 18, 1),
558b483bdaSGuodong Liu PIN_FIELD_BASE(13, 13, 3, 0x0040, 0x10, 0, 1),
568b483bdaSGuodong Liu PIN_FIELD_BASE(14, 14, 3, 0x0040, 0x10, 1, 1),
578b483bdaSGuodong Liu PIN_FIELD_BASE(15, 15, 6, 0x0030, 0x10, 15, 1),
588b483bdaSGuodong Liu PIN_FIELD_BASE(16, 16, 6, 0x0030, 0x10, 16, 1),
598b483bdaSGuodong Liu PIN_FIELD_BASE(17, 17, 5, 0x0050, 0x10, 9, 1),
608b483bdaSGuodong Liu PIN_FIELD_BASE(18, 18, 5, 0x0050, 0x10, 10, 1),
618b483bdaSGuodong Liu PIN_FIELD_BASE(19, 19, 5, 0x0050, 0x10, 3, 1),
628b483bdaSGuodong Liu PIN_FIELD_BASE(20, 20, 5, 0x0050, 0x10, 6, 1),
638b483bdaSGuodong Liu PIN_FIELD_BASE(21, 21, 5, 0x0050, 0x10, 4, 1),
648b483bdaSGuodong Liu PIN_FIELD_BASE(22, 22, 5, 0x0050, 0x10, 7, 1),
658b483bdaSGuodong Liu PIN_FIELD_BASE(23, 23, 5, 0x0050, 0x10, 5, 1),
668b483bdaSGuodong Liu PIN_FIELD_BASE(24, 24, 5, 0x0050, 0x10, 8, 1),
678b483bdaSGuodong Liu PIN_FIELD_BASE(25, 25, 5, 0x0050, 0x10, 18, 1),
688b483bdaSGuodong Liu PIN_FIELD_BASE(26, 26, 5, 0x0050, 0x10, 15, 1),
698b483bdaSGuodong Liu PIN_FIELD_BASE(27, 27, 5, 0x0050, 0x10, 17, 1),
708b483bdaSGuodong Liu PIN_FIELD_BASE(28, 28, 5, 0x0050, 0x10, 16, 1),
718b483bdaSGuodong Liu PIN_FIELD_BASE(29, 29, 6, 0x0030, 0x10, 0, 1),
728b483bdaSGuodong Liu PIN_FIELD_BASE(30, 30, 6, 0x0030, 0x10, 1, 1),
738b483bdaSGuodong Liu PIN_FIELD_BASE(31, 31, 6, 0x0030, 0x10, 2, 1),
748b483bdaSGuodong Liu PIN_FIELD_BASE(32, 32, 2, 0x0040, 0x10, 25, 1),
758b483bdaSGuodong Liu PIN_FIELD_BASE(33, 33, 2, 0x0040, 0x10, 27, 1),
768b483bdaSGuodong Liu PIN_FIELD_BASE(34, 34, 2, 0x0040, 0x10, 26, 1),
778b483bdaSGuodong Liu PIN_FIELD_BASE(35, 35, 2, 0x0040, 0x10, 28, 1),
788b483bdaSGuodong Liu PIN_FIELD_BASE(36, 36, 2, 0x0040, 0x10, 9, 1),
798b483bdaSGuodong Liu PIN_FIELD_BASE(37, 37, 2, 0x0040, 0x10, 10, 1),
808b483bdaSGuodong Liu PIN_FIELD_BASE(38, 38, 2, 0x0040, 0x10, 12, 1),
818b483bdaSGuodong Liu PIN_FIELD_BASE(39, 39, 2, 0x0040, 0x10, 11, 1),
828b483bdaSGuodong Liu PIN_FIELD_BASE(40, 40, 2, 0x0040, 0x10, 13, 1),
838b483bdaSGuodong Liu PIN_FIELD_BASE(41, 41, 2, 0x0040, 0x10, 14, 1),
848b483bdaSGuodong Liu PIN_FIELD_BASE(42, 42, 2, 0x0040, 0x10, 16, 1),
858b483bdaSGuodong Liu PIN_FIELD_BASE(43, 43, 2, 0x0040, 0x10, 15, 1),
868b483bdaSGuodong Liu PIN_FIELD_BASE(44, 44, 5, 0x0060, 0x10, 0, 1),
878b483bdaSGuodong Liu PIN_FIELD_BASE(45, 45, 5, 0x0060, 0x10, 1, 1),
888b483bdaSGuodong Liu PIN_FIELD_BASE(46, 46, 5, 0x0060, 0x10, 3, 1),
898b483bdaSGuodong Liu PIN_FIELD_BASE(47, 47, 5, 0x0060, 0x10, 2, 1),
908b483bdaSGuodong Liu PIN_FIELD_BASE(48, 48, 2, 0x0040, 0x10, 17, 1),
918b483bdaSGuodong Liu PIN_FIELD_BASE(49, 49, 2, 0x0040, 0x10, 18, 1),
928b483bdaSGuodong Liu PIN_FIELD_BASE(50, 50, 2, 0x0040, 0x10, 20, 1),
938b483bdaSGuodong Liu PIN_FIELD_BASE(51, 51, 2, 0x0040, 0x10, 19, 1),
948b483bdaSGuodong Liu PIN_FIELD_BASE(52, 52, 3, 0x0040, 0x10, 18, 1),
958b483bdaSGuodong Liu PIN_FIELD_BASE(53, 53, 3, 0x0040, 0x10, 19, 1),
968b483bdaSGuodong Liu PIN_FIELD_BASE(54, 54, 3, 0x0040, 0x10, 21, 1),
978b483bdaSGuodong Liu PIN_FIELD_BASE(55, 55, 3, 0x0040, 0x10, 20, 1),
988b483bdaSGuodong Liu PIN_FIELD_BASE(56, 56, 5, 0x0050, 0x10, 12, 1),
998b483bdaSGuodong Liu PIN_FIELD_BASE(57, 57, 5, 0x0050, 0x10, 11, 1),
1008b483bdaSGuodong Liu PIN_FIELD_BASE(58, 58, 5, 0x0050, 0x10, 13, 1),
1018b483bdaSGuodong Liu PIN_FIELD_BASE(59, 59, 5, 0x0050, 0x10, 14, 1),
1028b483bdaSGuodong Liu PIN_FIELD_BASE(60, 60, 3, 0x0040, 0x10, 27, 1),
1038b483bdaSGuodong Liu PIN_FIELD_BASE(61, 61, 3, 0x0040, 0x10, 22, 1),
1048b483bdaSGuodong Liu PIN_FIELD_BASE(62, 62, 3, 0x0040, 0x10, 28, 1),
1058b483bdaSGuodong Liu PIN_FIELD_BASE(63, 63, 3, 0x0040, 0x10, 23, 1),
1068b483bdaSGuodong Liu PIN_FIELD_BASE(64, 64, 3, 0x0040, 0x10, 24, 1),
1078b483bdaSGuodong Liu PIN_FIELD_BASE(65, 65, 3, 0x0040, 0x10, 25, 1),
1088b483bdaSGuodong Liu PIN_FIELD_BASE(66, 66, 3, 0x0040, 0x10, 26, 1),
1098b483bdaSGuodong Liu PIN_FIELD_BASE(67, 67, 1, 0x0050, 0x10, 18, 1),
1108b483bdaSGuodong Liu PIN_FIELD_BASE(68, 68, 1, 0x0050, 0x10, 8, 1),
1118b483bdaSGuodong Liu PIN_FIELD_BASE(69, 69, 1, 0x0050, 0x10, 9, 1),
1128b483bdaSGuodong Liu PIN_FIELD_BASE(70, 70, 1, 0x0050, 0x10, 19, 1),
1138b483bdaSGuodong Liu PIN_FIELD_BASE(71, 71, 1, 0x0050, 0x10, 10, 1),
1148b483bdaSGuodong Liu PIN_FIELD_BASE(72, 72, 1, 0x0050, 0x10, 11, 1),
1158b483bdaSGuodong Liu PIN_FIELD_BASE(73, 73, 1, 0x0050, 0x10, 12, 1),
1168b483bdaSGuodong Liu PIN_FIELD_BASE(74, 74, 1, 0x0050, 0x10, 13, 1),
1178b483bdaSGuodong Liu PIN_FIELD_BASE(75, 75, 1, 0x0050, 0x10, 14, 1),
1188b483bdaSGuodong Liu PIN_FIELD_BASE(76, 76, 1, 0x0050, 0x10, 15, 1),
1198b483bdaSGuodong Liu PIN_FIELD_BASE(77, 77, 1, 0x0050, 0x10, 16, 1),
1208b483bdaSGuodong Liu PIN_FIELD_BASE(78, 78, 1, 0x0050, 0x10, 17, 1),
1218b483bdaSGuodong Liu PIN_FIELD_BASE(79, 79, 5, 0x0050, 0x10, 24, 1),
1228b483bdaSGuodong Liu PIN_FIELD_BASE(80, 80, 5, 0x0050, 0x10, 25, 1),
1238b483bdaSGuodong Liu PIN_FIELD_BASE(81, 81, 5, 0x0050, 0x10, 26, 1),
1248b483bdaSGuodong Liu PIN_FIELD_BASE(82, 82, 5, 0x0050, 0x10, 27, 1),
1258b483bdaSGuodong Liu PIN_FIELD_BASE(83, 83, 6, 0x0030, 0x10, 3, 1),
1268b483bdaSGuodong Liu PIN_FIELD_BASE(84, 84, 3, 0x0040, 0x10, 4, 1),
1278b483bdaSGuodong Liu PIN_FIELD_BASE(85, 85, 3, 0x0040, 0x10, 5, 1),
1288b483bdaSGuodong Liu PIN_FIELD_BASE(86, 86, 3, 0x0040, 0x10, 6, 1),
1298b483bdaSGuodong Liu PIN_FIELD_BASE(87, 87, 3, 0x0040, 0x10, 7, 1),
1308b483bdaSGuodong Liu PIN_FIELD_BASE(88, 88, 3, 0x0040, 0x10, 8, 1),
1318b483bdaSGuodong Liu PIN_FIELD_BASE(89, 89, 3, 0x0040, 0x10, 9, 1),
1328b483bdaSGuodong Liu PIN_FIELD_BASE(90, 90, 3, 0x0040, 0x10, 2, 1),
1338b483bdaSGuodong Liu PIN_FIELD_BASE(91, 91, 3, 0x0040, 0x10, 29, 1),
1348b483bdaSGuodong Liu PIN_FIELD_BASE(92, 92, 3, 0x0040, 0x10, 31, 1),
1358b483bdaSGuodong Liu PIN_FIELD_BASE(93, 93, 3, 0x0040, 0x10, 3, 1),
1368b483bdaSGuodong Liu PIN_FIELD_BASE(94, 94, 3, 0x0040, 0x10, 30, 1),
1378b483bdaSGuodong Liu PIN_FIELD_BASE(95, 95, 3, 0x0050, 0x10, 0, 1),
1388b483bdaSGuodong Liu PIN_FIELD_BASE(96, 96, 2, 0x0040, 0x10, 1, 1),
1398b483bdaSGuodong Liu PIN_FIELD_BASE(97, 97, 2, 0x0040, 0x10, 0, 1),
1408b483bdaSGuodong Liu PIN_FIELD_BASE(98, 98, 2, 0x0040, 0x10, 2, 1),
1418b483bdaSGuodong Liu PIN_FIELD_BASE(99, 99, 4, 0x0020, 0x10, 14, 1),
1428b483bdaSGuodong Liu PIN_FIELD_BASE(100, 100, 4, 0x0020, 0x10, 15, 1),
1438b483bdaSGuodong Liu PIN_FIELD_BASE(101, 101, 4, 0x0020, 0x10, 13, 1),
1448b483bdaSGuodong Liu PIN_FIELD_BASE(102, 102, 4, 0x0020, 0x10, 12, 1),
1458b483bdaSGuodong Liu PIN_FIELD_BASE(103, 103, 4, 0x0020, 0x10, 0, 1),
1468b483bdaSGuodong Liu PIN_FIELD_BASE(104, 104, 4, 0x0020, 0x10, 1, 1),
1478b483bdaSGuodong Liu PIN_FIELD_BASE(105, 105, 4, 0x0020, 0x10, 4, 1),
1488b483bdaSGuodong Liu PIN_FIELD_BASE(106, 106, 4, 0x0020, 0x10, 5, 1),
1498b483bdaSGuodong Liu PIN_FIELD_BASE(107, 107, 4, 0x0020, 0x10, 6, 1),
1508b483bdaSGuodong Liu PIN_FIELD_BASE(108, 108, 4, 0x0020, 0x10, 7, 1),
1518b483bdaSGuodong Liu PIN_FIELD_BASE(109, 109, 4, 0x0020, 0x10, 8, 1),
1528b483bdaSGuodong Liu PIN_FIELD_BASE(110, 110, 4, 0x0020, 0x10, 9, 1),
1538b483bdaSGuodong Liu PIN_FIELD_BASE(111, 111, 4, 0x0020, 0x10, 10, 1),
1548b483bdaSGuodong Liu PIN_FIELD_BASE(112, 112, 4, 0x0020, 0x10, 11, 1),
1558b483bdaSGuodong Liu PIN_FIELD_BASE(113, 113, 4, 0x0020, 0x10, 2, 1),
1568b483bdaSGuodong Liu PIN_FIELD_BASE(114, 114, 4, 0x0020, 0x10, 3, 1),
1578b483bdaSGuodong Liu PIN_FIELD_BASE(115, 115, 3, 0x0040, 0x10, 10, 1),
1588b483bdaSGuodong Liu PIN_FIELD_BASE(116, 116, 3, 0x0040, 0x10, 13, 1),
1598b483bdaSGuodong Liu PIN_FIELD_BASE(117, 117, 3, 0x0040, 0x10, 11, 1),
1608b483bdaSGuodong Liu PIN_FIELD_BASE(118, 118, 3, 0x0040, 0x10, 12, 1),
1618b483bdaSGuodong Liu PIN_FIELD_BASE(119, 119, 5, 0x0050, 0x10, 22, 1),
1628b483bdaSGuodong Liu PIN_FIELD_BASE(120, 120, 5, 0x0050, 0x10, 19, 1),
1638b483bdaSGuodong Liu PIN_FIELD_BASE(121, 121, 5, 0x0050, 0x10, 20, 1),
1648b483bdaSGuodong Liu PIN_FIELD_BASE(122, 122, 5, 0x0050, 0x10, 21, 1),
1658b483bdaSGuodong Liu PIN_FIELD_BASE(123, 123, 5, 0x0050, 0x10, 23, 1),
1668b483bdaSGuodong Liu PIN_FIELD_BASE(124, 124, 5, 0x0050, 0x10, 0, 1),
1678b483bdaSGuodong Liu PIN_FIELD_BASE(125, 125, 5, 0x0050, 0x10, 1, 1),
1688b483bdaSGuodong Liu PIN_FIELD_BASE(126, 126, 5, 0x0050, 0x10, 2, 1),
1698b483bdaSGuodong Liu PIN_FIELD_BASE(127, 127, 3, 0x0040, 0x10, 14, 1),
1708b483bdaSGuodong Liu PIN_FIELD_BASE(128, 128, 3, 0x0040, 0x10, 16, 1),
1718b483bdaSGuodong Liu PIN_FIELD_BASE(129, 129, 5, 0x0050, 0x10, 28, 1),
1728b483bdaSGuodong Liu PIN_FIELD_BASE(130, 130, 5, 0x0050, 0x10, 30, 1),
1738b483bdaSGuodong Liu PIN_FIELD_BASE(131, 131, 5, 0x0050, 0x10, 29, 1),
1748b483bdaSGuodong Liu PIN_FIELD_BASE(132, 132, 5, 0x0050, 0x10, 31, 1),
1758b483bdaSGuodong Liu PIN_FIELD_BASE(133, 133, 1, 0x0050, 0x10, 21, 1),
1768b483bdaSGuodong Liu PIN_FIELD_BASE(134, 134, 1, 0x0050, 0x10, 24, 1),
1778b483bdaSGuodong Liu PIN_FIELD_BASE(135, 135, 6, 0x0030, 0x10, 21, 1),
1788b483bdaSGuodong Liu PIN_FIELD_BASE(136, 136, 6, 0x0030, 0x10, 24, 1),
1798b483bdaSGuodong Liu PIN_FIELD_BASE(137, 137, 1, 0x0050, 0x10, 22, 1),
1808b483bdaSGuodong Liu PIN_FIELD_BASE(138, 138, 1, 0x0050, 0x10, 25, 1),
1818b483bdaSGuodong Liu PIN_FIELD_BASE(139, 139, 2, 0x0040, 0x10, 7, 1),
1828b483bdaSGuodong Liu PIN_FIELD_BASE(140, 140, 2, 0x0040, 0x10, 8, 1),
1838b483bdaSGuodong Liu PIN_FIELD_BASE(141, 141, 3, 0x0040, 0x10, 15, 1),
1848b483bdaSGuodong Liu PIN_FIELD_BASE(142, 142, 3, 0x0040, 0x10, 17, 1),
1858b483bdaSGuodong Liu PIN_FIELD_BASE(143, 143, 6, 0x0030, 0x10, 22, 1),
1868b483bdaSGuodong Liu PIN_FIELD_BASE(144, 144, 6, 0x0030, 0x10, 25, 1),
1878b483bdaSGuodong Liu PIN_FIELD_BASE(145, 145, 6, 0x0030, 0x10, 23, 1),
1888b483bdaSGuodong Liu PIN_FIELD_BASE(146, 146, 6, 0x0030, 0x10, 26, 1),
1898b483bdaSGuodong Liu PIN_FIELD_BASE(147, 147, 4, 0x0020, 0x10, 23, 1),
1908b483bdaSGuodong Liu PIN_FIELD_BASE(148, 148, 4, 0x0020, 0x10, 24, 1),
1918b483bdaSGuodong Liu PIN_FIELD_BASE(149, 149, 4, 0x0020, 0x10, 25, 1),
1928b483bdaSGuodong Liu PIN_FIELD_BASE(150, 150, 4, 0x0020, 0x10, 26, 1),
1938b483bdaSGuodong Liu PIN_FIELD_BASE(151, 151, 4, 0x0020, 0x10, 27, 1),
1948b483bdaSGuodong Liu PIN_FIELD_BASE(152, 152, 4, 0x0020, 0x10, 28, 1),
1958b483bdaSGuodong Liu PIN_FIELD_BASE(153, 153, 4, 0x0020, 0x10, 29, 1),
1968b483bdaSGuodong Liu PIN_FIELD_BASE(154, 154, 4, 0x0020, 0x10, 30, 1),
1978b483bdaSGuodong Liu PIN_FIELD_BASE(155, 155, 4, 0x0020, 0x10, 31, 1),
1988b483bdaSGuodong Liu PIN_FIELD_BASE(156, 156, 4, 0x0030, 0x10, 0, 1),
1998b483bdaSGuodong Liu PIN_FIELD_BASE(157, 157, 2, 0x0040, 0x10, 4, 1),
2008b483bdaSGuodong Liu PIN_FIELD_BASE(158, 158, 2, 0x0040, 0x10, 3, 1),
2018b483bdaSGuodong Liu PIN_FIELD_BASE(159, 159, 2, 0x0040, 0x10, 6, 1),
2028b483bdaSGuodong Liu PIN_FIELD_BASE(160, 160, 2, 0x0040, 0x10, 5, 1),
2038b483bdaSGuodong Liu PIN_FIELD_BASE(161, 161, 2, 0x0040, 0x10, 23, 1),
2048b483bdaSGuodong Liu PIN_FIELD_BASE(162, 162, 2, 0x0040, 0x10, 24, 1),
2058b483bdaSGuodong Liu PIN_FIELD_BASE(163, 163, 1, 0x0050, 0x10, 23, 1),
2068b483bdaSGuodong Liu PIN_FIELD_BASE(164, 164, 1, 0x0050, 0x10, 20, 1),
2078b483bdaSGuodong Liu PIN_FIELD_BASE(165, 165, 1, 0x0050, 0x10, 26, 1),
2088b483bdaSGuodong Liu PIN_FIELD_BASE(166, 166, 1, 0x0050, 0x10, 1, 1),
2098b483bdaSGuodong Liu PIN_FIELD_BASE(167, 167, 1, 0x0050, 0x10, 7, 1),
2108b483bdaSGuodong Liu PIN_FIELD_BASE(168, 168, 1, 0x0050, 0x10, 4, 1),
2118b483bdaSGuodong Liu PIN_FIELD_BASE(169, 169, 1, 0x0050, 0x10, 5, 1),
2128b483bdaSGuodong Liu PIN_FIELD_BASE(170, 170, 1, 0x0050, 0x10, 0, 1),
2138b483bdaSGuodong Liu PIN_FIELD_BASE(171, 171, 1, 0x0050, 0x10, 6, 1),
2148b483bdaSGuodong Liu PIN_FIELD_BASE(172, 172, 1, 0x0050, 0x10, 2, 1),
2158b483bdaSGuodong Liu PIN_FIELD_BASE(173, 173, 1, 0x0050, 0x10, 3, 1),
2168b483bdaSGuodong Liu PIN_FIELD_BASE(174, 174, 6, 0x0030, 0x10, 7, 1),
2178b483bdaSGuodong Liu PIN_FIELD_BASE(175, 175, 6, 0x0030, 0x10, 8, 1),
2188b483bdaSGuodong Liu PIN_FIELD_BASE(176, 176, 6, 0x0030, 0x10, 4, 1),
2198b483bdaSGuodong Liu PIN_FIELD_BASE(177, 177, 6, 0x0030, 0x10, 5, 1),
2208b483bdaSGuodong Liu PIN_FIELD_BASE(178, 178, 6, 0x0030, 0x10, 6, 1),
2218b483bdaSGuodong Liu PIN_FIELD_BASE(179, 179, 6, 0x0030, 0x10, 9, 1),
2228b483bdaSGuodong Liu PIN_FIELD_BASE(180, 180, 6, 0x0030, 0x10, 10, 1),
2238b483bdaSGuodong Liu PIN_FIELD_BASE(181, 181, 6, 0x0030, 0x10, 11, 1),
2248b483bdaSGuodong Liu PIN_FIELD_BASE(182, 182, 6, 0x0030, 0x10, 12, 1),
2258b483bdaSGuodong Liu PIN_FIELD_BASE(183, 183, 2, 0x0040, 0x10, 21, 1),
2268b483bdaSGuodong Liu PIN_FIELD_BASE(184, 184, 2, 0x0040, 0x10, 22, 1),
2278b483bdaSGuodong Liu };
2288b483bdaSGuodong Liu
2298b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_smt_range[] = {
2308b483bdaSGuodong Liu PIN_FIELD_BASE(0, 0, 6, 0x0080, 0x10, 0, 1),
2318b483bdaSGuodong Liu PIN_FIELD_BASE(1, 1, 6, 0x0080, 0x10, 0, 1),
2328b483bdaSGuodong Liu PIN_FIELD_BASE(2, 2, 6, 0x0080, 0x10, 0, 1),
2338b483bdaSGuodong Liu PIN_FIELD_BASE(3, 3, 6, 0x0080, 0x10, 0, 1),
2348b483bdaSGuodong Liu PIN_FIELD_BASE(4, 4, 6, 0x0080, 0x10, 1, 1),
2358b483bdaSGuodong Liu PIN_FIELD_BASE(5, 5, 6, 0x0080, 0x10, 1, 1),
2368b483bdaSGuodong Liu PIN_FIELD_BASE(6, 6, 4, 0x0090, 0x10, 0, 1),
2378b483bdaSGuodong Liu PIN_FIELD_BASE(7, 7, 4, 0x0090, 0x10, 1, 1),
2388b483bdaSGuodong Liu PIN_FIELD_BASE(8, 8, 4, 0x0090, 0x10, 1, 1),
2398b483bdaSGuodong Liu PIN_FIELD_BASE(9, 9, 4, 0x0090, 0x10, 1, 1),
2408b483bdaSGuodong Liu PIN_FIELD_BASE(10, 10, 4, 0x0090, 0x10, 0, 1),
2418b483bdaSGuodong Liu PIN_FIELD_BASE(11, 11, 4, 0x0090, 0x10, 0, 1),
2428b483bdaSGuodong Liu PIN_FIELD_BASE(12, 12, 4, 0x0090, 0x10, 0, 1),
2438b483bdaSGuodong Liu PIN_FIELD_BASE(13, 13, 3, 0x00e0, 0x10, 11, 1),
2448b483bdaSGuodong Liu PIN_FIELD_BASE(14, 14, 3, 0x00e0, 0x10, 11, 1),
2458b483bdaSGuodong Liu PIN_FIELD_BASE(15, 15, 6, 0x0080, 0x10, 2, 1),
2468b483bdaSGuodong Liu PIN_FIELD_BASE(16, 16, 6, 0x0080, 0x10, 2, 1),
2478b483bdaSGuodong Liu PIN_FIELD_BASE(17, 17, 5, 0x00e0, 0x10, 3, 1),
2488b483bdaSGuodong Liu PIN_FIELD_BASE(18, 18, 5, 0x00e0, 0x10, 7, 1),
2498b483bdaSGuodong Liu PIN_FIELD_BASE(19, 19, 5, 0x00e0, 0x10, 6, 1),
2508b483bdaSGuodong Liu PIN_FIELD_BASE(20, 20, 5, 0x00e0, 0x10, 5, 1),
2518b483bdaSGuodong Liu PIN_FIELD_BASE(21, 21, 5, 0x00e0, 0x10, 6, 1),
2528b483bdaSGuodong Liu PIN_FIELD_BASE(22, 22, 5, 0x00e0, 0x10, 5, 1),
2538b483bdaSGuodong Liu PIN_FIELD_BASE(23, 23, 5, 0x00e0, 0x10, 7, 1),
2548b483bdaSGuodong Liu PIN_FIELD_BASE(24, 24, 5, 0x00e0, 0x10, 10, 1),
2558b483bdaSGuodong Liu PIN_FIELD_BASE(25, 25, 5, 0x00e0, 0x10, 7, 1),
2568b483bdaSGuodong Liu PIN_FIELD_BASE(26, 26, 5, 0x00e0, 0x10, 6, 1),
2578b483bdaSGuodong Liu PIN_FIELD_BASE(27, 27, 5, 0x00e0, 0x10, 6, 1),
2588b483bdaSGuodong Liu PIN_FIELD_BASE(28, 28, 5, 0x00e0, 0x10, 7, 1),
2598b483bdaSGuodong Liu PIN_FIELD_BASE(29, 29, 6, 0x0080, 0x10, 1, 1),
2608b483bdaSGuodong Liu PIN_FIELD_BASE(30, 30, 6, 0x0080, 0x10, 1, 1),
2618b483bdaSGuodong Liu PIN_FIELD_BASE(31, 31, 6, 0x0080, 0x10, 2, 1),
2628b483bdaSGuodong Liu PIN_FIELD_BASE(32, 32, 2, 0x0090, 0x10, 2, 1),
2638b483bdaSGuodong Liu PIN_FIELD_BASE(33, 33, 2, 0x0090, 0x10, 2, 1),
2648b483bdaSGuodong Liu PIN_FIELD_BASE(34, 34, 2, 0x0090, 0x10, 1, 1),
2658b483bdaSGuodong Liu PIN_FIELD_BASE(35, 35, 2, 0x0090, 0x10, 1, 1),
2668b483bdaSGuodong Liu PIN_FIELD_BASE(36, 36, 2, 0x0090, 0x10, 3, 1),
2678b483bdaSGuodong Liu PIN_FIELD_BASE(37, 37, 2, 0x0090, 0x10, 3, 1),
2688b483bdaSGuodong Liu PIN_FIELD_BASE(38, 38, 2, 0x0090, 0x10, 4, 1),
2698b483bdaSGuodong Liu PIN_FIELD_BASE(39, 39, 2, 0x0090, 0x10, 3, 1),
2708b483bdaSGuodong Liu PIN_FIELD_BASE(40, 40, 2, 0x0090, 0x10, 5, 1),
2718b483bdaSGuodong Liu PIN_FIELD_BASE(41, 41, 2, 0x0090, 0x10, 4, 1),
2728b483bdaSGuodong Liu PIN_FIELD_BASE(42, 42, 2, 0x0090, 0x10, 4, 1),
2738b483bdaSGuodong Liu PIN_FIELD_BASE(43, 43, 2, 0x0090, 0x10, 4, 1),
2748b483bdaSGuodong Liu PIN_FIELD_BASE(44, 44, 5, 0x00e0, 0x10, 9, 1),
2758b483bdaSGuodong Liu PIN_FIELD_BASE(45, 45, 5, 0x00e0, 0x10, 8, 1),
2768b483bdaSGuodong Liu PIN_FIELD_BASE(46, 46, 5, 0x00e0, 0x10, 8, 1),
2778b483bdaSGuodong Liu PIN_FIELD_BASE(47, 47, 5, 0x00e0, 0x10, 9, 1),
2788b483bdaSGuodong Liu PIN_FIELD_BASE(48, 48, 2, 0x0090, 0x10, 5, 1),
2798b483bdaSGuodong Liu PIN_FIELD_BASE(49, 49, 2, 0x0090, 0x10, 5, 1),
2808b483bdaSGuodong Liu PIN_FIELD_BASE(50, 50, 2, 0x0090, 0x10, 5, 1),
2818b483bdaSGuodong Liu PIN_FIELD_BASE(51, 51, 2, 0x0090, 0x10, 6, 1),
2828b483bdaSGuodong Liu PIN_FIELD_BASE(52, 52, 3, 0x00e0, 0x10, 9, 1),
2838b483bdaSGuodong Liu PIN_FIELD_BASE(53, 53, 3, 0x00e0, 0x10, 10, 1),
2848b483bdaSGuodong Liu PIN_FIELD_BASE(54, 54, 3, 0x00e0, 0x10, 9, 1),
2858b483bdaSGuodong Liu PIN_FIELD_BASE(55, 55, 3, 0x00e0, 0x10, 9, 1),
2868b483bdaSGuodong Liu PIN_FIELD_BASE(56, 56, 5, 0x00e0, 0x10, 8, 1),
2878b483bdaSGuodong Liu PIN_FIELD_BASE(57, 57, 5, 0x00e0, 0x10, 9, 1),
2888b483bdaSGuodong Liu PIN_FIELD_BASE(58, 58, 5, 0x00e0, 0x10, 9, 1),
2898b483bdaSGuodong Liu PIN_FIELD_BASE(59, 59, 5, 0x00e0, 0x10, 8, 1),
2908b483bdaSGuodong Liu PIN_FIELD_BASE(60, 60, 3, 0x00e0, 0x10, 6, 1),
2918b483bdaSGuodong Liu PIN_FIELD_BASE(61, 61, 3, 0x00e0, 0x10, 6, 1),
2928b483bdaSGuodong Liu PIN_FIELD_BASE(62, 62, 3, 0x00e0, 0x10, 6, 1),
2938b483bdaSGuodong Liu PIN_FIELD_BASE(63, 63, 3, 0x00e0, 0x10, 6, 1),
2948b483bdaSGuodong Liu PIN_FIELD_BASE(64, 64, 3, 0x00e0, 0x10, 7, 1),
2958b483bdaSGuodong Liu PIN_FIELD_BASE(65, 65, 3, 0x00e0, 0x10, 7, 1),
2968b483bdaSGuodong Liu PIN_FIELD_BASE(66, 66, 3, 0x00e0, 0x10, 7, 1),
2978b483bdaSGuodong Liu PIN_FIELD_BASE(67, 67, 1, 0x00f0, 0x10, 10, 1),
2988b483bdaSGuodong Liu PIN_FIELD_BASE(68, 68, 1, 0x00f0, 0x10, 0, 1),
2998b483bdaSGuodong Liu PIN_FIELD_BASE(69, 69, 1, 0x00f0, 0x10, 1, 1),
3008b483bdaSGuodong Liu PIN_FIELD_BASE(70, 70, 1, 0x00f0, 0x10, 11, 1),
3018b483bdaSGuodong Liu PIN_FIELD_BASE(71, 71, 1, 0x00f0, 0x10, 2, 1),
3028b483bdaSGuodong Liu PIN_FIELD_BASE(72, 72, 1, 0x00f0, 0x10, 3, 1),
3038b483bdaSGuodong Liu PIN_FIELD_BASE(73, 73, 1, 0x00f0, 0x10, 4, 1),
3048b483bdaSGuodong Liu PIN_FIELD_BASE(74, 74, 1, 0x00f0, 0x10, 5, 1),
3058b483bdaSGuodong Liu PIN_FIELD_BASE(75, 75, 1, 0x00f0, 0x10, 6, 1),
3068b483bdaSGuodong Liu PIN_FIELD_BASE(76, 76, 1, 0x00f0, 0x10, 7, 1),
3078b483bdaSGuodong Liu PIN_FIELD_BASE(77, 77, 1, 0x00f0, 0x10, 8, 1),
3088b483bdaSGuodong Liu PIN_FIELD_BASE(78, 78, 1, 0x00f0, 0x10, 9, 1),
3098b483bdaSGuodong Liu PIN_FIELD_BASE(79, 79, 5, 0x00e0, 0x10, 5, 1),
3108b483bdaSGuodong Liu PIN_FIELD_BASE(80, 80, 5, 0x00e0, 0x10, 5, 1),
3118b483bdaSGuodong Liu PIN_FIELD_BASE(81, 81, 5, 0x00e0, 0x10, 4, 1),
3128b483bdaSGuodong Liu PIN_FIELD_BASE(82, 82, 5, 0x00e0, 0x10, 4, 1),
3138b483bdaSGuodong Liu PIN_FIELD_BASE(83, 83, 6, 0x0080, 0x10, 2, 1),
3148b483bdaSGuodong Liu PIN_FIELD_BASE(84, 84, 3, 0x00e0, 0x10, 0, 1),
3158b483bdaSGuodong Liu PIN_FIELD_BASE(85, 85, 3, 0x00e0, 0x10, 1, 1),
3168b483bdaSGuodong Liu PIN_FIELD_BASE(86, 86, 3, 0x00e0, 0x10, 2, 1),
3178b483bdaSGuodong Liu PIN_FIELD_BASE(87, 87, 3, 0x00e0, 0x10, 3, 1),
3188b483bdaSGuodong Liu PIN_FIELD_BASE(88, 88, 3, 0x00e0, 0x10, 4, 1),
3198b483bdaSGuodong Liu PIN_FIELD_BASE(89, 89, 3, 0x00e0, 0x10, 5, 1),
3208b483bdaSGuodong Liu PIN_FIELD_BASE(90, 90, 3, 0x00e0, 0x10, 7, 1),
3218b483bdaSGuodong Liu PIN_FIELD_BASE(91, 91, 3, 0x00e0, 0x10, 8, 1),
3228b483bdaSGuodong Liu PIN_FIELD_BASE(92, 92, 3, 0x00e0, 0x10, 8, 1),
3238b483bdaSGuodong Liu PIN_FIELD_BASE(93, 93, 3, 0x00e0, 0x10, 8, 1),
3248b483bdaSGuodong Liu PIN_FIELD_BASE(94, 94, 3, 0x00e0, 0x10, 8, 1),
3258b483bdaSGuodong Liu PIN_FIELD_BASE(95, 95, 3, 0x00e0, 0x10, 9, 1),
3268b483bdaSGuodong Liu PIN_FIELD_BASE(96, 96, 2, 0x0090, 0x10, 3, 1),
3278b483bdaSGuodong Liu PIN_FIELD_BASE(97, 97, 2, 0x0090, 0x10, 2, 1),
3288b483bdaSGuodong Liu PIN_FIELD_BASE(98, 98, 2, 0x0090, 0x10, 1, 1),
3298b483bdaSGuodong Liu PIN_FIELD_BASE(99, 99, 4, 0x0090, 0x10, 4, 1),
3308b483bdaSGuodong Liu PIN_FIELD_BASE(100, 100, 4, 0x0090, 0x10, 4, 1),
3318b483bdaSGuodong Liu PIN_FIELD_BASE(101, 101, 4, 0x0090, 0x10, 4, 1),
3328b483bdaSGuodong Liu PIN_FIELD_BASE(102, 102, 4, 0x0090, 0x10, 5, 1),
3338b483bdaSGuodong Liu PIN_FIELD_BASE(103, 103, 4, 0x0090, 0x10, 5, 1),
3348b483bdaSGuodong Liu PIN_FIELD_BASE(104, 104, 4, 0x0090, 0x10, 5, 1),
3358b483bdaSGuodong Liu PIN_FIELD_BASE(105, 105, 4, 0x0090, 0x10, 5, 1),
3368b483bdaSGuodong Liu PIN_FIELD_BASE(106, 106, 4, 0x0090, 0x10, 6, 1),
3378b483bdaSGuodong Liu PIN_FIELD_BASE(107, 107, 4, 0x0090, 0x10, 6, 1),
3388b483bdaSGuodong Liu PIN_FIELD_BASE(108, 108, 4, 0x0090, 0x10, 6, 1),
3398b483bdaSGuodong Liu PIN_FIELD_BASE(109, 109, 4, 0x0090, 0x10, 6, 1),
3408b483bdaSGuodong Liu PIN_FIELD_BASE(110, 110, 4, 0x0090, 0x10, 7, 1),
3418b483bdaSGuodong Liu PIN_FIELD_BASE(111, 111, 4, 0x0090, 0x10, 7, 1),
3428b483bdaSGuodong Liu PIN_FIELD_BASE(112, 112, 4, 0x0090, 0x10, 7, 1),
3438b483bdaSGuodong Liu PIN_FIELD_BASE(113, 113, 4, 0x0090, 0x10, 7, 1),
3448b483bdaSGuodong Liu PIN_FIELD_BASE(114, 114, 4, 0x0090, 0x10, 8, 1),
3458b483bdaSGuodong Liu PIN_FIELD_BASE(115, 115, 3, 0x00e0, 0x10, 10, 1),
3468b483bdaSGuodong Liu PIN_FIELD_BASE(116, 116, 3, 0x00e0, 0x10, 11, 1),
3478b483bdaSGuodong Liu PIN_FIELD_BASE(117, 117, 3, 0x00e0, 0x10, 10, 1),
3488b483bdaSGuodong Liu PIN_FIELD_BASE(118, 118, 3, 0x00e0, 0x10, 10, 1),
3498b483bdaSGuodong Liu PIN_FIELD_BASE(119, 119, 5, 0x00e0, 0x10, 4, 1),
3508b483bdaSGuodong Liu PIN_FIELD_BASE(120, 120, 5, 0x00e0, 0x10, 4, 1),
3518b483bdaSGuodong Liu PIN_FIELD_BASE(121, 121, 5, 0x00e0, 0x10, 3, 1),
3528b483bdaSGuodong Liu PIN_FIELD_BASE(122, 122, 5, 0x00e0, 0x10, 3, 1),
3538b483bdaSGuodong Liu PIN_FIELD_BASE(123, 123, 5, 0x00e0, 0x10, 3, 1),
3548b483bdaSGuodong Liu PIN_FIELD_BASE(124, 124, 5, 0x00e0, 0x10, 0, 1),
3558b483bdaSGuodong Liu PIN_FIELD_BASE(125, 125, 5, 0x00e0, 0x10, 1, 1),
3568b483bdaSGuodong Liu PIN_FIELD_BASE(126, 126, 5, 0x00e0, 0x10, 2, 1),
3578b483bdaSGuodong Liu PIN_FIELD_BASE(127, 127, 3, 0x00e0, 0x10, 12, 1),
3588b483bdaSGuodong Liu PIN_FIELD_BASE(128, 128, 3, 0x00e0, 0x10, 14, 1),
3598b483bdaSGuodong Liu PIN_FIELD_BASE(129, 129, 5, 0x00e0, 0x10, 11, 1),
3608b483bdaSGuodong Liu PIN_FIELD_BASE(130, 130, 5, 0x00e0, 0x10, 13, 1),
3618b483bdaSGuodong Liu PIN_FIELD_BASE(131, 131, 5, 0x00e0, 0x10, 12, 1),
3628b483bdaSGuodong Liu PIN_FIELD_BASE(132, 132, 5, 0x00e0, 0x10, 14, 1),
3638b483bdaSGuodong Liu PIN_FIELD_BASE(133, 133, 1, 0x00f0, 0x10, 15, 1),
3648b483bdaSGuodong Liu PIN_FIELD_BASE(134, 134, 1, 0x00f0, 0x10, 17, 1),
3658b483bdaSGuodong Liu PIN_FIELD_BASE(135, 135, 6, 0x0080, 0x10, 6, 1),
3668b483bdaSGuodong Liu PIN_FIELD_BASE(136, 136, 6, 0x0080, 0x10, 9, 1),
3678b483bdaSGuodong Liu PIN_FIELD_BASE(137, 137, 1, 0x00f0, 0x10, 16, 1),
3688b483bdaSGuodong Liu PIN_FIELD_BASE(138, 138, 1, 0x00f0, 0x10, 18, 1),
3698b483bdaSGuodong Liu PIN_FIELD_BASE(139, 139, 2, 0x0090, 0x10, 7, 1),
3708b483bdaSGuodong Liu PIN_FIELD_BASE(140, 140, 2, 0x0090, 0x10, 8, 1),
3718b483bdaSGuodong Liu PIN_FIELD_BASE(141, 141, 3, 0x00e0, 0x10, 13, 1),
3728b483bdaSGuodong Liu PIN_FIELD_BASE(142, 142, 3, 0x00e0, 0x10, 15, 1),
3738b483bdaSGuodong Liu PIN_FIELD_BASE(143, 143, 6, 0x0080, 0x10, 7, 1),
3748b483bdaSGuodong Liu PIN_FIELD_BASE(144, 144, 6, 0x0080, 0x10, 10, 1),
3758b483bdaSGuodong Liu PIN_FIELD_BASE(145, 145, 6, 0x0080, 0x10, 8, 1),
3768b483bdaSGuodong Liu PIN_FIELD_BASE(146, 146, 6, 0x0080, 0x10, 11, 1),
3778b483bdaSGuodong Liu PIN_FIELD_BASE(147, 147, 4, 0x0090, 0x10, 2, 1),
3788b483bdaSGuodong Liu PIN_FIELD_BASE(148, 148, 4, 0x0090, 0x10, 2, 1),
3798b483bdaSGuodong Liu PIN_FIELD_BASE(149, 149, 4, 0x0090, 0x10, 2, 1),
3808b483bdaSGuodong Liu PIN_FIELD_BASE(150, 150, 4, 0x0090, 0x10, 2, 1),
3818b483bdaSGuodong Liu PIN_FIELD_BASE(151, 151, 4, 0x0090, 0x10, 3, 1),
3828b483bdaSGuodong Liu PIN_FIELD_BASE(152, 152, 4, 0x0090, 0x10, 1, 1),
3838b483bdaSGuodong Liu PIN_FIELD_BASE(153, 153, 4, 0x0090, 0x10, 3, 1),
3848b483bdaSGuodong Liu PIN_FIELD_BASE(154, 154, 4, 0x0090, 0x10, 3, 1),
3858b483bdaSGuodong Liu PIN_FIELD_BASE(155, 155, 4, 0x0090, 0x10, 3, 1),
3868b483bdaSGuodong Liu PIN_FIELD_BASE(156, 156, 4, 0x0090, 0x10, 4, 1),
3878b483bdaSGuodong Liu PIN_FIELD_BASE(157, 157, 2, 0x0090, 0x10, 0, 1),
3888b483bdaSGuodong Liu PIN_FIELD_BASE(158, 158, 2, 0x0090, 0x10, 0, 1),
3898b483bdaSGuodong Liu PIN_FIELD_BASE(159, 159, 2, 0x0090, 0x10, 0, 1),
3908b483bdaSGuodong Liu PIN_FIELD_BASE(160, 160, 2, 0x0090, 0x10, 0, 1),
3918b483bdaSGuodong Liu PIN_FIELD_BASE(161, 161, 2, 0x0090, 0x10, 2, 1),
3928b483bdaSGuodong Liu PIN_FIELD_BASE(162, 162, 2, 0x0090, 0x10, 1, 1),
3938b483bdaSGuodong Liu PIN_FIELD_BASE(163, 163, 1, 0x00f0, 0x10, 14, 1),
3948b483bdaSGuodong Liu PIN_FIELD_BASE(164, 164, 1, 0x00f0, 0x10, 12, 1),
3958b483bdaSGuodong Liu PIN_FIELD_BASE(165, 165, 1, 0x00f0, 0x10, 12, 1),
3968b483bdaSGuodong Liu PIN_FIELD_BASE(166, 166, 1, 0x00f0, 0x10, 13, 1),
3978b483bdaSGuodong Liu PIN_FIELD_BASE(167, 167, 1, 0x00f0, 0x10, 13, 1),
3988b483bdaSGuodong Liu PIN_FIELD_BASE(168, 168, 1, 0x00f0, 0x10, 12, 1),
3998b483bdaSGuodong Liu PIN_FIELD_BASE(169, 169, 1, 0x00f0, 0x10, 14, 1),
4008b483bdaSGuodong Liu PIN_FIELD_BASE(170, 170, 1, 0x00f0, 0x10, 13, 1),
4018b483bdaSGuodong Liu PIN_FIELD_BASE(171, 171, 1, 0x00f0, 0x10, 13, 1),
4028b483bdaSGuodong Liu PIN_FIELD_BASE(172, 172, 1, 0x00f0, 0x10, 14, 1),
4038b483bdaSGuodong Liu PIN_FIELD_BASE(173, 173, 1, 0x00f0, 0x10, 12, 1),
4048b483bdaSGuodong Liu PIN_FIELD_BASE(174, 174, 6, 0x0080, 0x10, 3, 1),
4058b483bdaSGuodong Liu PIN_FIELD_BASE(175, 175, 6, 0x0080, 0x10, 3, 1),
4068b483bdaSGuodong Liu PIN_FIELD_BASE(176, 176, 6, 0x0080, 0x10, 4, 1),
4078b483bdaSGuodong Liu PIN_FIELD_BASE(177, 177, 6, 0x0080, 0x10, 4, 1),
4088b483bdaSGuodong Liu PIN_FIELD_BASE(178, 178, 6, 0x0080, 0x10, 3, 1),
4098b483bdaSGuodong Liu PIN_FIELD_BASE(179, 179, 6, 0x0080, 0x10, 3, 1),
4108b483bdaSGuodong Liu PIN_FIELD_BASE(180, 180, 6, 0x0080, 0x10, 4, 1),
4118b483bdaSGuodong Liu PIN_FIELD_BASE(181, 181, 6, 0x0080, 0x10, 4, 1),
4128b483bdaSGuodong Liu PIN_FIELD_BASE(182, 182, 6, 0x0080, 0x10, 5, 1),
4138b483bdaSGuodong Liu PIN_FIELD_BASE(183, 183, 2, 0x0090, 0x10, 9, 1),
4148b483bdaSGuodong Liu PIN_FIELD_BASE(184, 184, 2, 0x0090, 0x10, 10, 1),
4158b483bdaSGuodong Liu };
4168b483bdaSGuodong Liu
4178b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_pu_range[] = {
4188b483bdaSGuodong Liu PIN_FIELD_BASE(0, 0, 6, 0x0050, 0x10, 13, 1),
4198b483bdaSGuodong Liu PIN_FIELD_BASE(1, 1, 6, 0x0050, 0x10, 14, 1),
4208b483bdaSGuodong Liu PIN_FIELD_BASE(2, 2, 6, 0x0050, 0x10, 17, 1),
4218b483bdaSGuodong Liu PIN_FIELD_BASE(3, 3, 6, 0x0050, 0x10, 18, 1),
4228b483bdaSGuodong Liu PIN_FIELD_BASE(4, 4, 6, 0x0050, 0x10, 19, 1),
4238b483bdaSGuodong Liu PIN_FIELD_BASE(5, 5, 6, 0x0050, 0x10, 20, 1),
4248b483bdaSGuodong Liu PIN_FIELD_BASE(6, 6, 4, 0x0060, 0x10, 19, 1),
4258b483bdaSGuodong Liu PIN_FIELD_BASE(7, 7, 4, 0x0060, 0x10, 20, 1),
4268b483bdaSGuodong Liu PIN_FIELD_BASE(8, 8, 4, 0x0060, 0x10, 21, 1),
4278b483bdaSGuodong Liu PIN_FIELD_BASE(9, 9, 4, 0x0060, 0x10, 22, 1),
4288b483bdaSGuodong Liu PIN_FIELD_BASE(10, 10, 4, 0x0060, 0x10, 16, 1),
4298b483bdaSGuodong Liu PIN_FIELD_BASE(11, 11, 4, 0x0060, 0x10, 17, 1),
4308b483bdaSGuodong Liu PIN_FIELD_BASE(12, 12, 4, 0x0060, 0x10, 18, 1),
4318b483bdaSGuodong Liu PIN_FIELD_BASE(13, 13, 3, 0x0080, 0x10, 0, 1),
4328b483bdaSGuodong Liu PIN_FIELD_BASE(14, 14, 3, 0x0080, 0x10, 1, 1),
4338b483bdaSGuodong Liu PIN_FIELD_BASE(15, 15, 6, 0x0050, 0x10, 15, 1),
4348b483bdaSGuodong Liu PIN_FIELD_BASE(16, 16, 6, 0x0050, 0x10, 16, 1),
4358b483bdaSGuodong Liu PIN_FIELD_BASE(17, 17, 5, 0x0090, 0x10, 9, 1),
4368b483bdaSGuodong Liu PIN_FIELD_BASE(18, 18, 5, 0x0090, 0x10, 10, 1),
4378b483bdaSGuodong Liu PIN_FIELD_BASE(19, 19, 5, 0x0090, 0x10, 3, 1),
4388b483bdaSGuodong Liu PIN_FIELD_BASE(20, 20, 5, 0x0090, 0x10, 6, 1),
4398b483bdaSGuodong Liu PIN_FIELD_BASE(21, 21, 5, 0x0090, 0x10, 4, 1),
4408b483bdaSGuodong Liu PIN_FIELD_BASE(22, 22, 5, 0x0090, 0x10, 7, 1),
4418b483bdaSGuodong Liu PIN_FIELD_BASE(23, 23, 5, 0x0090, 0x10, 5, 1),
4428b483bdaSGuodong Liu PIN_FIELD_BASE(24, 24, 5, 0x0090, 0x10, 8, 1),
4438b483bdaSGuodong Liu PIN_FIELD_BASE(25, 25, 5, 0x0090, 0x10, 18, 1),
4448b483bdaSGuodong Liu PIN_FIELD_BASE(26, 26, 5, 0x0090, 0x10, 15, 1),
4458b483bdaSGuodong Liu PIN_FIELD_BASE(27, 27, 5, 0x0090, 0x10, 17, 1),
4468b483bdaSGuodong Liu PIN_FIELD_BASE(28, 28, 5, 0x0090, 0x10, 16, 1),
4478b483bdaSGuodong Liu PIN_FIELD_BASE(29, 29, 6, 0x0050, 0x10, 0, 1),
4488b483bdaSGuodong Liu PIN_FIELD_BASE(30, 30, 6, 0x0050, 0x10, 1, 1),
4498b483bdaSGuodong Liu PIN_FIELD_BASE(31, 31, 6, 0x0050, 0x10, 2, 1),
4508b483bdaSGuodong Liu PIN_FIELD_BASE(32, 32, 2, 0x0060, 0x10, 25, 1),
4518b483bdaSGuodong Liu PIN_FIELD_BASE(33, 33, 2, 0x0060, 0x10, 27, 1),
4528b483bdaSGuodong Liu PIN_FIELD_BASE(34, 34, 2, 0x0060, 0x10, 26, 1),
4538b483bdaSGuodong Liu PIN_FIELD_BASE(35, 35, 2, 0x0060, 0x10, 28, 1),
4548b483bdaSGuodong Liu PIN_FIELD_BASE(36, 36, 2, 0x0060, 0x10, 9, 1),
4558b483bdaSGuodong Liu PIN_FIELD_BASE(37, 37, 2, 0x0060, 0x10, 10, 1),
4568b483bdaSGuodong Liu PIN_FIELD_BASE(38, 38, 2, 0x0060, 0x10, 12, 1),
4578b483bdaSGuodong Liu PIN_FIELD_BASE(39, 39, 2, 0x0060, 0x10, 11, 1),
4588b483bdaSGuodong Liu PIN_FIELD_BASE(40, 40, 2, 0x0060, 0x10, 13, 1),
4598b483bdaSGuodong Liu PIN_FIELD_BASE(41, 41, 2, 0x0060, 0x10, 14, 1),
4608b483bdaSGuodong Liu PIN_FIELD_BASE(42, 42, 2, 0x0060, 0x10, 16, 1),
4618b483bdaSGuodong Liu PIN_FIELD_BASE(43, 43, 2, 0x0060, 0x10, 15, 1),
4628b483bdaSGuodong Liu PIN_FIELD_BASE(44, 44, 5, 0x0090, 0x10, 28, 1),
4638b483bdaSGuodong Liu PIN_FIELD_BASE(45, 45, 5, 0x0090, 0x10, 29, 1),
4648b483bdaSGuodong Liu PIN_FIELD_BASE(46, 46, 5, 0x0090, 0x10, 31, 1),
4658b483bdaSGuodong Liu PIN_FIELD_BASE(47, 47, 5, 0x0090, 0x10, 30, 1),
4668b483bdaSGuodong Liu PIN_FIELD_BASE(48, 48, 2, 0x0060, 0x10, 17, 1),
4678b483bdaSGuodong Liu PIN_FIELD_BASE(49, 49, 2, 0x0060, 0x10, 18, 1),
4688b483bdaSGuodong Liu PIN_FIELD_BASE(50, 50, 2, 0x0060, 0x10, 20, 1),
4698b483bdaSGuodong Liu PIN_FIELD_BASE(51, 51, 2, 0x0060, 0x10, 19, 1),
4708b483bdaSGuodong Liu PIN_FIELD_BASE(52, 52, 3, 0x0080, 0x10, 12, 1),
4718b483bdaSGuodong Liu PIN_FIELD_BASE(53, 53, 3, 0x0080, 0x10, 13, 1),
4728b483bdaSGuodong Liu PIN_FIELD_BASE(54, 54, 3, 0x0080, 0x10, 15, 1),
4738b483bdaSGuodong Liu PIN_FIELD_BASE(55, 55, 3, 0x0080, 0x10, 14, 1),
4748b483bdaSGuodong Liu PIN_FIELD_BASE(56, 56, 5, 0x0090, 0x10, 12, 1),
4758b483bdaSGuodong Liu PIN_FIELD_BASE(57, 57, 5, 0x0090, 0x10, 11, 1),
4768b483bdaSGuodong Liu PIN_FIELD_BASE(58, 58, 5, 0x0090, 0x10, 13, 1),
4778b483bdaSGuodong Liu PIN_FIELD_BASE(59, 59, 5, 0x0090, 0x10, 14, 1),
4788b483bdaSGuodong Liu PIN_FIELD_BASE(60, 60, 3, 0x0080, 0x10, 21, 1),
4798b483bdaSGuodong Liu PIN_FIELD_BASE(61, 61, 3, 0x0080, 0x10, 16, 1),
4808b483bdaSGuodong Liu PIN_FIELD_BASE(62, 62, 3, 0x0080, 0x10, 22, 1),
4818b483bdaSGuodong Liu PIN_FIELD_BASE(63, 63, 3, 0x0080, 0x10, 17, 1),
4828b483bdaSGuodong Liu PIN_FIELD_BASE(64, 64, 3, 0x0080, 0x10, 18, 1),
4838b483bdaSGuodong Liu PIN_FIELD_BASE(65, 65, 3, 0x0080, 0x10, 19, 1),
4848b483bdaSGuodong Liu PIN_FIELD_BASE(66, 66, 3, 0x0080, 0x10, 20, 1),
4858b483bdaSGuodong Liu PIN_FIELD_BASE(83, 83, 6, 0x0050, 0x10, 3, 1),
4868b483bdaSGuodong Liu PIN_FIELD_BASE(90, 90, 3, 0x0080, 0x10, 2, 1),
4878b483bdaSGuodong Liu PIN_FIELD_BASE(91, 91, 3, 0x0080, 0x10, 23, 1),
4888b483bdaSGuodong Liu PIN_FIELD_BASE(92, 92, 3, 0x0080, 0x10, 25, 1),
4898b483bdaSGuodong Liu PIN_FIELD_BASE(93, 93, 3, 0x0080, 0x10, 3, 1),
4908b483bdaSGuodong Liu PIN_FIELD_BASE(94, 94, 3, 0x0080, 0x10, 24, 1),
4918b483bdaSGuodong Liu PIN_FIELD_BASE(95, 95, 3, 0x0080, 0x10, 26, 1),
4928b483bdaSGuodong Liu PIN_FIELD_BASE(96, 96, 2, 0x0060, 0x10, 1, 1),
4938b483bdaSGuodong Liu PIN_FIELD_BASE(97, 97, 2, 0x0060, 0x10, 0, 1),
4948b483bdaSGuodong Liu PIN_FIELD_BASE(98, 98, 2, 0x0060, 0x10, 2, 1),
4958b483bdaSGuodong Liu PIN_FIELD_BASE(99, 99, 4, 0x0060, 0x10, 14, 1),
4968b483bdaSGuodong Liu PIN_FIELD_BASE(100, 100, 4, 0x0060, 0x10, 15, 1),
4978b483bdaSGuodong Liu PIN_FIELD_BASE(101, 101, 4, 0x0060, 0x10, 13, 1),
4988b483bdaSGuodong Liu PIN_FIELD_BASE(102, 102, 4, 0x0060, 0x10, 12, 1),
4998b483bdaSGuodong Liu PIN_FIELD_BASE(103, 103, 4, 0x0060, 0x10, 0, 1),
5008b483bdaSGuodong Liu PIN_FIELD_BASE(104, 104, 4, 0x0060, 0x10, 1, 1),
5018b483bdaSGuodong Liu PIN_FIELD_BASE(105, 105, 4, 0x0060, 0x10, 4, 1),
5028b483bdaSGuodong Liu PIN_FIELD_BASE(106, 106, 4, 0x0060, 0x10, 5, 1),
5038b483bdaSGuodong Liu PIN_FIELD_BASE(107, 107, 4, 0x0060, 0x10, 6, 1),
5048b483bdaSGuodong Liu PIN_FIELD_BASE(108, 108, 4, 0x0060, 0x10, 7, 1),
5058b483bdaSGuodong Liu PIN_FIELD_BASE(109, 109, 4, 0x0060, 0x10, 8, 1),
5068b483bdaSGuodong Liu PIN_FIELD_BASE(110, 110, 4, 0x0060, 0x10, 9, 1),
5078b483bdaSGuodong Liu PIN_FIELD_BASE(111, 111, 4, 0x0060, 0x10, 10, 1),
5088b483bdaSGuodong Liu PIN_FIELD_BASE(112, 112, 4, 0x0060, 0x10, 11, 1),
5098b483bdaSGuodong Liu PIN_FIELD_BASE(113, 113, 4, 0x0060, 0x10, 2, 1),
5108b483bdaSGuodong Liu PIN_FIELD_BASE(114, 114, 4, 0x0060, 0x10, 3, 1),
5118b483bdaSGuodong Liu PIN_FIELD_BASE(115, 115, 3, 0x0080, 0x10, 4, 1),
5128b483bdaSGuodong Liu PIN_FIELD_BASE(116, 116, 3, 0x0080, 0x10, 7, 1),
5138b483bdaSGuodong Liu PIN_FIELD_BASE(117, 117, 3, 0x0080, 0x10, 5, 1),
5148b483bdaSGuodong Liu PIN_FIELD_BASE(118, 118, 3, 0x0080, 0x10, 6, 1),
5158b483bdaSGuodong Liu PIN_FIELD_BASE(119, 119, 5, 0x0090, 0x10, 22, 1),
5168b483bdaSGuodong Liu PIN_FIELD_BASE(120, 120, 5, 0x0090, 0x10, 19, 1),
5178b483bdaSGuodong Liu PIN_FIELD_BASE(121, 121, 5, 0x0090, 0x10, 20, 1),
5188b483bdaSGuodong Liu PIN_FIELD_BASE(122, 122, 5, 0x0090, 0x10, 21, 1),
5198b483bdaSGuodong Liu PIN_FIELD_BASE(123, 123, 5, 0x0090, 0x10, 23, 1),
5208b483bdaSGuodong Liu PIN_FIELD_BASE(124, 124, 5, 0x0090, 0x10, 0, 1),
5218b483bdaSGuodong Liu PIN_FIELD_BASE(125, 125, 5, 0x0090, 0x10, 1, 1),
5228b483bdaSGuodong Liu PIN_FIELD_BASE(126, 126, 5, 0x0090, 0x10, 2, 1),
5238b483bdaSGuodong Liu PIN_FIELD_BASE(127, 127, 3, 0x0080, 0x10, 8, 1),
5248b483bdaSGuodong Liu PIN_FIELD_BASE(128, 128, 3, 0x0080, 0x10, 10, 1),
5258b483bdaSGuodong Liu PIN_FIELD_BASE(129, 129, 5, 0x0090, 0x10, 24, 1),
5268b483bdaSGuodong Liu PIN_FIELD_BASE(130, 130, 5, 0x0090, 0x10, 26, 1),
5278b483bdaSGuodong Liu PIN_FIELD_BASE(131, 131, 5, 0x0090, 0x10, 25, 1),
5288b483bdaSGuodong Liu PIN_FIELD_BASE(132, 132, 5, 0x0090, 0x10, 27, 1),
5298b483bdaSGuodong Liu PIN_FIELD_BASE(133, 133, 1, 0x0080, 0x10, 9, 1),
5308b483bdaSGuodong Liu PIN_FIELD_BASE(134, 134, 1, 0x0080, 0x10, 12, 1),
5318b483bdaSGuodong Liu PIN_FIELD_BASE(135, 135, 6, 0x0050, 0x10, 21, 1),
5328b483bdaSGuodong Liu PIN_FIELD_BASE(136, 136, 6, 0x0050, 0x10, 24, 1),
5338b483bdaSGuodong Liu PIN_FIELD_BASE(137, 137, 1, 0x0080, 0x10, 10, 1),
5348b483bdaSGuodong Liu PIN_FIELD_BASE(138, 138, 1, 0x0080, 0x10, 13, 1),
5358b483bdaSGuodong Liu PIN_FIELD_BASE(139, 139, 2, 0x0060, 0x10, 7, 1),
5368b483bdaSGuodong Liu PIN_FIELD_BASE(140, 140, 2, 0x0060, 0x10, 8, 1),
5378b483bdaSGuodong Liu PIN_FIELD_BASE(141, 141, 3, 0x0080, 0x10, 9, 1),
5388b483bdaSGuodong Liu PIN_FIELD_BASE(142, 142, 3, 0x0080, 0x10, 11, 1),
5398b483bdaSGuodong Liu PIN_FIELD_BASE(143, 143, 6, 0x0050, 0x10, 22, 1),
5408b483bdaSGuodong Liu PIN_FIELD_BASE(144, 144, 6, 0x0050, 0x10, 25, 1),
5418b483bdaSGuodong Liu PIN_FIELD_BASE(145, 145, 6, 0x0050, 0x10, 23, 1),
5428b483bdaSGuodong Liu PIN_FIELD_BASE(146, 146, 6, 0x0050, 0x10, 26, 1),
5438b483bdaSGuodong Liu PIN_FIELD_BASE(147, 147, 4, 0x0060, 0x10, 23, 1),
5448b483bdaSGuodong Liu PIN_FIELD_BASE(148, 148, 4, 0x0060, 0x10, 24, 1),
5458b483bdaSGuodong Liu PIN_FIELD_BASE(149, 149, 4, 0x0060, 0x10, 25, 1),
5468b483bdaSGuodong Liu PIN_FIELD_BASE(150, 150, 4, 0x0060, 0x10, 26, 1),
5478b483bdaSGuodong Liu PIN_FIELD_BASE(151, 151, 4, 0x0060, 0x10, 27, 1),
5488b483bdaSGuodong Liu PIN_FIELD_BASE(152, 152, 4, 0x0060, 0x10, 28, 1),
5498b483bdaSGuodong Liu PIN_FIELD_BASE(153, 153, 4, 0x0060, 0x10, 29, 1),
5508b483bdaSGuodong Liu PIN_FIELD_BASE(154, 154, 4, 0x0060, 0x10, 30, 1),
5518b483bdaSGuodong Liu PIN_FIELD_BASE(155, 155, 4, 0x0060, 0x10, 31, 1),
5528b483bdaSGuodong Liu PIN_FIELD_BASE(156, 156, 4, 0x0070, 0x10, 0, 1),
5538b483bdaSGuodong Liu PIN_FIELD_BASE(157, 157, 2, 0x0060, 0x10, 4, 1),
5548b483bdaSGuodong Liu PIN_FIELD_BASE(158, 158, 2, 0x0060, 0x10, 3, 1),
5558b483bdaSGuodong Liu PIN_FIELD_BASE(159, 159, 2, 0x0060, 0x10, 6, 1),
5568b483bdaSGuodong Liu PIN_FIELD_BASE(160, 160, 2, 0x0060, 0x10, 5, 1),
5578b483bdaSGuodong Liu PIN_FIELD_BASE(161, 161, 2, 0x0060, 0x10, 23, 1),
5588b483bdaSGuodong Liu PIN_FIELD_BASE(162, 162, 2, 0x0060, 0x10, 24, 1),
5598b483bdaSGuodong Liu PIN_FIELD_BASE(163, 163, 1, 0x0080, 0x10, 11, 1),
5608b483bdaSGuodong Liu PIN_FIELD_BASE(164, 164, 1, 0x0080, 0x10, 8, 1),
5618b483bdaSGuodong Liu PIN_FIELD_BASE(165, 165, 1, 0x0080, 0x10, 16, 1),
5628b483bdaSGuodong Liu PIN_FIELD_BASE(166, 166, 1, 0x0080, 0x10, 1, 1),
5638b483bdaSGuodong Liu PIN_FIELD_BASE(167, 167, 1, 0x0080, 0x10, 7, 1),
5648b483bdaSGuodong Liu PIN_FIELD_BASE(168, 168, 1, 0x0080, 0x10, 4, 1),
5658b483bdaSGuodong Liu PIN_FIELD_BASE(169, 169, 1, 0x0080, 0x10, 5, 1),
5668b483bdaSGuodong Liu PIN_FIELD_BASE(170, 170, 1, 0x0080, 0x10, 0, 1),
5678b483bdaSGuodong Liu PIN_FIELD_BASE(171, 171, 1, 0x0080, 0x10, 6, 1),
5688b483bdaSGuodong Liu PIN_FIELD_BASE(172, 172, 1, 0x0080, 0x10, 2, 1),
5698b483bdaSGuodong Liu PIN_FIELD_BASE(173, 173, 1, 0x0080, 0x10, 3, 1),
5708b483bdaSGuodong Liu PIN_FIELD_BASE(174, 174, 6, 0x0050, 0x10, 7, 1),
5718b483bdaSGuodong Liu PIN_FIELD_BASE(175, 175, 6, 0x0050, 0x10, 8, 1),
5728b483bdaSGuodong Liu PIN_FIELD_BASE(176, 176, 6, 0x0050, 0x10, 4, 1),
5738b483bdaSGuodong Liu PIN_FIELD_BASE(177, 177, 6, 0x0050, 0x10, 5, 1),
5748b483bdaSGuodong Liu PIN_FIELD_BASE(178, 178, 6, 0x0050, 0x10, 6, 1),
5758b483bdaSGuodong Liu PIN_FIELD_BASE(179, 179, 6, 0x0050, 0x10, 9, 1),
5768b483bdaSGuodong Liu PIN_FIELD_BASE(180, 180, 6, 0x0050, 0x10, 10, 1),
5778b483bdaSGuodong Liu PIN_FIELD_BASE(181, 181, 6, 0x0050, 0x10, 11, 1),
5788b483bdaSGuodong Liu PIN_FIELD_BASE(182, 182, 6, 0x0050, 0x10, 12, 1),
5798b483bdaSGuodong Liu PIN_FIELD_BASE(183, 183, 2, 0x0060, 0x10, 21, 1),
5808b483bdaSGuodong Liu PIN_FIELD_BASE(184, 184, 2, 0x0060, 0x10, 22, 1),
5818b483bdaSGuodong Liu };
5828b483bdaSGuodong Liu
5838b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_pd_range[] = {
5848b483bdaSGuodong Liu PIN_FIELD_BASE(0, 0, 6, 0x0040, 0x10, 13, 1),
5858b483bdaSGuodong Liu PIN_FIELD_BASE(1, 1, 6, 0x0040, 0x10, 14, 1),
5868b483bdaSGuodong Liu PIN_FIELD_BASE(2, 2, 6, 0x0040, 0x10, 17, 1),
5878b483bdaSGuodong Liu PIN_FIELD_BASE(3, 3, 6, 0x0040, 0x10, 18, 1),
5888b483bdaSGuodong Liu PIN_FIELD_BASE(4, 4, 6, 0x0040, 0x10, 19, 1),
5898b483bdaSGuodong Liu PIN_FIELD_BASE(5, 5, 6, 0x0040, 0x10, 20, 1),
5908b483bdaSGuodong Liu PIN_FIELD_BASE(6, 6, 4, 0x0040, 0x10, 19, 1),
5918b483bdaSGuodong Liu PIN_FIELD_BASE(7, 7, 4, 0x0040, 0x10, 20, 1),
5928b483bdaSGuodong Liu PIN_FIELD_BASE(8, 8, 4, 0x0040, 0x10, 21, 1),
5938b483bdaSGuodong Liu PIN_FIELD_BASE(9, 9, 4, 0x0040, 0x10, 22, 1),
5948b483bdaSGuodong Liu PIN_FIELD_BASE(10, 10, 4, 0x0040, 0x10, 16, 1),
5958b483bdaSGuodong Liu PIN_FIELD_BASE(11, 11, 4, 0x0040, 0x10, 17, 1),
5968b483bdaSGuodong Liu PIN_FIELD_BASE(12, 12, 4, 0x0040, 0x10, 18, 1),
5978b483bdaSGuodong Liu PIN_FIELD_BASE(13, 13, 3, 0x0060, 0x10, 0, 1),
5988b483bdaSGuodong Liu PIN_FIELD_BASE(14, 14, 3, 0x0060, 0x10, 1, 1),
5998b483bdaSGuodong Liu PIN_FIELD_BASE(15, 15, 6, 0x0040, 0x10, 15, 1),
6008b483bdaSGuodong Liu PIN_FIELD_BASE(16, 16, 6, 0x0040, 0x10, 16, 1),
6018b483bdaSGuodong Liu PIN_FIELD_BASE(17, 17, 5, 0x0070, 0x10, 9, 1),
6028b483bdaSGuodong Liu PIN_FIELD_BASE(18, 18, 5, 0x0070, 0x10, 10, 1),
6038b483bdaSGuodong Liu PIN_FIELD_BASE(19, 19, 5, 0x0070, 0x10, 3, 1),
6048b483bdaSGuodong Liu PIN_FIELD_BASE(20, 20, 5, 0x0070, 0x10, 6, 1),
6058b483bdaSGuodong Liu PIN_FIELD_BASE(21, 21, 5, 0x0070, 0x10, 4, 1),
6068b483bdaSGuodong Liu PIN_FIELD_BASE(22, 22, 5, 0x0070, 0x10, 7, 1),
6078b483bdaSGuodong Liu PIN_FIELD_BASE(23, 23, 5, 0x0070, 0x10, 5, 1),
6088b483bdaSGuodong Liu PIN_FIELD_BASE(24, 24, 5, 0x0070, 0x10, 8, 1),
6098b483bdaSGuodong Liu PIN_FIELD_BASE(25, 25, 5, 0x0070, 0x10, 18, 1),
6108b483bdaSGuodong Liu PIN_FIELD_BASE(26, 26, 5, 0x0070, 0x10, 15, 1),
6118b483bdaSGuodong Liu PIN_FIELD_BASE(27, 27, 5, 0x0070, 0x10, 17, 1),
6128b483bdaSGuodong Liu PIN_FIELD_BASE(28, 28, 5, 0x0070, 0x10, 16, 1),
6138b483bdaSGuodong Liu PIN_FIELD_BASE(29, 29, 6, 0x0040, 0x10, 0, 1),
6148b483bdaSGuodong Liu PIN_FIELD_BASE(30, 30, 6, 0x0040, 0x10, 1, 1),
6158b483bdaSGuodong Liu PIN_FIELD_BASE(31, 31, 6, 0x0040, 0x10, 2, 1),
6168b483bdaSGuodong Liu PIN_FIELD_BASE(32, 32, 2, 0x0050, 0x10, 25, 1),
6178b483bdaSGuodong Liu PIN_FIELD_BASE(33, 33, 2, 0x0050, 0x10, 27, 1),
6188b483bdaSGuodong Liu PIN_FIELD_BASE(34, 34, 2, 0x0050, 0x10, 26, 1),
6198b483bdaSGuodong Liu PIN_FIELD_BASE(35, 35, 2, 0x0050, 0x10, 28, 1),
6208b483bdaSGuodong Liu PIN_FIELD_BASE(36, 36, 2, 0x0050, 0x10, 9, 1),
6218b483bdaSGuodong Liu PIN_FIELD_BASE(37, 37, 2, 0x0050, 0x10, 10, 1),
6228b483bdaSGuodong Liu PIN_FIELD_BASE(38, 38, 2, 0x0050, 0x10, 12, 1),
6238b483bdaSGuodong Liu PIN_FIELD_BASE(39, 39, 2, 0x0050, 0x10, 11, 1),
6248b483bdaSGuodong Liu PIN_FIELD_BASE(40, 40, 2, 0x0050, 0x10, 13, 1),
6258b483bdaSGuodong Liu PIN_FIELD_BASE(41, 41, 2, 0x0050, 0x10, 14, 1),
6268b483bdaSGuodong Liu PIN_FIELD_BASE(42, 42, 2, 0x0050, 0x10, 16, 1),
6278b483bdaSGuodong Liu PIN_FIELD_BASE(43, 43, 2, 0x0050, 0x10, 15, 1),
6288b483bdaSGuodong Liu PIN_FIELD_BASE(44, 44, 5, 0x0070, 0x10, 28, 1),
6298b483bdaSGuodong Liu PIN_FIELD_BASE(45, 45, 5, 0x0070, 0x10, 29, 1),
6308b483bdaSGuodong Liu PIN_FIELD_BASE(46, 46, 5, 0x0070, 0x10, 31, 1),
6318b483bdaSGuodong Liu PIN_FIELD_BASE(47, 47, 5, 0x0070, 0x10, 30, 1),
6328b483bdaSGuodong Liu PIN_FIELD_BASE(48, 48, 2, 0x0050, 0x10, 17, 1),
6338b483bdaSGuodong Liu PIN_FIELD_BASE(49, 49, 2, 0x0050, 0x10, 18, 1),
6348b483bdaSGuodong Liu PIN_FIELD_BASE(50, 50, 2, 0x0050, 0x10, 20, 1),
6358b483bdaSGuodong Liu PIN_FIELD_BASE(51, 51, 2, 0x0050, 0x10, 19, 1),
6368b483bdaSGuodong Liu PIN_FIELD_BASE(52, 52, 3, 0x0060, 0x10, 12, 1),
6378b483bdaSGuodong Liu PIN_FIELD_BASE(53, 53, 3, 0x0060, 0x10, 13, 1),
6388b483bdaSGuodong Liu PIN_FIELD_BASE(54, 54, 3, 0x0060, 0x10, 15, 1),
6398b483bdaSGuodong Liu PIN_FIELD_BASE(55, 55, 3, 0x0060, 0x10, 14, 1),
6408b483bdaSGuodong Liu PIN_FIELD_BASE(56, 56, 5, 0x0070, 0x10, 12, 1),
6418b483bdaSGuodong Liu PIN_FIELD_BASE(57, 57, 5, 0x0070, 0x10, 11, 1),
6428b483bdaSGuodong Liu PIN_FIELD_BASE(58, 58, 5, 0x0070, 0x10, 13, 1),
6438b483bdaSGuodong Liu PIN_FIELD_BASE(59, 59, 5, 0x0070, 0x10, 14, 1),
6448b483bdaSGuodong Liu PIN_FIELD_BASE(60, 60, 3, 0x0060, 0x10, 21, 1),
6458b483bdaSGuodong Liu PIN_FIELD_BASE(61, 61, 3, 0x0060, 0x10, 16, 1),
6468b483bdaSGuodong Liu PIN_FIELD_BASE(62, 62, 3, 0x0060, 0x10, 22, 1),
6478b483bdaSGuodong Liu PIN_FIELD_BASE(63, 63, 3, 0x0060, 0x10, 17, 1),
6488b483bdaSGuodong Liu PIN_FIELD_BASE(64, 64, 3, 0x0060, 0x10, 18, 1),
6498b483bdaSGuodong Liu PIN_FIELD_BASE(65, 65, 3, 0x0060, 0x10, 19, 1),
6508b483bdaSGuodong Liu PIN_FIELD_BASE(66, 66, 3, 0x0060, 0x10, 20, 1),
6518b483bdaSGuodong Liu PIN_FIELD_BASE(83, 83, 6, 0x0040, 0x10, 3, 1),
6528b483bdaSGuodong Liu PIN_FIELD_BASE(90, 90, 3, 0x0060, 0x10, 2, 1),
6538b483bdaSGuodong Liu PIN_FIELD_BASE(91, 91, 3, 0x0060, 0x10, 23, 1),
6548b483bdaSGuodong Liu PIN_FIELD_BASE(92, 92, 3, 0x0060, 0x10, 25, 1),
6558b483bdaSGuodong Liu PIN_FIELD_BASE(93, 93, 3, 0x0060, 0x10, 3, 1),
6568b483bdaSGuodong Liu PIN_FIELD_BASE(94, 94, 3, 0x0060, 0x10, 24, 1),
6578b483bdaSGuodong Liu PIN_FIELD_BASE(95, 95, 3, 0x0060, 0x10, 26, 1),
6588b483bdaSGuodong Liu PIN_FIELD_BASE(96, 96, 2, 0x0050, 0x10, 1, 1),
6598b483bdaSGuodong Liu PIN_FIELD_BASE(97, 97, 2, 0x0050, 0x10, 0, 1),
6608b483bdaSGuodong Liu PIN_FIELD_BASE(98, 98, 2, 0x0050, 0x10, 2, 1),
6618b483bdaSGuodong Liu PIN_FIELD_BASE(99, 99, 4, 0x0040, 0x10, 14, 1),
6628b483bdaSGuodong Liu PIN_FIELD_BASE(100, 100, 4, 0x0040, 0x10, 15, 1),
6638b483bdaSGuodong Liu PIN_FIELD_BASE(101, 101, 4, 0x0040, 0x10, 13, 1),
6648b483bdaSGuodong Liu PIN_FIELD_BASE(102, 102, 4, 0x0040, 0x10, 12, 1),
6658b483bdaSGuodong Liu PIN_FIELD_BASE(103, 103, 4, 0x0040, 0x10, 0, 1),
6668b483bdaSGuodong Liu PIN_FIELD_BASE(104, 104, 4, 0x0040, 0x10, 1, 1),
6678b483bdaSGuodong Liu PIN_FIELD_BASE(105, 105, 4, 0x0040, 0x10, 4, 1),
6688b483bdaSGuodong Liu PIN_FIELD_BASE(106, 106, 4, 0x0040, 0x10, 5, 1),
6698b483bdaSGuodong Liu PIN_FIELD_BASE(107, 107, 4, 0x0040, 0x10, 6, 1),
6708b483bdaSGuodong Liu PIN_FIELD_BASE(108, 108, 4, 0x0040, 0x10, 7, 1),
6718b483bdaSGuodong Liu PIN_FIELD_BASE(109, 109, 4, 0x0040, 0x10, 8, 1),
6728b483bdaSGuodong Liu PIN_FIELD_BASE(110, 110, 4, 0x0040, 0x10, 9, 1),
6738b483bdaSGuodong Liu PIN_FIELD_BASE(111, 111, 4, 0x0040, 0x10, 10, 1),
6748b483bdaSGuodong Liu PIN_FIELD_BASE(112, 112, 4, 0x0040, 0x10, 11, 1),
6758b483bdaSGuodong Liu PIN_FIELD_BASE(113, 113, 4, 0x0040, 0x10, 2, 1),
6768b483bdaSGuodong Liu PIN_FIELD_BASE(114, 114, 4, 0x0040, 0x10, 3, 1),
6778b483bdaSGuodong Liu PIN_FIELD_BASE(115, 115, 3, 0x0060, 0x10, 4, 1),
6788b483bdaSGuodong Liu PIN_FIELD_BASE(116, 116, 3, 0x0060, 0x10, 7, 1),
6798b483bdaSGuodong Liu PIN_FIELD_BASE(117, 117, 3, 0x0060, 0x10, 5, 1),
6808b483bdaSGuodong Liu PIN_FIELD_BASE(118, 118, 3, 0x0060, 0x10, 6, 1),
6818b483bdaSGuodong Liu PIN_FIELD_BASE(119, 119, 5, 0x0070, 0x10, 22, 1),
6828b483bdaSGuodong Liu PIN_FIELD_BASE(120, 120, 5, 0x0070, 0x10, 19, 1),
6838b483bdaSGuodong Liu PIN_FIELD_BASE(121, 121, 5, 0x0070, 0x10, 20, 1),
6848b483bdaSGuodong Liu PIN_FIELD_BASE(122, 122, 5, 0x0070, 0x10, 21, 1),
6858b483bdaSGuodong Liu PIN_FIELD_BASE(123, 123, 5, 0x0070, 0x10, 23, 1),
6868b483bdaSGuodong Liu PIN_FIELD_BASE(124, 124, 5, 0x0070, 0x10, 0, 1),
6878b483bdaSGuodong Liu PIN_FIELD_BASE(125, 125, 5, 0x0070, 0x10, 1, 1),
6888b483bdaSGuodong Liu PIN_FIELD_BASE(126, 126, 5, 0x0070, 0x10, 2, 1),
6898b483bdaSGuodong Liu PIN_FIELD_BASE(127, 127, 3, 0x0060, 0x10, 8, 1),
6908b483bdaSGuodong Liu PIN_FIELD_BASE(128, 128, 3, 0x0060, 0x10, 10, 1),
6918b483bdaSGuodong Liu PIN_FIELD_BASE(129, 129, 5, 0x0070, 0x10, 24, 1),
6928b483bdaSGuodong Liu PIN_FIELD_BASE(130, 130, 5, 0x0070, 0x10, 26, 1),
6938b483bdaSGuodong Liu PIN_FIELD_BASE(131, 131, 5, 0x0070, 0x10, 25, 1),
6948b483bdaSGuodong Liu PIN_FIELD_BASE(132, 132, 5, 0x0070, 0x10, 27, 1),
6958b483bdaSGuodong Liu PIN_FIELD_BASE(133, 133, 1, 0x0060, 0x10, 9, 1),
6968b483bdaSGuodong Liu PIN_FIELD_BASE(134, 134, 1, 0x0060, 0x10, 12, 1),
6978b483bdaSGuodong Liu PIN_FIELD_BASE(135, 135, 6, 0x0040, 0x10, 21, 1),
6988b483bdaSGuodong Liu PIN_FIELD_BASE(136, 136, 6, 0x0040, 0x10, 24, 1),
6998b483bdaSGuodong Liu PIN_FIELD_BASE(137, 137, 1, 0x0060, 0x10, 10, 1),
7008b483bdaSGuodong Liu PIN_FIELD_BASE(138, 138, 1, 0x0060, 0x10, 13, 1),
7018b483bdaSGuodong Liu PIN_FIELD_BASE(139, 139, 2, 0x0050, 0x10, 7, 1),
7028b483bdaSGuodong Liu PIN_FIELD_BASE(140, 140, 2, 0x0050, 0x10, 8, 1),
7038b483bdaSGuodong Liu PIN_FIELD_BASE(141, 141, 3, 0x0060, 0x10, 9, 1),
7048b483bdaSGuodong Liu PIN_FIELD_BASE(142, 142, 3, 0x0060, 0x10, 11, 1),
7058b483bdaSGuodong Liu PIN_FIELD_BASE(143, 143, 6, 0x0040, 0x10, 22, 1),
7068b483bdaSGuodong Liu PIN_FIELD_BASE(144, 144, 6, 0x0040, 0x10, 25, 1),
7078b483bdaSGuodong Liu PIN_FIELD_BASE(145, 145, 6, 0x0040, 0x10, 23, 1),
7088b483bdaSGuodong Liu PIN_FIELD_BASE(146, 146, 6, 0x0040, 0x10, 26, 1),
7098b483bdaSGuodong Liu PIN_FIELD_BASE(147, 147, 4, 0x0040, 0x10, 23, 1),
7108b483bdaSGuodong Liu PIN_FIELD_BASE(148, 148, 4, 0x0040, 0x10, 24, 1),
7118b483bdaSGuodong Liu PIN_FIELD_BASE(149, 149, 4, 0x0040, 0x10, 25, 1),
7128b483bdaSGuodong Liu PIN_FIELD_BASE(150, 150, 4, 0x0040, 0x10, 26, 1),
7138b483bdaSGuodong Liu PIN_FIELD_BASE(151, 151, 4, 0x0040, 0x10, 27, 1),
7148b483bdaSGuodong Liu PIN_FIELD_BASE(152, 152, 4, 0x0040, 0x10, 28, 1),
7158b483bdaSGuodong Liu PIN_FIELD_BASE(153, 153, 4, 0x0040, 0x10, 29, 1),
7168b483bdaSGuodong Liu PIN_FIELD_BASE(154, 154, 4, 0x0040, 0x10, 30, 1),
7178b483bdaSGuodong Liu PIN_FIELD_BASE(155, 155, 4, 0x0040, 0x10, 31, 1),
7188b483bdaSGuodong Liu PIN_FIELD_BASE(156, 156, 4, 0x0050, 0x10, 0, 1),
7198b483bdaSGuodong Liu PIN_FIELD_BASE(157, 157, 2, 0x0050, 0x10, 4, 1),
7208b483bdaSGuodong Liu PIN_FIELD_BASE(158, 158, 2, 0x0050, 0x10, 3, 1),
7218b483bdaSGuodong Liu PIN_FIELD_BASE(159, 159, 2, 0x0050, 0x10, 6, 1),
7228b483bdaSGuodong Liu PIN_FIELD_BASE(160, 160, 2, 0x0050, 0x10, 5, 1),
7238b483bdaSGuodong Liu PIN_FIELD_BASE(161, 161, 2, 0x0050, 0x10, 23, 1),
7248b483bdaSGuodong Liu PIN_FIELD_BASE(162, 162, 2, 0x0050, 0x10, 24, 1),
7258b483bdaSGuodong Liu PIN_FIELD_BASE(163, 163, 1, 0x0060, 0x10, 11, 1),
7268b483bdaSGuodong Liu PIN_FIELD_BASE(164, 164, 1, 0x0060, 0x10, 8, 1),
7278b483bdaSGuodong Liu PIN_FIELD_BASE(165, 165, 1, 0x0060, 0x10, 16, 1),
7288b483bdaSGuodong Liu PIN_FIELD_BASE(166, 166, 1, 0x0060, 0x10, 1, 1),
7298b483bdaSGuodong Liu PIN_FIELD_BASE(167, 167, 1, 0x0060, 0x10, 7, 1),
7308b483bdaSGuodong Liu PIN_FIELD_BASE(168, 168, 1, 0x0060, 0x10, 4, 1),
7318b483bdaSGuodong Liu PIN_FIELD_BASE(169, 169, 1, 0x0060, 0x10, 5, 1),
7328b483bdaSGuodong Liu PIN_FIELD_BASE(170, 170, 1, 0x0060, 0x10, 0, 1),
7338b483bdaSGuodong Liu PIN_FIELD_BASE(171, 171, 1, 0x0060, 0x10, 6, 1),
7348b483bdaSGuodong Liu PIN_FIELD_BASE(172, 172, 1, 0x0060, 0x10, 2, 1),
7358b483bdaSGuodong Liu PIN_FIELD_BASE(173, 173, 1, 0x0060, 0x10, 3, 1),
7368b483bdaSGuodong Liu PIN_FIELD_BASE(174, 174, 6, 0x0040, 0x10, 7, 1),
7378b483bdaSGuodong Liu PIN_FIELD_BASE(175, 175, 6, 0x0040, 0x10, 8, 1),
7388b483bdaSGuodong Liu PIN_FIELD_BASE(176, 176, 6, 0x0040, 0x10, 4, 1),
7398b483bdaSGuodong Liu PIN_FIELD_BASE(177, 177, 6, 0x0040, 0x10, 5, 1),
7408b483bdaSGuodong Liu PIN_FIELD_BASE(178, 178, 6, 0x0040, 0x10, 6, 1),
7418b483bdaSGuodong Liu PIN_FIELD_BASE(179, 179, 6, 0x0040, 0x10, 9, 1),
7428b483bdaSGuodong Liu PIN_FIELD_BASE(180, 180, 6, 0x0040, 0x10, 10, 1),
7438b483bdaSGuodong Liu PIN_FIELD_BASE(181, 181, 6, 0x0040, 0x10, 11, 1),
7448b483bdaSGuodong Liu PIN_FIELD_BASE(182, 182, 6, 0x0040, 0x10, 12, 1),
7458b483bdaSGuodong Liu PIN_FIELD_BASE(183, 183, 2, 0x0050, 0x10, 21, 1),
7468b483bdaSGuodong Liu PIN_FIELD_BASE(184, 184, 2, 0x0050, 0x10, 22, 1),
7478b483bdaSGuodong Liu };
7488b483bdaSGuodong Liu
7498b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_pupd_range[] = {
7508b483bdaSGuodong Liu PIN_FIELD_BASE(67, 67, 1, 0x0070, 0x10, 10, 1),
7518b483bdaSGuodong Liu PIN_FIELD_BASE(68, 68, 1, 0x0070, 0x10, 0, 1),
7528b483bdaSGuodong Liu PIN_FIELD_BASE(69, 69, 1, 0x0070, 0x10, 1, 1),
7538b483bdaSGuodong Liu PIN_FIELD_BASE(70, 70, 1, 0x0070, 0x10, 11, 1),
7548b483bdaSGuodong Liu PIN_FIELD_BASE(71, 71, 1, 0x0070, 0x10, 2, 1),
7558b483bdaSGuodong Liu PIN_FIELD_BASE(72, 72, 1, 0x0070, 0x10, 3, 1),
7568b483bdaSGuodong Liu PIN_FIELD_BASE(73, 73, 1, 0x0070, 0x10, 4, 1),
7578b483bdaSGuodong Liu PIN_FIELD_BASE(74, 74, 1, 0x0070, 0x10, 5, 1),
7588b483bdaSGuodong Liu PIN_FIELD_BASE(75, 75, 1, 0x0070, 0x10, 6, 1),
7598b483bdaSGuodong Liu PIN_FIELD_BASE(76, 76, 1, 0x0070, 0x10, 7, 1),
7608b483bdaSGuodong Liu PIN_FIELD_BASE(77, 77, 1, 0x0070, 0x10, 8, 1),
7618b483bdaSGuodong Liu PIN_FIELD_BASE(78, 78, 1, 0x0070, 0x10, 9, 1),
7628b483bdaSGuodong Liu PIN_FIELD_BASE(79, 79, 5, 0x0080, 0x10, 0, 1),
7638b483bdaSGuodong Liu PIN_FIELD_BASE(80, 80, 5, 0x0080, 0x10, 1, 1),
7648b483bdaSGuodong Liu PIN_FIELD_BASE(81, 81, 5, 0x0080, 0x10, 2, 1),
7658b483bdaSGuodong Liu PIN_FIELD_BASE(82, 82, 5, 0x0080, 0x10, 3, 1),
7668b483bdaSGuodong Liu PIN_FIELD_BASE(84, 84, 3, 0x0070, 0x10, 0, 1),
7678b483bdaSGuodong Liu PIN_FIELD_BASE(85, 85, 3, 0x0070, 0x10, 1, 1),
7688b483bdaSGuodong Liu PIN_FIELD_BASE(86, 86, 3, 0x0070, 0x10, 2, 1),
7698b483bdaSGuodong Liu PIN_FIELD_BASE(87, 87, 3, 0x0070, 0x10, 3, 1),
7708b483bdaSGuodong Liu PIN_FIELD_BASE(88, 88, 3, 0x0070, 0x10, 4, 1),
7718b483bdaSGuodong Liu PIN_FIELD_BASE(89, 89, 3, 0x0070, 0x10, 5, 1),
7728b483bdaSGuodong Liu };
7738b483bdaSGuodong Liu
7748b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_r0_range[] = {
7758b483bdaSGuodong Liu PIN_FIELD_BASE(67, 67, 1, 0x0090, 0x10, 10, 1),
7768b483bdaSGuodong Liu PIN_FIELD_BASE(68, 68, 1, 0x0090, 0x10, 0, 1),
7778b483bdaSGuodong Liu PIN_FIELD_BASE(69, 69, 1, 0x0090, 0x10, 1, 1),
7788b483bdaSGuodong Liu PIN_FIELD_BASE(70, 70, 1, 0x0090, 0x10, 11, 1),
7798b483bdaSGuodong Liu PIN_FIELD_BASE(71, 71, 1, 0x0090, 0x10, 2, 1),
7808b483bdaSGuodong Liu PIN_FIELD_BASE(72, 72, 1, 0x0090, 0x10, 3, 1),
7818b483bdaSGuodong Liu PIN_FIELD_BASE(73, 73, 1, 0x0090, 0x10, 4, 1),
7828b483bdaSGuodong Liu PIN_FIELD_BASE(74, 74, 1, 0x0090, 0x10, 5, 1),
7838b483bdaSGuodong Liu PIN_FIELD_BASE(75, 75, 1, 0x0090, 0x10, 6, 1),
7848b483bdaSGuodong Liu PIN_FIELD_BASE(76, 76, 1, 0x0090, 0x10, 7, 1),
7858b483bdaSGuodong Liu PIN_FIELD_BASE(77, 77, 1, 0x0090, 0x10, 8, 1),
7868b483bdaSGuodong Liu PIN_FIELD_BASE(78, 78, 1, 0x0090, 0x10, 9, 1),
7878b483bdaSGuodong Liu PIN_FIELD_BASE(79, 79, 5, 0x00a0, 0x10, 0, 1),
7888b483bdaSGuodong Liu PIN_FIELD_BASE(80, 80, 5, 0x00a0, 0x10, 1, 1),
7898b483bdaSGuodong Liu PIN_FIELD_BASE(81, 81, 5, 0x00a0, 0x10, 2, 1),
7908b483bdaSGuodong Liu PIN_FIELD_BASE(82, 82, 5, 0x00a0, 0x10, 3, 1),
7918b483bdaSGuodong Liu PIN_FIELD_BASE(84, 84, 3, 0x0090, 0x10, 0, 1),
7928b483bdaSGuodong Liu PIN_FIELD_BASE(85, 85, 3, 0x0090, 0x10, 1, 1),
7938b483bdaSGuodong Liu PIN_FIELD_BASE(86, 86, 3, 0x0090, 0x10, 2, 1),
7948b483bdaSGuodong Liu PIN_FIELD_BASE(87, 87, 3, 0x0090, 0x10, 3, 1),
7958b483bdaSGuodong Liu PIN_FIELD_BASE(88, 88, 3, 0x0090, 0x10, 4, 1),
7968b483bdaSGuodong Liu PIN_FIELD_BASE(89, 89, 3, 0x0090, 0x10, 5, 1),
7978b483bdaSGuodong Liu };
7988b483bdaSGuodong Liu
7998b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_r1_range[] = {
8008b483bdaSGuodong Liu PIN_FIELD_BASE(67, 67, 1, 0x00a0, 0x10, 10, 1),
8018b483bdaSGuodong Liu PIN_FIELD_BASE(68, 68, 1, 0x00a0, 0x10, 0, 1),
8028b483bdaSGuodong Liu PIN_FIELD_BASE(69, 69, 1, 0x00a0, 0x10, 1, 1),
8038b483bdaSGuodong Liu PIN_FIELD_BASE(70, 70, 1, 0x00a0, 0x10, 11, 1),
8048b483bdaSGuodong Liu PIN_FIELD_BASE(71, 71, 1, 0x00a0, 0x10, 2, 1),
8058b483bdaSGuodong Liu PIN_FIELD_BASE(72, 72, 1, 0x00a0, 0x10, 3, 1),
8068b483bdaSGuodong Liu PIN_FIELD_BASE(73, 73, 1, 0x00a0, 0x10, 4, 1),
8078b483bdaSGuodong Liu PIN_FIELD_BASE(74, 74, 1, 0x00a0, 0x10, 5, 1),
8088b483bdaSGuodong Liu PIN_FIELD_BASE(75, 75, 1, 0x00a0, 0x10, 6, 1),
8098b483bdaSGuodong Liu PIN_FIELD_BASE(76, 76, 1, 0x00a0, 0x10, 7, 1),
8108b483bdaSGuodong Liu PIN_FIELD_BASE(77, 77, 1, 0x00a0, 0x10, 8, 1),
8118b483bdaSGuodong Liu PIN_FIELD_BASE(78, 78, 1, 0x00a0, 0x10, 9, 1),
8128b483bdaSGuodong Liu PIN_FIELD_BASE(79, 79, 5, 0x00b0, 0x10, 0, 1),
8138b483bdaSGuodong Liu PIN_FIELD_BASE(80, 80, 5, 0x00b0, 0x10, 1, 1),
8148b483bdaSGuodong Liu PIN_FIELD_BASE(81, 81, 5, 0x00b0, 0x10, 2, 1),
8158b483bdaSGuodong Liu PIN_FIELD_BASE(82, 82, 5, 0x00b0, 0x10, 3, 1),
8168b483bdaSGuodong Liu PIN_FIELD_BASE(84, 84, 3, 0x00a0, 0x10, 0, 1),
8178b483bdaSGuodong Liu PIN_FIELD_BASE(85, 85, 3, 0x00a0, 0x10, 1, 1),
8188b483bdaSGuodong Liu PIN_FIELD_BASE(86, 86, 3, 0x00a0, 0x10, 2, 1),
8198b483bdaSGuodong Liu PIN_FIELD_BASE(87, 87, 3, 0x00a0, 0x10, 3, 1),
8208b483bdaSGuodong Liu PIN_FIELD_BASE(88, 88, 3, 0x00a0, 0x10, 4, 1),
8218b483bdaSGuodong Liu PIN_FIELD_BASE(89, 89, 3, 0x00a0, 0x10, 5, 1),
8228b483bdaSGuodong Liu };
8238b483bdaSGuodong Liu
8248b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_drv_range[] = {
8258b483bdaSGuodong Liu PIN_FIELD_BASE(0, 0, 6, 0x0000, 0x10, 27, 3),
8268b483bdaSGuodong Liu PIN_FIELD_BASE(1, 1, 6, 0x0000, 0x10, 27, 3),
8278b483bdaSGuodong Liu PIN_FIELD_BASE(2, 2, 6, 0x0000, 0x10, 27, 3),
8288b483bdaSGuodong Liu PIN_FIELD_BASE(3, 3, 6, 0x0000, 0x10, 27, 3),
8298b483bdaSGuodong Liu PIN_FIELD_BASE(4, 4, 6, 0x0010, 0x10, 0, 3),
8308b483bdaSGuodong Liu PIN_FIELD_BASE(5, 5, 6, 0x0010, 0x10, 0, 3),
8318b483bdaSGuodong Liu PIN_FIELD_BASE(6, 6, 4, 0x0000, 0x10, 9, 3),
8328b483bdaSGuodong Liu PIN_FIELD_BASE(7, 7, 4, 0x0000, 0x10, 9, 3),
8338b483bdaSGuodong Liu PIN_FIELD_BASE(8, 8, 4, 0x0000, 0x10, 9, 3),
8348b483bdaSGuodong Liu PIN_FIELD_BASE(9, 9, 4, 0x0000, 0x10, 12, 3),
8358b483bdaSGuodong Liu PIN_FIELD_BASE(10, 10, 4, 0x0000, 0x10, 0, 3),
8368b483bdaSGuodong Liu PIN_FIELD_BASE(11, 11, 4, 0x0000, 0x10, 3, 3),
8378b483bdaSGuodong Liu PIN_FIELD_BASE(12, 12, 4, 0x0000, 0x10, 6, 3),
8388b483bdaSGuodong Liu PIN_FIELD_BASE(13, 13, 3, 0x0000, 0x10, 0, 3),
8398b483bdaSGuodong Liu PIN_FIELD_BASE(14, 14, 3, 0x0000, 0x10, 3, 3),
8408b483bdaSGuodong Liu PIN_FIELD_BASE(15, 15, 6, 0x0010, 0x10, 3, 3),
8418b483bdaSGuodong Liu PIN_FIELD_BASE(16, 16, 6, 0x0010, 0x10, 3, 3),
8428b483bdaSGuodong Liu PIN_FIELD_BASE(17, 17, 5, 0x0000, 0x10, 21, 3),
8438b483bdaSGuodong Liu PIN_FIELD_BASE(18, 18, 5, 0x0010, 0x10, 0, 3),
8448b483bdaSGuodong Liu PIN_FIELD_BASE(19, 19, 5, 0x0000, 0x10, 27, 3),
8458b483bdaSGuodong Liu PIN_FIELD_BASE(20, 20, 5, 0x0000, 0x10, 24, 3),
8468b483bdaSGuodong Liu PIN_FIELD_BASE(21, 21, 5, 0x0000, 0x10, 27, 3),
8478b483bdaSGuodong Liu PIN_FIELD_BASE(22, 22, 5, 0x0000, 0x10, 24, 3),
8488b483bdaSGuodong Liu PIN_FIELD_BASE(23, 23, 5, 0x0010, 0x10, 0, 3),
8498b483bdaSGuodong Liu PIN_FIELD_BASE(24, 24, 5, 0x0010, 0x10, 9, 3),
8508b483bdaSGuodong Liu PIN_FIELD_BASE(25, 25, 5, 0x0010, 0x10, 0, 3),
8518b483bdaSGuodong Liu PIN_FIELD_BASE(26, 26, 5, 0x0000, 0x10, 27, 3),
8528b483bdaSGuodong Liu PIN_FIELD_BASE(27, 27, 5, 0x0000, 0x10, 27, 3),
8538b483bdaSGuodong Liu PIN_FIELD_BASE(28, 28, 5, 0x0010, 0x10, 0, 3),
8548b483bdaSGuodong Liu PIN_FIELD_BASE(29, 29, 6, 0x0010, 0x10, 0, 3),
8558b483bdaSGuodong Liu PIN_FIELD_BASE(30, 30, 6, 0x0010, 0x10, 0, 3),
8568b483bdaSGuodong Liu PIN_FIELD_BASE(31, 31, 6, 0x0010, 0x10, 3, 3),
8578b483bdaSGuodong Liu PIN_FIELD_BASE(32, 32, 2, 0x0000, 0x10, 6, 3),
8588b483bdaSGuodong Liu PIN_FIELD_BASE(33, 33, 2, 0x0000, 0x10, 6, 3),
8598b483bdaSGuodong Liu PIN_FIELD_BASE(34, 34, 2, 0x0000, 0x10, 3, 3),
8608b483bdaSGuodong Liu PIN_FIELD_BASE(35, 35, 2, 0x0000, 0x10, 3, 3),
8618b483bdaSGuodong Liu PIN_FIELD_BASE(36, 36, 2, 0x0000, 0x10, 9, 3),
8628b483bdaSGuodong Liu PIN_FIELD_BASE(37, 37, 2, 0x0000, 0x10, 9, 3),
8638b483bdaSGuodong Liu PIN_FIELD_BASE(38, 38, 2, 0x0000, 0x10, 12, 3),
8648b483bdaSGuodong Liu PIN_FIELD_BASE(39, 39, 2, 0x0000, 0x10, 9, 3),
8658b483bdaSGuodong Liu PIN_FIELD_BASE(40, 40, 2, 0x0000, 0x10, 15, 3),
8668b483bdaSGuodong Liu PIN_FIELD_BASE(41, 41, 2, 0x0000, 0x10, 12, 3),
8678b483bdaSGuodong Liu PIN_FIELD_BASE(42, 42, 2, 0x0000, 0x10, 12, 3),
8688b483bdaSGuodong Liu PIN_FIELD_BASE(43, 43, 2, 0x0000, 0x10, 12, 3),
8698b483bdaSGuodong Liu PIN_FIELD_BASE(44, 44, 5, 0x0010, 0x10, 6, 3),
8708b483bdaSGuodong Liu PIN_FIELD_BASE(45, 45, 5, 0x0010, 0x10, 3, 3),
8718b483bdaSGuodong Liu PIN_FIELD_BASE(46, 46, 5, 0x0010, 0x10, 3, 3),
8728b483bdaSGuodong Liu PIN_FIELD_BASE(47, 47, 5, 0x0010, 0x10, 6, 3),
8738b483bdaSGuodong Liu PIN_FIELD_BASE(48, 48, 2, 0x0000, 0x10, 15, 3),
8748b483bdaSGuodong Liu PIN_FIELD_BASE(49, 49, 2, 0x0000, 0x10, 15, 3),
8758b483bdaSGuodong Liu PIN_FIELD_BASE(50, 50, 2, 0x0000, 0x10, 15, 3),
8768b483bdaSGuodong Liu PIN_FIELD_BASE(51, 51, 2, 0x0000, 0x10, 18, 3),
8778b483bdaSGuodong Liu PIN_FIELD_BASE(52, 52, 3, 0x0010, 0x10, 3, 3),
8788b483bdaSGuodong Liu PIN_FIELD_BASE(53, 53, 3, 0x0010, 0x10, 6, 3),
8798b483bdaSGuodong Liu PIN_FIELD_BASE(54, 54, 3, 0x0010, 0x10, 3, 3),
8808b483bdaSGuodong Liu PIN_FIELD_BASE(55, 55, 3, 0x0010, 0x10, 3, 3),
8818b483bdaSGuodong Liu PIN_FIELD_BASE(56, 56, 5, 0x0010, 0x10, 3, 3),
8828b483bdaSGuodong Liu PIN_FIELD_BASE(57, 57, 5, 0x0010, 0x10, 6, 3),
8838b483bdaSGuodong Liu PIN_FIELD_BASE(58, 58, 5, 0x0010, 0x10, 6, 3),
8848b483bdaSGuodong Liu PIN_FIELD_BASE(59, 59, 5, 0x0010, 0x10, 3, 3),
8858b483bdaSGuodong Liu PIN_FIELD_BASE(60, 60, 3, 0x0000, 0x10, 24, 3),
8868b483bdaSGuodong Liu PIN_FIELD_BASE(61, 61, 3, 0x0000, 0x10, 24, 3),
8878b483bdaSGuodong Liu PIN_FIELD_BASE(62, 62, 3, 0x0000, 0x10, 24, 3),
8888b483bdaSGuodong Liu PIN_FIELD_BASE(63, 63, 3, 0x0000, 0x10, 24, 3),
8898b483bdaSGuodong Liu PIN_FIELD_BASE(64, 64, 3, 0x0000, 0x10, 27, 3),
8908b483bdaSGuodong Liu PIN_FIELD_BASE(65, 65, 3, 0x0000, 0x10, 27, 3),
8918b483bdaSGuodong Liu PIN_FIELD_BASE(66, 66, 3, 0x0000, 0x10, 27, 3),
8928b483bdaSGuodong Liu PIN_FIELD_BASE(67, 67, 1, 0x0010, 0x10, 0, 3),
8938b483bdaSGuodong Liu PIN_FIELD_BASE(68, 68, 1, 0x0000, 0x10, 0, 3),
8948b483bdaSGuodong Liu PIN_FIELD_BASE(69, 69, 1, 0x0000, 0x10, 3, 3),
8958b483bdaSGuodong Liu PIN_FIELD_BASE(70, 70, 1, 0x0010, 0x10, 3, 3),
8968b483bdaSGuodong Liu PIN_FIELD_BASE(71, 71, 1, 0x0000, 0x10, 6, 3),
8978b483bdaSGuodong Liu PIN_FIELD_BASE(72, 72, 1, 0x0000, 0x10, 9, 3),
8988b483bdaSGuodong Liu PIN_FIELD_BASE(73, 73, 1, 0x0000, 0x10, 12, 3),
8998b483bdaSGuodong Liu PIN_FIELD_BASE(74, 74, 1, 0x0000, 0x10, 15, 3),
9008b483bdaSGuodong Liu PIN_FIELD_BASE(75, 75, 1, 0x0000, 0x10, 18, 3),
9018b483bdaSGuodong Liu PIN_FIELD_BASE(76, 76, 1, 0x0000, 0x10, 21, 3),
9028b483bdaSGuodong Liu PIN_FIELD_BASE(77, 77, 1, 0x0000, 0x10, 24, 3),
9038b483bdaSGuodong Liu PIN_FIELD_BASE(78, 78, 1, 0x0000, 0x10, 27, 3),
9048b483bdaSGuodong Liu PIN_FIELD_BASE(79, 79, 5, 0x0000, 0x10, 24, 3),
9058b483bdaSGuodong Liu PIN_FIELD_BASE(80, 80, 5, 0x0000, 0x10, 24, 3),
9068b483bdaSGuodong Liu PIN_FIELD_BASE(81, 81, 5, 0x0000, 0x10, 21, 3),
9078b483bdaSGuodong Liu PIN_FIELD_BASE(82, 82, 5, 0x0000, 0x10, 21, 3),
9088b483bdaSGuodong Liu PIN_FIELD_BASE(83, 83, 6, 0x0010, 0x10, 3, 3),
9098b483bdaSGuodong Liu PIN_FIELD_BASE(84, 84, 3, 0x0000, 0x10, 6, 3),
9108b483bdaSGuodong Liu PIN_FIELD_BASE(85, 85, 3, 0x0000, 0x10, 9, 3),
9118b483bdaSGuodong Liu PIN_FIELD_BASE(86, 86, 3, 0x0000, 0x10, 12, 3),
9128b483bdaSGuodong Liu PIN_FIELD_BASE(87, 87, 3, 0x0000, 0x10, 15, 3),
9138b483bdaSGuodong Liu PIN_FIELD_BASE(88, 88, 3, 0x0000, 0x10, 18, 3),
9148b483bdaSGuodong Liu PIN_FIELD_BASE(89, 89, 3, 0x0000, 0x10, 21, 3),
9158b483bdaSGuodong Liu PIN_FIELD_BASE(90, 90, 3, 0x0000, 0x10, 27, 3),
9168b483bdaSGuodong Liu PIN_FIELD_BASE(91, 91, 3, 0x0010, 0x10, 0, 3),
9178b483bdaSGuodong Liu PIN_FIELD_BASE(92, 92, 3, 0x0010, 0x10, 0, 3),
9188b483bdaSGuodong Liu PIN_FIELD_BASE(93, 93, 3, 0x0010, 0x10, 0, 3),
9198b483bdaSGuodong Liu PIN_FIELD_BASE(94, 94, 3, 0x0010, 0x10, 0, 3),
9208b483bdaSGuodong Liu PIN_FIELD_BASE(95, 95, 3, 0x0010, 0x10, 3, 3),
9218b483bdaSGuodong Liu PIN_FIELD_BASE(96, 96, 2, 0x0000, 0x10, 9, 3),
9228b483bdaSGuodong Liu PIN_FIELD_BASE(97, 97, 2, 0x0000, 0x10, 6, 3),
9238b483bdaSGuodong Liu PIN_FIELD_BASE(98, 98, 2, 0x0000, 0x10, 3, 3),
9248b483bdaSGuodong Liu PIN_FIELD_BASE(99, 99, 4, 0x0000, 0x10, 18, 3),
9258b483bdaSGuodong Liu PIN_FIELD_BASE(100, 100, 4, 0x0000, 0x10, 18, 3),
9268b483bdaSGuodong Liu PIN_FIELD_BASE(101, 101, 4, 0x0000, 0x10, 21, 3),
9278b483bdaSGuodong Liu PIN_FIELD_BASE(102, 102, 4, 0x0000, 0x10, 21, 3),
9288b483bdaSGuodong Liu PIN_FIELD_BASE(103, 103, 4, 0x0000, 0x10, 21, 3),
9298b483bdaSGuodong Liu PIN_FIELD_BASE(104, 104, 4, 0x0000, 0x10, 21, 3),
9308b483bdaSGuodong Liu PIN_FIELD_BASE(105, 105, 4, 0x0000, 0x10, 24, 3),
9318b483bdaSGuodong Liu PIN_FIELD_BASE(106, 106, 4, 0x0000, 0x10, 24, 3),
9328b483bdaSGuodong Liu PIN_FIELD_BASE(107, 107, 4, 0x0000, 0x10, 24, 3),
9338b483bdaSGuodong Liu PIN_FIELD_BASE(108, 108, 4, 0x0000, 0x10, 24, 3),
9348b483bdaSGuodong Liu PIN_FIELD_BASE(109, 109, 4, 0x0000, 0x10, 27, 3),
9358b483bdaSGuodong Liu PIN_FIELD_BASE(110, 110, 4, 0x0000, 0x10, 27, 3),
9368b483bdaSGuodong Liu PIN_FIELD_BASE(111, 111, 4, 0x0000, 0x10, 27, 3),
9378b483bdaSGuodong Liu PIN_FIELD_BASE(112, 112, 4, 0x0000, 0x10, 27, 3),
9388b483bdaSGuodong Liu PIN_FIELD_BASE(113, 113, 4, 0x0010, 0x10, 0, 3),
9398b483bdaSGuodong Liu PIN_FIELD_BASE(114, 114, 4, 0x0010, 0x10, 0, 3),
9408b483bdaSGuodong Liu PIN_FIELD_BASE(115, 115, 3, 0x0010, 0x10, 6, 3),
9418b483bdaSGuodong Liu PIN_FIELD_BASE(116, 116, 3, 0x0010, 0x10, 9, 3),
9428b483bdaSGuodong Liu PIN_FIELD_BASE(117, 117, 3, 0x0010, 0x10, 6, 3),
9438b483bdaSGuodong Liu PIN_FIELD_BASE(118, 118, 3, 0x0010, 0x10, 6, 3),
9448b483bdaSGuodong Liu PIN_FIELD_BASE(119, 119, 5, 0x0000, 0x10, 18, 3),
9458b483bdaSGuodong Liu PIN_FIELD_BASE(120, 120, 5, 0x0000, 0x10, 9, 3),
9468b483bdaSGuodong Liu PIN_FIELD_BASE(121, 121, 5, 0x0000, 0x10, 12, 3),
9478b483bdaSGuodong Liu PIN_FIELD_BASE(122, 122, 5, 0x0000, 0x10, 15, 3),
9488b483bdaSGuodong Liu PIN_FIELD_BASE(123, 123, 5, 0x0000, 0x10, 21, 3),
9498b483bdaSGuodong Liu PIN_FIELD_BASE(124, 124, 5, 0x0000, 0x10, 0, 3),
9508b483bdaSGuodong Liu PIN_FIELD_BASE(125, 125, 5, 0x0000, 0x10, 3, 3),
9518b483bdaSGuodong Liu PIN_FIELD_BASE(126, 126, 5, 0x0000, 0x10, 6, 3),
9528b483bdaSGuodong Liu PIN_FIELD_BASE(127, 127, 3, 0x0010, 0x10, 12, 3),
9538b483bdaSGuodong Liu PIN_FIELD_BASE(128, 128, 3, 0x0010, 0x10, 18, 3),
9548b483bdaSGuodong Liu PIN_FIELD_BASE(129, 129, 5, 0x0010, 0x10, 12, 3),
9558b483bdaSGuodong Liu PIN_FIELD_BASE(130, 130, 5, 0x0010, 0x10, 18, 3),
9568b483bdaSGuodong Liu PIN_FIELD_BASE(131, 131, 5, 0x0010, 0x10, 15, 3),
9578b483bdaSGuodong Liu PIN_FIELD_BASE(132, 132, 5, 0x0010, 0x10, 21, 3),
9588b483bdaSGuodong Liu PIN_FIELD_BASE(133, 133, 1, 0x0010, 0x10, 15, 3),
9598b483bdaSGuodong Liu PIN_FIELD_BASE(134, 134, 1, 0x0010, 0x10, 21, 3),
9608b483bdaSGuodong Liu PIN_FIELD_BASE(135, 135, 6, 0x0010, 0x10, 6, 3),
9618b483bdaSGuodong Liu PIN_FIELD_BASE(136, 136, 6, 0x0010, 0x10, 15, 3),
9628b483bdaSGuodong Liu PIN_FIELD_BASE(137, 137, 1, 0x0010, 0x10, 18, 3),
9638b483bdaSGuodong Liu PIN_FIELD_BASE(138, 138, 1, 0x0010, 0x10, 24, 3),
9648b483bdaSGuodong Liu PIN_FIELD_BASE(139, 139, 2, 0x0000, 0x10, 21, 3),
9658b483bdaSGuodong Liu PIN_FIELD_BASE(140, 140, 2, 0x0000, 0x10, 24, 3),
9668b483bdaSGuodong Liu PIN_FIELD_BASE(141, 141, 3, 0x0010, 0x10, 15, 3),
9678b483bdaSGuodong Liu PIN_FIELD_BASE(142, 142, 3, 0x0010, 0x10, 21, 3),
9688b483bdaSGuodong Liu PIN_FIELD_BASE(143, 143, 6, 0x0010, 0x10, 9, 3),
9698b483bdaSGuodong Liu PIN_FIELD_BASE(144, 144, 6, 0x0010, 0x10, 18, 3),
9708b483bdaSGuodong Liu PIN_FIELD_BASE(145, 145, 6, 0x0010, 0x10, 12, 3),
9718b483bdaSGuodong Liu PIN_FIELD_BASE(146, 146, 6, 0x0010, 0x10, 21, 3),
9728b483bdaSGuodong Liu PIN_FIELD_BASE(147, 147, 4, 0x0000, 0x10, 12, 3),
9738b483bdaSGuodong Liu PIN_FIELD_BASE(148, 148, 4, 0x0000, 0x10, 12, 3),
9748b483bdaSGuodong Liu PIN_FIELD_BASE(149, 149, 4, 0x0000, 0x10, 12, 3),
9758b483bdaSGuodong Liu PIN_FIELD_BASE(150, 150, 4, 0x0000, 0x10, 15, 3),
9768b483bdaSGuodong Liu PIN_FIELD_BASE(151, 151, 4, 0x0000, 0x10, 15, 3),
9778b483bdaSGuodong Liu PIN_FIELD_BASE(152, 152, 4, 0x0000, 0x10, 9, 3),
9788b483bdaSGuodong Liu PIN_FIELD_BASE(153, 153, 4, 0x0000, 0x10, 15, 3),
9798b483bdaSGuodong Liu PIN_FIELD_BASE(154, 154, 4, 0x0000, 0x10, 15, 3),
9808b483bdaSGuodong Liu PIN_FIELD_BASE(155, 155, 4, 0x0000, 0x10, 18, 3),
9818b483bdaSGuodong Liu PIN_FIELD_BASE(156, 156, 4, 0x0000, 0x10, 18, 3),
9828b483bdaSGuodong Liu PIN_FIELD_BASE(157, 157, 2, 0x0000, 0x10, 0, 3),
9838b483bdaSGuodong Liu PIN_FIELD_BASE(158, 158, 2, 0x0000, 0x10, 0, 3),
9848b483bdaSGuodong Liu PIN_FIELD_BASE(159, 159, 2, 0x0000, 0x10, 0, 3),
9858b483bdaSGuodong Liu PIN_FIELD_BASE(160, 160, 2, 0x0000, 0x10, 0, 3),
9868b483bdaSGuodong Liu PIN_FIELD_BASE(161, 161, 2, 0x0000, 0x10, 6, 3),
9878b483bdaSGuodong Liu PIN_FIELD_BASE(162, 162, 2, 0x0000, 0x10, 3, 3),
9888b483bdaSGuodong Liu PIN_FIELD_BASE(163, 163, 1, 0x0010, 0x10, 12, 3),
9898b483bdaSGuodong Liu PIN_FIELD_BASE(165, 165, 1, 0x0010, 0x10, 6, 3),
9908b483bdaSGuodong Liu PIN_FIELD_BASE(166, 166, 1, 0x0010, 0x10, 6, 3),
9918b483bdaSGuodong Liu PIN_FIELD_BASE(167, 167, 1, 0x0010, 0x10, 9, 3),
9928b483bdaSGuodong Liu PIN_FIELD_BASE(168, 168, 1, 0x0010, 0x10, 6, 3),
9938b483bdaSGuodong Liu PIN_FIELD_BASE(169, 169, 1, 0x0010, 0x10, 12, 3),
9948b483bdaSGuodong Liu PIN_FIELD_BASE(170, 170, 1, 0x0010, 0x10, 9, 3),
9958b483bdaSGuodong Liu PIN_FIELD_BASE(171, 171, 1, 0x0010, 0x10, 9, 3),
9968b483bdaSGuodong Liu PIN_FIELD_BASE(172, 172, 1, 0x0010, 0x10, 9, 3),
9978b483bdaSGuodong Liu PIN_FIELD_BASE(173, 173, 1, 0x0010, 0x10, 6, 3),
9988b483bdaSGuodong Liu PIN_FIELD_BASE(174, 174, 6, 0x0000, 0x10, 9, 3),
9998b483bdaSGuodong Liu PIN_FIELD_BASE(175, 175, 6, 0x0000, 0x10, 12, 3),
10008b483bdaSGuodong Liu PIN_FIELD_BASE(176, 176, 6, 0x0000, 0x10, 0, 3),
10018b483bdaSGuodong Liu PIN_FIELD_BASE(177, 177, 6, 0x0000, 0x10, 3, 3),
10028b483bdaSGuodong Liu PIN_FIELD_BASE(178, 178, 6, 0x0000, 0x10, 6, 3),
10038b483bdaSGuodong Liu PIN_FIELD_BASE(179, 179, 6, 0x0000, 0x10, 15, 3),
10048b483bdaSGuodong Liu PIN_FIELD_BASE(180, 180, 6, 0x0000, 0x10, 18, 3),
10058b483bdaSGuodong Liu PIN_FIELD_BASE(181, 181, 6, 0x0000, 0x10, 21, 3),
10068b483bdaSGuodong Liu PIN_FIELD_BASE(182, 182, 6, 0x0000, 0x10, 24, 3),
10078b483bdaSGuodong Liu PIN_FIELD_BASE(183, 183, 2, 0x0000, 0x10, 27, 3),
10088b483bdaSGuodong Liu PIN_FIELD_BASE(184, 184, 2, 0x0010, 0x10, 0, 3),
10098b483bdaSGuodong Liu };
10108b483bdaSGuodong Liu
10118b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_drv_adv_range[] = {
10128b483bdaSGuodong Liu PIN_FIELD_BASE(127, 127, 3, 0x0030, 0x10, 0, 3),
10138b483bdaSGuodong Liu PIN_FIELD_BASE(128, 128, 3, 0x0030, 0x10, 6, 3),
10148b483bdaSGuodong Liu PIN_FIELD_BASE(129, 129, 5, 0x0030, 0x10, 0, 3),
10158b483bdaSGuodong Liu PIN_FIELD_BASE(130, 130, 5, 0x0030, 0x10, 6, 3),
10168b483bdaSGuodong Liu PIN_FIELD_BASE(131, 131, 5, 0x0030, 0x10, 3, 3),
10178b483bdaSGuodong Liu PIN_FIELD_BASE(132, 132, 5, 0x0030, 0x10, 9, 3),
10188b483bdaSGuodong Liu PIN_FIELD_BASE(133, 133, 1, 0x0030, 0x10, 0, 3),
10198b483bdaSGuodong Liu PIN_FIELD_BASE(134, 134, 1, 0x0030, 0x10, 6, 3),
10208b483bdaSGuodong Liu PIN_FIELD_BASE(135, 135, 6, 0x0020, 0x10, 0, 3),
10218b483bdaSGuodong Liu PIN_FIELD_BASE(136, 136, 6, 0x0020, 0x10, 9, 3),
10228b483bdaSGuodong Liu PIN_FIELD_BASE(137, 137, 1, 0x0030, 0x10, 3, 3),
10238b483bdaSGuodong Liu PIN_FIELD_BASE(138, 138, 1, 0x0030, 0x10, 9, 3),
10248b483bdaSGuodong Liu PIN_FIELD_BASE(139, 139, 2, 0x0020, 0x10, 0, 3),
10258b483bdaSGuodong Liu PIN_FIELD_BASE(140, 140, 2, 0x0020, 0x10, 3, 3),
10268b483bdaSGuodong Liu PIN_FIELD_BASE(141, 141, 3, 0x0030, 0x10, 3, 3),
10278b483bdaSGuodong Liu PIN_FIELD_BASE(142, 142, 3, 0x0030, 0x10, 9, 3),
10288b483bdaSGuodong Liu PIN_FIELD_BASE(143, 143, 6, 0x0020, 0x10, 3, 3),
10298b483bdaSGuodong Liu PIN_FIELD_BASE(144, 144, 6, 0x0020, 0x10, 12, 3),
10308b483bdaSGuodong Liu PIN_FIELD_BASE(145, 145, 6, 0x0020, 0x10, 6, 3),
10318b483bdaSGuodong Liu PIN_FIELD_BASE(146, 146, 6, 0x0020, 0x10, 15, 3),
10328b483bdaSGuodong Liu };
10338b483bdaSGuodong Liu
10348b483bdaSGuodong Liu static const struct mtk_pin_field_calc mt8186_pin_rsel_range[] = {
10358b483bdaSGuodong Liu PIN_FIELD_BASE(127, 127, 3, 0x00d0, 0x10, 0, 2),
10368b483bdaSGuodong Liu PIN_FIELD_BASE(128, 128, 3, 0x00d0, 0x10, 4, 2),
10378b483bdaSGuodong Liu PIN_FIELD_BASE(129, 129, 5, 0x00d0, 0x10, 0, 2),
10388b483bdaSGuodong Liu PIN_FIELD_BASE(130, 130, 5, 0x00d0, 0x10, 4, 2),
10398b483bdaSGuodong Liu PIN_FIELD_BASE(131, 131, 5, 0x00d0, 0x10, 2, 2),
10408b483bdaSGuodong Liu PIN_FIELD_BASE(132, 132, 5, 0x00d0, 0x10, 6, 2),
10418b483bdaSGuodong Liu PIN_FIELD_BASE(133, 133, 1, 0x00e0, 0x10, 0, 2),
10428b483bdaSGuodong Liu PIN_FIELD_BASE(134, 134, 1, 0x00e0, 0x10, 4, 2),
10438b483bdaSGuodong Liu PIN_FIELD_BASE(135, 135, 6, 0x0070, 0x10, 0, 2),
10448b483bdaSGuodong Liu PIN_FIELD_BASE(136, 136, 6, 0x0070, 0x10, 6, 2),
10458b483bdaSGuodong Liu PIN_FIELD_BASE(137, 137, 1, 0x00e0, 0x10, 2, 2),
10468b483bdaSGuodong Liu PIN_FIELD_BASE(138, 138, 1, 0x00e0, 0x10, 6, 2),
10478b483bdaSGuodong Liu PIN_FIELD_BASE(139, 139, 2, 0x0080, 0x10, 0, 2),
10488b483bdaSGuodong Liu PIN_FIELD_BASE(140, 140, 2, 0x0080, 0x10, 2, 2),
10498b483bdaSGuodong Liu PIN_FIELD_BASE(141, 141, 3, 0x00d0, 0x10, 2, 2),
10508b483bdaSGuodong Liu PIN_FIELD_BASE(142, 142, 3, 0x00d0, 0x10, 6, 2),
10518b483bdaSGuodong Liu PIN_FIELD_BASE(143, 143, 6, 0x0070, 0x10, 2, 2),
10528b483bdaSGuodong Liu PIN_FIELD_BASE(144, 144, 6, 0x0070, 0x10, 8, 2),
10538b483bdaSGuodong Liu PIN_FIELD_BASE(145, 145, 6, 0x0070, 0x10, 4, 2),
10548b483bdaSGuodong Liu PIN_FIELD_BASE(146, 146, 6, 0x0070, 0x10, 10, 2),
10558b483bdaSGuodong Liu };
10568b483bdaSGuodong Liu
10578b483bdaSGuodong Liu static const struct mtk_pin_rsel mt8186_pin_rsel_val_range[] = {
10588b483bdaSGuodong Liu PIN_RSEL(127, 128, 0x0, 75000, 75000),
10598b483bdaSGuodong Liu PIN_RSEL(127, 128, 0x1, 10000, 75000),
10608b483bdaSGuodong Liu PIN_RSEL(127, 128, 0x2, 5000, 5000),
10618b483bdaSGuodong Liu PIN_RSEL(127, 128, 0x3, 1000, 5000),
10628b483bdaSGuodong Liu PIN_RSEL(129, 130, 0x0, 75000, 75000),
10638b483bdaSGuodong Liu PIN_RSEL(129, 130, 0x1, 10000, 75000),
10648b483bdaSGuodong Liu PIN_RSEL(129, 130, 0x2, 5000, 5000),
10658b483bdaSGuodong Liu PIN_RSEL(129, 130, 0x3, 1000, 5000),
10668b483bdaSGuodong Liu PIN_RSEL(131, 132, 0x0, 75000, 75000),
10678b483bdaSGuodong Liu PIN_RSEL(131, 132, 0x1, 10000, 75000),
10688b483bdaSGuodong Liu PIN_RSEL(131, 132, 0x2, 5000, 5000),
10698b483bdaSGuodong Liu PIN_RSEL(131, 132, 0x3, 1000, 5000),
10708b483bdaSGuodong Liu PIN_RSEL(133, 134, 0x0, 75000, 75000),
10718b483bdaSGuodong Liu PIN_RSEL(133, 134, 0x1, 10000, 75000),
10728b483bdaSGuodong Liu PIN_RSEL(133, 134, 0x2, 5000, 5000),
10738b483bdaSGuodong Liu PIN_RSEL(133, 134, 0x3, 1000, 5000),
10748b483bdaSGuodong Liu PIN_RSEL(135, 136, 0x0, 75000, 75000),
10758b483bdaSGuodong Liu PIN_RSEL(135, 136, 0x1, 10000, 75000),
10768b483bdaSGuodong Liu PIN_RSEL(135, 136, 0x2, 5000, 5000),
10778b483bdaSGuodong Liu PIN_RSEL(135, 136, 0x3, 1000, 5000),
10788b483bdaSGuodong Liu PIN_RSEL(137, 138, 0x0, 75000, 75000),
10798b483bdaSGuodong Liu PIN_RSEL(137, 138, 0x1, 10000, 75000),
10808b483bdaSGuodong Liu PIN_RSEL(137, 138, 0x2, 5000, 5000),
10818b483bdaSGuodong Liu PIN_RSEL(137, 138, 0x3, 1000, 5000),
10828b483bdaSGuodong Liu PIN_RSEL(139, 140, 0x0, 75000, 75000),
10838b483bdaSGuodong Liu PIN_RSEL(139, 140, 0x1, 10000, 75000),
10848b483bdaSGuodong Liu PIN_RSEL(139, 140, 0x2, 5000, 5000),
10858b483bdaSGuodong Liu PIN_RSEL(139, 140, 0x3, 1000, 5000),
10868b483bdaSGuodong Liu PIN_RSEL(141, 142, 0x0, 75000, 75000),
10878b483bdaSGuodong Liu PIN_RSEL(141, 142, 0x1, 10000, 75000),
10888b483bdaSGuodong Liu PIN_RSEL(141, 142, 0x2, 5000, 5000),
10898b483bdaSGuodong Liu PIN_RSEL(141, 142, 0x3, 1000, 5000),
10908b483bdaSGuodong Liu PIN_RSEL(143, 144, 0x0, 75000, 75000),
10918b483bdaSGuodong Liu PIN_RSEL(143, 144, 0x1, 10000, 75000),
10928b483bdaSGuodong Liu PIN_RSEL(143, 144, 0x2, 5000, 5000),
10938b483bdaSGuodong Liu PIN_RSEL(143, 144, 0x3, 1000, 5000),
10948b483bdaSGuodong Liu PIN_RSEL(145, 146, 0x0, 75000, 75000),
10958b483bdaSGuodong Liu PIN_RSEL(145, 146, 0x1, 10000, 75000),
10968b483bdaSGuodong Liu PIN_RSEL(145, 146, 0x2, 5000, 5000),
10978b483bdaSGuodong Liu PIN_RSEL(145, 146, 0x3, 1000, 5000),
10988b483bdaSGuodong Liu };
10998b483bdaSGuodong Liu
11008b483bdaSGuodong Liu static const unsigned int mt8186_pull_type[] = {
11018b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*0*/ MTK_PULL_PU_PD_TYPE,/*1*/
11028b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*2*/ MTK_PULL_PU_PD_TYPE,/*3*/
11038b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*4*/ MTK_PULL_PU_PD_TYPE,/*5*/
11048b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*6*/ MTK_PULL_PU_PD_TYPE,/*7*/
11058b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*8*/ MTK_PULL_PU_PD_TYPE,/*9*/
11068b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*10*/ MTK_PULL_PU_PD_TYPE,/*11*/
11078b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*12*/ MTK_PULL_PU_PD_TYPE,/*13*/
11088b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*14*/ MTK_PULL_PU_PD_TYPE,/*15*/
11098b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*16*/ MTK_PULL_PU_PD_TYPE,/*17*/
11108b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*18*/ MTK_PULL_PU_PD_TYPE,/*19*/
11118b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*20*/ MTK_PULL_PU_PD_TYPE,/*21*/
11128b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*22*/ MTK_PULL_PU_PD_TYPE,/*23*/
11138b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*24*/ MTK_PULL_PU_PD_TYPE,/*25*/
11148b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*26*/ MTK_PULL_PU_PD_TYPE,/*27*/
11158b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*28*/ MTK_PULL_PU_PD_TYPE,/*29*/
11168b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*30*/ MTK_PULL_PU_PD_TYPE,/*31*/
11178b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*32*/ MTK_PULL_PU_PD_TYPE,/*33*/
11188b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*34*/ MTK_PULL_PU_PD_TYPE,/*35*/
11198b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*36*/ MTK_PULL_PU_PD_TYPE,/*37*/
11208b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*38*/ MTK_PULL_PU_PD_TYPE,/*39*/
11218b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*40*/ MTK_PULL_PU_PD_TYPE,/*41*/
11228b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*42*/ MTK_PULL_PU_PD_TYPE,/*43*/
11238b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*44*/ MTK_PULL_PU_PD_TYPE,/*45*/
11248b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*46*/ MTK_PULL_PU_PD_TYPE,/*47*/
11258b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*48*/ MTK_PULL_PU_PD_TYPE,/*49*/
11268b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*50*/ MTK_PULL_PU_PD_TYPE,/*51*/
11278b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*52*/ MTK_PULL_PU_PD_TYPE,/*53*/
11288b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*54*/ MTK_PULL_PU_PD_TYPE,/*55*/
11298b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*56*/ MTK_PULL_PU_PD_TYPE,/*57*/
11308b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*58*/ MTK_PULL_PU_PD_TYPE,/*59*/
11318b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*60*/ MTK_PULL_PU_PD_TYPE,/*61*/
11328b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*62*/ MTK_PULL_PU_PD_TYPE,/*63*/
11338b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*64*/ MTK_PULL_PU_PD_TYPE,/*65*/
11348b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*66*/ MTK_PULL_PUPD_R1R0_TYPE,/*67*/
11358b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*68*/ MTK_PULL_PUPD_R1R0_TYPE,/*69*/
11368b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*70*/ MTK_PULL_PUPD_R1R0_TYPE,/*71*/
11378b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*72*/ MTK_PULL_PUPD_R1R0_TYPE,/*73*/
11388b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*74*/ MTK_PULL_PUPD_R1R0_TYPE,/*75*/
11398b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*76*/ MTK_PULL_PUPD_R1R0_TYPE,/*77*/
11408b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*78*/ MTK_PULL_PUPD_R1R0_TYPE,/*79*/
11418b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*80*/ MTK_PULL_PUPD_R1R0_TYPE,/*81*/
11428b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*82*/ MTK_PULL_PU_PD_TYPE,/*83*/
11438b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*84*/ MTK_PULL_PUPD_R1R0_TYPE,/*85*/
11448b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*86*/ MTK_PULL_PUPD_R1R0_TYPE,/*87*/
11458b483bdaSGuodong Liu MTK_PULL_PUPD_R1R0_TYPE,/*88*/ MTK_PULL_PUPD_R1R0_TYPE,/*89*/
11468b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*90*/ MTK_PULL_PU_PD_TYPE,/*91*/
11478b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*92*/ MTK_PULL_PU_PD_TYPE,/*93*/
11488b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*94*/ MTK_PULL_PU_PD_TYPE,/*95*/
11498b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*96*/ MTK_PULL_PU_PD_TYPE,/*97*/
11508b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*98*/ MTK_PULL_PU_PD_TYPE,/*99*/
11518b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*100*/ MTK_PULL_PU_PD_TYPE,/*101*/
11528b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*102*/ MTK_PULL_PU_PD_TYPE,/*103*/
11538b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*104*/ MTK_PULL_PU_PD_TYPE,/*105*/
11548b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*106*/ MTK_PULL_PU_PD_TYPE,/*107*/
11558b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*108*/ MTK_PULL_PU_PD_TYPE,/*109*/
11568b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*110*/ MTK_PULL_PU_PD_TYPE,/*111*/
11578b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*112*/ MTK_PULL_PU_PD_TYPE,/*113*/
11588b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*114*/ MTK_PULL_PU_PD_TYPE,/*115*/
11598b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*116*/ MTK_PULL_PU_PD_TYPE,/*117*/
11608b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*118*/ MTK_PULL_PU_PD_TYPE,/*119*/
11618b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*120*/ MTK_PULL_PU_PD_TYPE,/*121*/
11628b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*122*/ MTK_PULL_PU_PD_TYPE,/*123*/
11638b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*124*/ MTK_PULL_PU_PD_TYPE,/*125*/
11648b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*126*/ MTK_PULL_PU_PD_RSEL_TYPE,/*127*/
11658b483bdaSGuodong Liu MTK_PULL_PU_PD_RSEL_TYPE,/*128*/ MTK_PULL_PU_PD_RSEL_TYPE,/*129*/
11668b483bdaSGuodong Liu MTK_PULL_PU_PD_RSEL_TYPE,/*130*/ MTK_PULL_PU_PD_RSEL_TYPE,/*131*/
11678b483bdaSGuodong Liu MTK_PULL_PU_PD_RSEL_TYPE,/*132*/ MTK_PULL_PU_PD_RSEL_TYPE,/*133*/
11688b483bdaSGuodong Liu MTK_PULL_PU_PD_RSEL_TYPE,/*134*/ MTK_PULL_PU_PD_RSEL_TYPE,/*135*/
11698b483bdaSGuodong Liu MTK_PULL_PU_PD_RSEL_TYPE,/*136*/ MTK_PULL_PU_PD_RSEL_TYPE,/*137*/
11708b483bdaSGuodong Liu MTK_PULL_PU_PD_RSEL_TYPE,/*138*/ MTK_PULL_PU_PD_RSEL_TYPE,/*139*/
11718b483bdaSGuodong Liu MTK_PULL_PU_PD_RSEL_TYPE,/*140*/ MTK_PULL_PU_PD_RSEL_TYPE,/*141*/
11728b483bdaSGuodong Liu MTK_PULL_PU_PD_RSEL_TYPE,/*142*/ MTK_PULL_PU_PD_RSEL_TYPE,/*143*/
11738b483bdaSGuodong Liu MTK_PULL_PU_PD_RSEL_TYPE,/*144*/ MTK_PULL_PU_PD_RSEL_TYPE,/*145*/
11748b483bdaSGuodong Liu MTK_PULL_PU_PD_RSEL_TYPE,/*146*/ MTK_PULL_PU_PD_TYPE,/*147*/
11758b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*148*/ MTK_PULL_PU_PD_TYPE,/*149*/
11768b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*150*/ MTK_PULL_PU_PD_TYPE,/*151*/
11778b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*152*/ MTK_PULL_PU_PD_TYPE,/*153*/
11788b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*154*/ MTK_PULL_PU_PD_TYPE,/*155*/
11798b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*156*/ MTK_PULL_PU_PD_TYPE,/*157*/
11808b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*158*/ MTK_PULL_PU_PD_TYPE,/*159*/
11818b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*160*/ MTK_PULL_PU_PD_TYPE,/*161*/
11828b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*162*/ MTK_PULL_PU_PD_TYPE,/*163*/
11838b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*164*/ MTK_PULL_PU_PD_TYPE,/*165*/
11848b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*166*/ MTK_PULL_PU_PD_TYPE,/*167*/
11858b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*168*/ MTK_PULL_PU_PD_TYPE,/*169*/
11868b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*170*/ MTK_PULL_PU_PD_TYPE,/*171*/
11878b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*172*/ MTK_PULL_PU_PD_TYPE,/*173*/
11888b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*174*/ MTK_PULL_PU_PD_TYPE,/*175*/
11898b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*176*/ MTK_PULL_PU_PD_TYPE,/*177*/
11908b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*178*/ MTK_PULL_PU_PD_TYPE,/*179*/
11918b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*180*/ MTK_PULL_PU_PD_TYPE,/*181*/
11928b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*182*/ MTK_PULL_PU_PD_TYPE,/*183*/
11938b483bdaSGuodong Liu MTK_PULL_PU_PD_TYPE,/*184*/
11948b483bdaSGuodong Liu };
11958b483bdaSGuodong Liu
11968b483bdaSGuodong Liu static const struct mtk_pin_reg_calc mt8186_reg_cals[PINCTRL_PIN_REG_MAX] = {
11978b483bdaSGuodong Liu [PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt8186_pin_mode_range),
11988b483bdaSGuodong Liu [PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt8186_pin_dir_range),
11998b483bdaSGuodong Liu [PINCTRL_PIN_REG_DI] = MTK_RANGE(mt8186_pin_di_range),
12008b483bdaSGuodong Liu [PINCTRL_PIN_REG_DO] = MTK_RANGE(mt8186_pin_do_range),
12018b483bdaSGuodong Liu [PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt8186_pin_smt_range),
12028b483bdaSGuodong Liu [PINCTRL_PIN_REG_IES] = MTK_RANGE(mt8186_pin_ies_range),
12038b483bdaSGuodong Liu [PINCTRL_PIN_REG_PU] = MTK_RANGE(mt8186_pin_pu_range),
12048b483bdaSGuodong Liu [PINCTRL_PIN_REG_PD] = MTK_RANGE(mt8186_pin_pd_range),
12058b483bdaSGuodong Liu [PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt8186_pin_drv_range),
12068b483bdaSGuodong Liu [PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt8186_pin_pupd_range),
12078b483bdaSGuodong Liu [PINCTRL_PIN_REG_R0] = MTK_RANGE(mt8186_pin_r0_range),
12088b483bdaSGuodong Liu [PINCTRL_PIN_REG_R1] = MTK_RANGE(mt8186_pin_r1_range),
12098b483bdaSGuodong Liu [PINCTRL_PIN_REG_DRV_ADV] = MTK_RANGE(mt8186_pin_drv_adv_range),
12108b483bdaSGuodong Liu [PINCTRL_PIN_REG_RSEL] = MTK_RANGE(mt8186_pin_rsel_range),
12118b483bdaSGuodong Liu
12128b483bdaSGuodong Liu };
12138b483bdaSGuodong Liu
12148b483bdaSGuodong Liu static const char * const mt8186_pinctrl_register_base_names[] = {
12158b483bdaSGuodong Liu "iocfg0", "iocfg_lt", "iocfg_lm", "iocfg_lb", "iocfg_bl",
12168b483bdaSGuodong Liu "iocfg_rb", "iocfg_rt",
12178b483bdaSGuodong Liu };
12188b483bdaSGuodong Liu
12198b483bdaSGuodong Liu static const struct mtk_eint_hw mt8186_eint_hw = {
12208b483bdaSGuodong Liu .port_mask = 0xf,
12218b483bdaSGuodong Liu .ports = 7,
12228b483bdaSGuodong Liu .ap_num = 217,
12238b483bdaSGuodong Liu .db_cnt = 32,
1224*e1ff91f9SAngeloGioacchino Del Regno .db_time = debounce_time_mt6765,
12258b483bdaSGuodong Liu };
12268b483bdaSGuodong Liu
12278b483bdaSGuodong Liu static const struct mtk_pin_soc mt8186_data = {
12288b483bdaSGuodong Liu .reg_cal = mt8186_reg_cals,
12298b483bdaSGuodong Liu .pins = mtk_pins_mt8186,
12308b483bdaSGuodong Liu .npins = ARRAY_SIZE(mtk_pins_mt8186),
12318b483bdaSGuodong Liu .ngrps = ARRAY_SIZE(mtk_pins_mt8186),
12328b483bdaSGuodong Liu .nfuncs = 8,
12338b483bdaSGuodong Liu .gpio_m = 0,
12348b483bdaSGuodong Liu .eint_hw = &mt8186_eint_hw,
12358b483bdaSGuodong Liu .base_names = mt8186_pinctrl_register_base_names,
12368b483bdaSGuodong Liu .nbase_names = ARRAY_SIZE(mt8186_pinctrl_register_base_names),
12378b483bdaSGuodong Liu .pull_type = mt8186_pull_type,
12388b483bdaSGuodong Liu .pin_rsel = mt8186_pin_rsel_val_range,
12398b483bdaSGuodong Liu .npin_rsel = ARRAY_SIZE(mt8186_pin_rsel_val_range),
12408b483bdaSGuodong Liu .bias_set_combo = mtk_pinconf_bias_set_combo,
12418b483bdaSGuodong Liu .bias_get_combo = mtk_pinconf_bias_get_combo,
12428b483bdaSGuodong Liu .drive_set = mtk_pinconf_drive_set_rev1,
12438b483bdaSGuodong Liu .drive_get = mtk_pinconf_drive_get_rev1,
12448b483bdaSGuodong Liu .adv_drive_get = mtk_pinconf_adv_drive_get_raw,
12458b483bdaSGuodong Liu .adv_drive_set = mtk_pinconf_adv_drive_set_raw,
12468b483bdaSGuodong Liu };
12478b483bdaSGuodong Liu
12488b483bdaSGuodong Liu static const struct of_device_id mt8186_pinctrl_of_match[] = {
1249042a6362SLinus Walleij { .compatible = "mediatek,mt8186-pinctrl", .data = &mt8186_data },
12508b483bdaSGuodong Liu { }
12518b483bdaSGuodong Liu };
12528b483bdaSGuodong Liu
12538b483bdaSGuodong Liu static struct platform_driver mt8186_pinctrl_driver = {
12548b483bdaSGuodong Liu .driver = {
12558b483bdaSGuodong Liu .name = "mt8186-pinctrl",
12568b483bdaSGuodong Liu .of_match_table = mt8186_pinctrl_of_match,
12578b483bdaSGuodong Liu .pm = &mtk_paris_pinctrl_pm_ops,
12588b483bdaSGuodong Liu },
1259042a6362SLinus Walleij .probe = mtk_paris_pinctrl_probe,
12608b483bdaSGuodong Liu };
12618b483bdaSGuodong Liu
mt8186_pinctrl_init(void)12628b483bdaSGuodong Liu static int __init mt8186_pinctrl_init(void)
12638b483bdaSGuodong Liu {
12648b483bdaSGuodong Liu return platform_driver_register(&mt8186_pinctrl_driver);
12658b483bdaSGuodong Liu }
12668b483bdaSGuodong Liu
12678b483bdaSGuodong Liu arch_initcall(mt8186_pinctrl_init);
1268