xref: /openbmc/linux/drivers/pinctrl/mediatek/pinctrl-mt8188.c (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
111b918d9SHui.Liu // SPDX-License-Identifier: GPL-2.0
211b918d9SHui.Liu /*
311b918d9SHui.Liu  * Copyright (C) 2022 MediaTek Inc.
411b918d9SHui.Liu  * Author: Hui Liu <hui.liu@mediatek.com>
511b918d9SHui.Liu  *
611b918d9SHui.Liu  */
711b918d9SHui.Liu 
811b918d9SHui.Liu #include <linux/module.h>
911b918d9SHui.Liu #include "pinctrl-mtk-mt8188.h"
1011b918d9SHui.Liu #include "pinctrl-paris.h"
1111b918d9SHui.Liu 
1211b918d9SHui.Liu /* MT8188 have multiple bases to program pin configuration listed as the below:
1311b918d9SHui.Liu  * iocfg[0]:0x10005000, iocfg[1]:0x11c00000, iocfg[2]:0x11e10000,
1411b918d9SHui.Liu  * iocfg[3]:0x11e20000, iocfg[4]:0x11ea0000
1511b918d9SHui.Liu  * _i_based could be used to indicate what base the pin should be mapped into.
1611b918d9SHui.Liu  */
1711b918d9SHui.Liu 
1811b918d9SHui.Liu #define PIN_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits)  \
1911b918d9SHui.Liu 	PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, \
2011b918d9SHui.Liu 		32, 0)
2111b918d9SHui.Liu 
2211b918d9SHui.Liu #define PINS_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \
2311b918d9SHui.Liu 	PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, \
2411b918d9SHui.Liu 		32, 1)
2511b918d9SHui.Liu 
2611b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_mode_range[] = {
2711b918d9SHui.Liu 	PIN_FIELD(0, 177, 0x0300, 0x10, 0, 4),
2811b918d9SHui.Liu };
2911b918d9SHui.Liu 
3011b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_dir_range[] = {
3111b918d9SHui.Liu 	PIN_FIELD(0, 177, 0x0000, 0x10, 0, 1),
3211b918d9SHui.Liu };
3311b918d9SHui.Liu 
3411b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_di_range[] = {
3511b918d9SHui.Liu 	PIN_FIELD(0, 177, 0x0200, 0x10, 0, 1),
3611b918d9SHui.Liu };
3711b918d9SHui.Liu 
3811b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_do_range[] = {
3911b918d9SHui.Liu 	PIN_FIELD(0, 177, 0x0100, 0x10, 0, 1),
4011b918d9SHui.Liu };
4111b918d9SHui.Liu 
4211b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_smt_range[] = {
4311b918d9SHui.Liu 	PIN_FIELD_BASE(0, 0, 1, 0x0170, 0x10, 8, 1),
4411b918d9SHui.Liu 	PIN_FIELD_BASE(1, 1, 1, 0x0170, 0x10, 9, 1),
4511b918d9SHui.Liu 	PIN_FIELD_BASE(2, 2, 1, 0x0170, 0x10, 10, 1),
4611b918d9SHui.Liu 	PIN_FIELD_BASE(3, 3, 1, 0x0170, 0x10, 11, 1),
4711b918d9SHui.Liu 	PIN_FIELD_BASE(4, 4, 1, 0x0170, 0x10, 18, 1),
4811b918d9SHui.Liu 	PIN_FIELD_BASE(5, 5, 1, 0x0170, 0x10, 18, 1),
4911b918d9SHui.Liu 	PIN_FIELD_BASE(6, 6, 1, 0x0170, 0x10, 18, 1),
5011b918d9SHui.Liu 	PIN_FIELD_BASE(7, 7, 1, 0x0170, 0x10, 12, 1),
5111b918d9SHui.Liu 	PIN_FIELD_BASE(8, 8, 1, 0x0170, 0x10, 13, 1),
5211b918d9SHui.Liu 	PIN_FIELD_BASE(9, 9, 1, 0x0170, 0x10, 14, 1),
5311b918d9SHui.Liu 	PIN_FIELD_BASE(10, 10, 1, 0x0170, 0x10, 15, 1),
5411b918d9SHui.Liu 	PIN_FIELD_BASE(11, 11, 1, 0x0170, 0x10, 19, 1),
5511b918d9SHui.Liu 	PIN_FIELD_BASE(12, 12, 2, 0x0160, 0x10, 12, 1),
5611b918d9SHui.Liu 	PIN_FIELD_BASE(13, 13, 2, 0x0160, 0x10, 13, 1),
5711b918d9SHui.Liu 	PIN_FIELD_BASE(14, 14, 2, 0x0160, 0x10, 14, 1),
5811b918d9SHui.Liu 	PIN_FIELD_BASE(15, 15, 2, 0x0160, 0x10, 15, 1),
5911b918d9SHui.Liu 	PIN_FIELD_BASE(16, 16, 3, 0x00d0, 0x10, 10, 1),
6011b918d9SHui.Liu 	PIN_FIELD_BASE(17, 17, 3, 0x00d0, 0x10, 10, 1),
6111b918d9SHui.Liu 	PIN_FIELD_BASE(18, 18, 4, 0x00e0, 0x10, 9, 1),
6211b918d9SHui.Liu 	PIN_FIELD_BASE(19, 19, 4, 0x00e0, 0x10, 9, 1),
6311b918d9SHui.Liu 	PIN_FIELD_BASE(20, 20, 4, 0x00e0, 0x10, 9, 1),
6411b918d9SHui.Liu 	PIN_FIELD_BASE(21, 21, 4, 0x00e0, 0x10, 9, 1),
6511b918d9SHui.Liu 	PIN_FIELD_BASE(22, 22, 4, 0x00e0, 0x10, 0, 1),
6611b918d9SHui.Liu 	PIN_FIELD_BASE(23, 23, 4, 0x00e0, 0x10, 1, 1),
6711b918d9SHui.Liu 	PIN_FIELD_BASE(24, 24, 4, 0x00e0, 0x10, 2, 1),
6811b918d9SHui.Liu 	PIN_FIELD_BASE(25, 25, 1, 0x0170, 0x10, 17, 1),
6911b918d9SHui.Liu 	PIN_FIELD_BASE(26, 26, 1, 0x0170, 0x10, 17, 1),
7011b918d9SHui.Liu 	PIN_FIELD_BASE(27, 27, 1, 0x0170, 0x10, 17, 1),
7111b918d9SHui.Liu 	PIN_FIELD_BASE(28, 28, 1, 0x0170, 0x10, 18, 1),
7211b918d9SHui.Liu 	PIN_FIELD_BASE(29, 29, 1, 0x0170, 0x10, 16, 1),
7311b918d9SHui.Liu 	PIN_FIELD_BASE(30, 30, 1, 0x0170, 0x10, 17, 1),
7411b918d9SHui.Liu 	PIN_FIELD_BASE(31, 31, 1, 0x0170, 0x10, 19, 1),
7511b918d9SHui.Liu 	PIN_FIELD_BASE(32, 32, 1, 0x0170, 0x10, 19, 1),
7611b918d9SHui.Liu 	PIN_FIELD_BASE(33, 33, 1, 0x0170, 0x10, 20, 1),
7711b918d9SHui.Liu 	PIN_FIELD_BASE(34, 34, 1, 0x0170, 0x10, 20, 1),
7811b918d9SHui.Liu 	PIN_FIELD_BASE(35, 35, 1, 0x0170, 0x10, 19, 1),
7911b918d9SHui.Liu 	PIN_FIELD_BASE(36, 36, 1, 0x0170, 0x10, 20, 1),
8011b918d9SHui.Liu 	PIN_FIELD_BASE(37, 37, 1, 0x0170, 0x10, 21, 1),
8111b918d9SHui.Liu 	PIN_FIELD_BASE(38, 38, 1, 0x0170, 0x10, 20, 1),
8211b918d9SHui.Liu 	PIN_FIELD_BASE(39, 39, 1, 0x0170, 0x10, 21, 1),
8311b918d9SHui.Liu 	PIN_FIELD_BASE(40, 40, 1, 0x0170, 0x10, 21, 1),
8411b918d9SHui.Liu 	PIN_FIELD_BASE(41, 41, 1, 0x0170, 0x10, 21, 1),
8511b918d9SHui.Liu 	PIN_FIELD_BASE(42, 42, 2, 0x0160, 0x10, 21, 1),
8611b918d9SHui.Liu 	PIN_FIELD_BASE(43, 43, 2, 0x0160, 0x10, 22, 1),
8711b918d9SHui.Liu 	PIN_FIELD_BASE(44, 44, 2, 0x0160, 0x10, 21, 1),
8811b918d9SHui.Liu 	PIN_FIELD_BASE(45, 45, 2, 0x0160, 0x10, 22, 1),
8911b918d9SHui.Liu 	PIN_FIELD_BASE(46, 46, 3, 0x00d0, 0x10, 10, 1),
9011b918d9SHui.Liu 	PIN_FIELD_BASE(47, 47, 1, 0x0170, 0x10, 16, 1),
9111b918d9SHui.Liu 	PIN_FIELD_BASE(48, 48, 1, 0x0170, 0x10, 16, 1),
9211b918d9SHui.Liu 	PIN_FIELD_BASE(49, 49, 1, 0x0170, 0x10, 16, 1),
9311b918d9SHui.Liu 	PIN_FIELD_BASE(50, 50, 3, 0x00d0, 0x10, 10, 1),
9411b918d9SHui.Liu 	PIN_FIELD_BASE(51, 51, 3, 0x00d0, 0x10, 11, 1),
9511b918d9SHui.Liu 	PIN_FIELD_BASE(52, 52, 3, 0x00d0, 0x10, 11, 1),
9611b918d9SHui.Liu 	PIN_FIELD_BASE(53, 53, 3, 0x00d0, 0x10, 11, 1),
9711b918d9SHui.Liu 	PIN_FIELD_BASE(54, 54, 3, 0x00d0, 0x10, 11, 1),
9811b918d9SHui.Liu 	PIN_FIELD_BASE(55, 55, 1, 0x0170, 0x10, 25, 1),
9911b918d9SHui.Liu 	PIN_FIELD_BASE(56, 56, 1, 0x0170, 0x10, 28, 1),
10011b918d9SHui.Liu 	PIN_FIELD_BASE(57, 57, 2, 0x0160, 0x10, 29, 1),
10111b918d9SHui.Liu 	PIN_FIELD_BASE(58, 58, 2, 0x0160, 0x10, 31, 1),
10211b918d9SHui.Liu 	PIN_FIELD_BASE(59, 59, 1, 0x0170, 0x10, 26, 1),
10311b918d9SHui.Liu 	PIN_FIELD_BASE(60, 60, 1, 0x0170, 0x10, 29, 1),
10411b918d9SHui.Liu 	PIN_FIELD_BASE(61, 61, 1, 0x0170, 0x10, 27, 1),
10511b918d9SHui.Liu 	PIN_FIELD_BASE(62, 62, 1, 0x0170, 0x10, 30, 1),
10611b918d9SHui.Liu 	PIN_FIELD_BASE(63, 63, 2, 0x0160, 0x10, 30, 1),
10711b918d9SHui.Liu 	PIN_FIELD_BASE(64, 64, 2, 0x0170, 0x10, 0, 1),
10811b918d9SHui.Liu 	PIN_FIELD_BASE(65, 65, 4, 0x00e0, 0x10, 10, 1),
10911b918d9SHui.Liu 	PIN_FIELD_BASE(66, 66, 4, 0x00e0, 0x10, 12, 1),
11011b918d9SHui.Liu 	PIN_FIELD_BASE(67, 67, 4, 0x00e0, 0x10, 11, 1),
11111b918d9SHui.Liu 	PIN_FIELD_BASE(68, 68, 4, 0x00e0, 0x10, 13, 1),
11211b918d9SHui.Liu 	PIN_FIELD_BASE(69, 69, 1, 0x0180, 0x10, 0, 1),
11311b918d9SHui.Liu 	PIN_FIELD_BASE(70, 70, 1, 0x0170, 0x10, 31, 1),
11411b918d9SHui.Liu 	PIN_FIELD_BASE(71, 71, 1, 0x0180, 0x10, 4, 1),
11511b918d9SHui.Liu 	PIN_FIELD_BASE(72, 72, 1, 0x0180, 0x10, 3, 1),
11611b918d9SHui.Liu 	PIN_FIELD_BASE(73, 73, 1, 0x0180, 0x10, 1, 1),
11711b918d9SHui.Liu 	PIN_FIELD_BASE(74, 74, 1, 0x0180, 0x10, 2, 1),
11811b918d9SHui.Liu 	PIN_FIELD_BASE(75, 75, 1, 0x0180, 0x10, 6, 1),
11911b918d9SHui.Liu 	PIN_FIELD_BASE(76, 76, 1, 0x0180, 0x10, 5, 1),
12011b918d9SHui.Liu 	PIN_FIELD_BASE(77, 77, 1, 0x0180, 0x10, 8, 1),
12111b918d9SHui.Liu 	PIN_FIELD_BASE(78, 78, 1, 0x0180, 0x10, 7, 1),
12211b918d9SHui.Liu 	PIN_FIELD_BASE(79, 79, 4, 0x00e0, 0x10, 15, 1),
12311b918d9SHui.Liu 	PIN_FIELD_BASE(80, 80, 4, 0x00e0, 0x10, 14, 1),
12411b918d9SHui.Liu 	PIN_FIELD_BASE(81, 81, 4, 0x00e0, 0x10, 17, 1),
12511b918d9SHui.Liu 	PIN_FIELD_BASE(82, 82, 4, 0x00e0, 0x10, 16, 1),
12611b918d9SHui.Liu 	PIN_FIELD_BASE(83, 83, 2, 0x0160, 0x10, 26, 1),
12711b918d9SHui.Liu 	PIN_FIELD_BASE(84, 84, 2, 0x0160, 0x10, 26, 1),
12811b918d9SHui.Liu 	PIN_FIELD_BASE(85, 85, 2, 0x0160, 0x10, 27, 1),
12911b918d9SHui.Liu 	PIN_FIELD_BASE(86, 86, 2, 0x0160, 0x10, 17, 1),
13011b918d9SHui.Liu 	PIN_FIELD_BASE(87, 87, 2, 0x0160, 0x10, 17, 1),
13111b918d9SHui.Liu 	PIN_FIELD_BASE(88, 88, 2, 0x0160, 0x10, 17, 1),
13211b918d9SHui.Liu 	PIN_FIELD_BASE(89, 89, 2, 0x0160, 0x10, 17, 1),
13311b918d9SHui.Liu 	PIN_FIELD_BASE(90, 90, 2, 0x0160, 0x10, 27, 1),
13411b918d9SHui.Liu 	PIN_FIELD_BASE(91, 91, 2, 0x0160, 0x10, 27, 1),
13511b918d9SHui.Liu 	PIN_FIELD_BASE(92, 92, 2, 0x0160, 0x10, 18, 1),
13611b918d9SHui.Liu 	PIN_FIELD_BASE(93, 93, 2, 0x0160, 0x10, 18, 1),
13711b918d9SHui.Liu 	PIN_FIELD_BASE(94, 94, 2, 0x0160, 0x10, 18, 1),
13811b918d9SHui.Liu 	PIN_FIELD_BASE(95, 95, 2, 0x0160, 0x10, 18, 1),
13911b918d9SHui.Liu 	PIN_FIELD_BASE(96, 96, 2, 0x0160, 0x10, 22, 1),
14011b918d9SHui.Liu 	PIN_FIELD_BASE(97, 97, 2, 0x0160, 0x10, 23, 1),
14111b918d9SHui.Liu 	PIN_FIELD_BASE(98, 98, 2, 0x0160, 0x10, 24, 1),
14211b918d9SHui.Liu 	PIN_FIELD_BASE(99, 99, 2, 0x0160, 0x10, 22, 1),
14311b918d9SHui.Liu 	PIN_FIELD_BASE(100, 100, 2, 0x0160, 0x10, 16, 1),
14411b918d9SHui.Liu 	PIN_FIELD_BASE(101, 101, 2, 0x0160, 0x10, 23, 1),
14511b918d9SHui.Liu 	PIN_FIELD_BASE(102, 102, 2, 0x0160, 0x10, 23, 1),
14611b918d9SHui.Liu 	PIN_FIELD_BASE(103, 103, 2, 0x0160, 0x10, 23, 1),
14711b918d9SHui.Liu 	PIN_FIELD_BASE(104, 104, 2, 0x0160, 0x10, 24, 1),
14811b918d9SHui.Liu 	PIN_FIELD_BASE(105, 105, 2, 0x0160, 0x10, 24, 1),
14911b918d9SHui.Liu 	PIN_FIELD_BASE(106, 106, 2, 0x0160, 0x10, 24, 1),
15011b918d9SHui.Liu 	PIN_FIELD_BASE(107, 107, 2, 0x0160, 0x10, 17, 1),
15111b918d9SHui.Liu 	PIN_FIELD_BASE(108, 108, 2, 0x0160, 0x10, 17, 1),
15211b918d9SHui.Liu 	PIN_FIELD_BASE(109, 109, 2, 0x0160, 0x10, 17, 1),
15311b918d9SHui.Liu 	PIN_FIELD_BASE(110, 110, 2, 0x0160, 0x10, 17, 1),
15411b918d9SHui.Liu 	PIN_FIELD_BASE(111, 111, 2, 0x0160, 0x10, 19, 1),
15511b918d9SHui.Liu 	PIN_FIELD_BASE(112, 112, 2, 0x0160, 0x10, 19, 1),
15611b918d9SHui.Liu 	PIN_FIELD_BASE(113, 113, 2, 0x0160, 0x10, 19, 1),
15711b918d9SHui.Liu 	PIN_FIELD_BASE(114, 114, 2, 0x0160, 0x10, 19, 1),
15811b918d9SHui.Liu 	PIN_FIELD_BASE(115, 115, 2, 0x0160, 0x10, 20, 1),
15911b918d9SHui.Liu 	PIN_FIELD_BASE(116, 116, 2, 0x0160, 0x10, 20, 1),
16011b918d9SHui.Liu 	PIN_FIELD_BASE(117, 117, 2, 0x0160, 0x10, 20, 1),
16111b918d9SHui.Liu 	PIN_FIELD_BASE(118, 118, 2, 0x0160, 0x10, 20, 1),
16211b918d9SHui.Liu 	PIN_FIELD_BASE(119, 119, 2, 0x0160, 0x10, 21, 1),
16311b918d9SHui.Liu 	PIN_FIELD_BASE(120, 120, 2, 0x0160, 0x10, 21, 1),
16411b918d9SHui.Liu 	PIN_FIELD_BASE(121, 121, 3, 0x00d0, 0x10, 6, 1),
16511b918d9SHui.Liu 	PIN_FIELD_BASE(122, 122, 3, 0x00d0, 0x10, 9, 1),
16611b918d9SHui.Liu 	PIN_FIELD_BASE(123, 123, 3, 0x00d0, 0x10, 8, 1),
16711b918d9SHui.Liu 	PIN_FIELD_BASE(124, 124, 3, 0x00d0, 0x10, 7, 1),
16811b918d9SHui.Liu 	PIN_FIELD_BASE(125, 125, 2, 0x0160, 0x10, 25, 1),
16911b918d9SHui.Liu 	PIN_FIELD_BASE(126, 126, 2, 0x0160, 0x10, 25, 1),
17011b918d9SHui.Liu 	PIN_FIELD_BASE(127, 127, 2, 0x0160, 0x10, 25, 1),
17111b918d9SHui.Liu 	PIN_FIELD_BASE(128, 128, 2, 0x0160, 0x10, 25, 1),
17211b918d9SHui.Liu 	PIN_FIELD_BASE(129, 129, 2, 0x0160, 0x10, 26, 1),
17311b918d9SHui.Liu 	PIN_FIELD_BASE(130, 130, 2, 0x0160, 0x10, 26, 1),
17411b918d9SHui.Liu 	PIN_FIELD_BASE(131, 131, 1, 0x0170, 0x10, 0, 1),
17511b918d9SHui.Liu 	PIN_FIELD_BASE(132, 132, 1, 0x0170, 0x10, 1, 1),
17611b918d9SHui.Liu 	PIN_FIELD_BASE(133, 133, 1, 0x0170, 0x10, 6, 1),
17711b918d9SHui.Liu 	PIN_FIELD_BASE(134, 134, 1, 0x0170, 0x10, 7, 1),
17811b918d9SHui.Liu 	PIN_FIELD_BASE(135, 135, 1, 0x0170, 0x10, 22, 1),
17911b918d9SHui.Liu 	PIN_FIELD_BASE(136, 136, 1, 0x0170, 0x10, 22, 1),
18011b918d9SHui.Liu 	PIN_FIELD_BASE(137, 137, 1, 0x0170, 0x10, 22, 1),
18111b918d9SHui.Liu 	PIN_FIELD_BASE(138, 138, 1, 0x0170, 0x10, 22, 1),
18211b918d9SHui.Liu 	PIN_FIELD_BASE(139, 139, 1, 0x0170, 0x10, 23, 1),
18311b918d9SHui.Liu 	PIN_FIELD_BASE(140, 140, 1, 0x0170, 0x10, 23, 1),
18411b918d9SHui.Liu 	PIN_FIELD_BASE(141, 141, 1, 0x0170, 0x10, 23, 1),
18511b918d9SHui.Liu 	PIN_FIELD_BASE(142, 142, 1, 0x0170, 0x10, 23, 1),
18611b918d9SHui.Liu 	PIN_FIELD_BASE(143, 143, 1, 0x0170, 0x10, 2, 1),
18711b918d9SHui.Liu 	PIN_FIELD_BASE(144, 144, 1, 0x0170, 0x10, 3, 1),
18811b918d9SHui.Liu 	PIN_FIELD_BASE(145, 145, 1, 0x0170, 0x10, 4, 1),
18911b918d9SHui.Liu 	PIN_FIELD_BASE(146, 146, 1, 0x0170, 0x10, 5, 1),
19011b918d9SHui.Liu 	PIN_FIELD_BASE(147, 147, 1, 0x0170, 0x10, 24, 1),
19111b918d9SHui.Liu 	PIN_FIELD_BASE(148, 148, 1, 0x0170, 0x10, 24, 1),
19211b918d9SHui.Liu 	PIN_FIELD_BASE(149, 149, 1, 0x0170, 0x10, 24, 1),
19311b918d9SHui.Liu 	PIN_FIELD_BASE(150, 150, 1, 0x0170, 0x10, 24, 1),
19411b918d9SHui.Liu 	PIN_FIELD_BASE(151, 151, 2, 0x0160, 0x10, 9, 1),
19511b918d9SHui.Liu 	PIN_FIELD_BASE(152, 152, 2, 0x0160, 0x10, 8, 1),
19611b918d9SHui.Liu 	PIN_FIELD_BASE(153, 153, 2, 0x0160, 0x10, 7, 1),
19711b918d9SHui.Liu 	PIN_FIELD_BASE(154, 154, 2, 0x0160, 0x10, 6, 1),
19811b918d9SHui.Liu 	PIN_FIELD_BASE(155, 155, 2, 0x0160, 0x10, 11, 1),
19911b918d9SHui.Liu 	PIN_FIELD_BASE(156, 156, 2, 0x0160, 0x10, 1, 1),
20011b918d9SHui.Liu 	PIN_FIELD_BASE(157, 157, 2, 0x0160, 0x10, 0, 1),
20111b918d9SHui.Liu 	PIN_FIELD_BASE(158, 158, 2, 0x0160, 0x10, 5, 1),
20211b918d9SHui.Liu 	PIN_FIELD_BASE(159, 159, 2, 0x0160, 0x10, 4, 1),
20311b918d9SHui.Liu 	PIN_FIELD_BASE(160, 160, 2, 0x0160, 0x10, 3, 1),
20411b918d9SHui.Liu 	PIN_FIELD_BASE(161, 161, 2, 0x0160, 0x10, 2, 1),
20511b918d9SHui.Liu 	PIN_FIELD_BASE(162, 162, 2, 0x0160, 0x10, 10, 1),
20611b918d9SHui.Liu 	PIN_FIELD_BASE(163, 163, 4, 0x00e0, 0x10, 4, 1),
20711b918d9SHui.Liu 	PIN_FIELD_BASE(164, 164, 4, 0x00e0, 0x10, 3, 1),
20811b918d9SHui.Liu 	PIN_FIELD_BASE(165, 165, 4, 0x00e0, 0x10, 5, 1),
20911b918d9SHui.Liu 	PIN_FIELD_BASE(166, 166, 4, 0x00e0, 0x10, 6, 1),
21011b918d9SHui.Liu 	PIN_FIELD_BASE(167, 167, 4, 0x00e0, 0x10, 7, 1),
21111b918d9SHui.Liu 	PIN_FIELD_BASE(168, 168, 4, 0x00e0, 0x10, 8, 1),
21211b918d9SHui.Liu 	PIN_FIELD_BASE(169, 169, 3, 0x00d0, 0x10, 1, 1),
21311b918d9SHui.Liu 	PIN_FIELD_BASE(170, 170, 3, 0x00d0, 0x10, 0, 1),
21411b918d9SHui.Liu 	PIN_FIELD_BASE(171, 171, 3, 0x00d0, 0x10, 2, 1),
21511b918d9SHui.Liu 	PIN_FIELD_BASE(172, 172, 3, 0x00d0, 0x10, 3, 1),
21611b918d9SHui.Liu 	PIN_FIELD_BASE(173, 173, 3, 0x00d0, 0x10, 4, 1),
21711b918d9SHui.Liu 	PIN_FIELD_BASE(174, 174, 3, 0x00d0, 0x10, 5, 1),
21811b918d9SHui.Liu 	PIN_FIELD_BASE(175, 175, 2, 0x0160, 0x10, 28, 1),
21911b918d9SHui.Liu 	PIN_FIELD_BASE(176, 176, 2, 0x0160, 0x10, 28, 1),
22011b918d9SHui.Liu };
22111b918d9SHui.Liu 
22211b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_ies_range[] = {
22311b918d9SHui.Liu 	PIN_FIELD_BASE(0, 0, 1, 0x0080, 0x10, 26, 1),
22411b918d9SHui.Liu 	PIN_FIELD_BASE(1, 1, 1, 0x0080, 0x10, 27, 1),
22511b918d9SHui.Liu 	PIN_FIELD_BASE(2, 2, 1, 0x0080, 0x10, 28, 1),
22611b918d9SHui.Liu 	PIN_FIELD_BASE(3, 3, 1, 0x0080, 0x10, 29, 1),
22711b918d9SHui.Liu 	PIN_FIELD_BASE(4, 4, 1, 0x0080, 0x10, 30, 1),
22811b918d9SHui.Liu 	PIN_FIELD_BASE(5, 5, 1, 0x0080, 0x10, 31, 1),
22911b918d9SHui.Liu 	PIN_FIELD_BASE(6, 6, 1, 0x0090, 0x10, 0, 1),
23011b918d9SHui.Liu 	PIN_FIELD_BASE(7, 7, 1, 0x0090, 0x10, 1, 1),
23111b918d9SHui.Liu 	PIN_FIELD_BASE(8, 8, 1, 0x0090, 0x10, 2, 1),
23211b918d9SHui.Liu 	PIN_FIELD_BASE(9, 9, 1, 0x0090, 0x10, 3, 1),
23311b918d9SHui.Liu 	PIN_FIELD_BASE(10, 10, 1, 0x0090, 0x10, 4, 1),
23411b918d9SHui.Liu 	PIN_FIELD_BASE(11, 11, 1, 0x0090, 0x10, 5, 1),
23511b918d9SHui.Liu 	PIN_FIELD_BASE(12, 12, 2, 0x0070, 0x10, 24, 1),
23611b918d9SHui.Liu 	PIN_FIELD_BASE(13, 13, 2, 0x0070, 0x10, 25, 1),
23711b918d9SHui.Liu 	PIN_FIELD_BASE(14, 14, 2, 0x0070, 0x10, 26, 1),
23811b918d9SHui.Liu 	PIN_FIELD_BASE(15, 15, 2, 0x0070, 0x10, 27, 1),
23911b918d9SHui.Liu 	PIN_FIELD_BASE(16, 16, 3, 0x0040, 0x10, 1, 1),
24011b918d9SHui.Liu 	PIN_FIELD_BASE(17, 17, 3, 0x0040, 0x10, 2, 1),
24111b918d9SHui.Liu 	PIN_FIELD_BASE(18, 18, 4, 0x0050, 0x10, 3, 1),
24211b918d9SHui.Liu 	PIN_FIELD_BASE(19, 19, 4, 0x0050, 0x10, 5, 1),
24311b918d9SHui.Liu 	PIN_FIELD_BASE(20, 20, 4, 0x0050, 0x10, 4, 1),
24411b918d9SHui.Liu 	PIN_FIELD_BASE(21, 21, 4, 0x0050, 0x10, 6, 1),
24511b918d9SHui.Liu 	PIN_FIELD_BASE(22, 22, 4, 0x0050, 0x10, 0, 1),
24611b918d9SHui.Liu 	PIN_FIELD_BASE(23, 23, 4, 0x0050, 0x10, 1, 1),
24711b918d9SHui.Liu 	PIN_FIELD_BASE(24, 24, 4, 0x0050, 0x10, 2, 1),
24811b918d9SHui.Liu 	PIN_FIELD_BASE(25, 25, 1, 0x0080, 0x10, 23, 1),
24911b918d9SHui.Liu 	PIN_FIELD_BASE(26, 26, 1, 0x0080, 0x10, 22, 1),
25011b918d9SHui.Liu 	PIN_FIELD_BASE(27, 27, 1, 0x0080, 0x10, 25, 1),
25111b918d9SHui.Liu 	PIN_FIELD_BASE(28, 28, 1, 0x0080, 0x10, 24, 1),
25211b918d9SHui.Liu 	PIN_FIELD_BASE(29, 29, 1, 0x0080, 0x10, 0, 1),
25311b918d9SHui.Liu 	PIN_FIELD_BASE(30, 30, 1, 0x0080, 0x10, 1, 1),
25411b918d9SHui.Liu 	PIN_FIELD_BASE(31, 31, 1, 0x0090, 0x10, 31, 1),
25511b918d9SHui.Liu 	PIN_FIELD_BASE(32, 32, 1, 0x0090, 0x10, 30, 1),
25611b918d9SHui.Liu 	PIN_FIELD_BASE(33, 33, 1, 0x00a0, 0x10, 1, 1),
25711b918d9SHui.Liu 	PIN_FIELD_BASE(34, 34, 1, 0x00a0, 0x10, 0, 1),
25811b918d9SHui.Liu 	PIN_FIELD_BASE(35, 35, 1, 0x00a0, 0x10, 3, 1),
25911b918d9SHui.Liu 	PIN_FIELD_BASE(36, 36, 1, 0x00a0, 0x10, 2, 1),
26011b918d9SHui.Liu 	PIN_FIELD_BASE(37, 37, 1, 0x0090, 0x10, 9, 1),
26111b918d9SHui.Liu 	PIN_FIELD_BASE(38, 38, 1, 0x0090, 0x10, 6, 1),
26211b918d9SHui.Liu 	PIN_FIELD_BASE(39, 39, 1, 0x0090, 0x10, 7, 1),
26311b918d9SHui.Liu 	PIN_FIELD_BASE(40, 40, 1, 0x0090, 0x10, 8, 1),
26411b918d9SHui.Liu 	PIN_FIELD_BASE(41, 41, 1, 0x0090, 0x10, 10, 1),
26511b918d9SHui.Liu 	PIN_FIELD_BASE(42, 42, 2, 0x0080, 0x10, 10, 1),
26611b918d9SHui.Liu 	PIN_FIELD_BASE(43, 43, 2, 0x0080, 0x10, 11, 1),
26711b918d9SHui.Liu 	PIN_FIELD_BASE(44, 44, 2, 0x0080, 0x10, 12, 1),
26811b918d9SHui.Liu 	PIN_FIELD_BASE(45, 45, 2, 0x0080, 0x10, 13, 1),
26911b918d9SHui.Liu 	PIN_FIELD_BASE(46, 46, 3, 0x0040, 0x10, 0, 1),
27011b918d9SHui.Liu 	PIN_FIELD_BASE(47, 47, 1, 0x0090, 0x10, 13, 1),
27111b918d9SHui.Liu 	PIN_FIELD_BASE(48, 48, 1, 0x0090, 0x10, 12, 1),
27211b918d9SHui.Liu 	PIN_FIELD_BASE(49, 49, 1, 0x0090, 0x10, 11, 1),
27311b918d9SHui.Liu 	PIN_FIELD_BASE(50, 50, 3, 0x0040, 0x10, 5, 1),
27411b918d9SHui.Liu 	PIN_FIELD_BASE(51, 51, 3, 0x0040, 0x10, 4, 1),
27511b918d9SHui.Liu 	PIN_FIELD_BASE(52, 52, 3, 0x0040, 0x10, 3, 1),
27611b918d9SHui.Liu 	PIN_FIELD_BASE(53, 53, 3, 0x0040, 0x10, 6, 1),
27711b918d9SHui.Liu 	PIN_FIELD_BASE(54, 54, 3, 0x0040, 0x10, 7, 1),
27811b918d9SHui.Liu 	PIN_FIELD_BASE(55, 55, 1, 0x0090, 0x10, 14, 1),
27911b918d9SHui.Liu 	PIN_FIELD_BASE(56, 56, 1, 0x0090, 0x10, 17, 1),
28011b918d9SHui.Liu 	PIN_FIELD_BASE(57, 57, 2, 0x0080, 0x10, 22, 1),
28111b918d9SHui.Liu 	PIN_FIELD_BASE(58, 58, 2, 0x0080, 0x10, 25, 1),
28211b918d9SHui.Liu 	PIN_FIELD_BASE(59, 59, 1, 0x0090, 0x10, 15, 1),
28311b918d9SHui.Liu 	PIN_FIELD_BASE(60, 60, 1, 0x0090, 0x10, 18, 1),
28411b918d9SHui.Liu 	PIN_FIELD_BASE(61, 61, 1, 0x0090, 0x10, 16, 1),
28511b918d9SHui.Liu 	PIN_FIELD_BASE(62, 62, 1, 0x0090, 0x10, 19, 1),
28611b918d9SHui.Liu 	PIN_FIELD_BASE(63, 63, 2, 0x0080, 0x10, 23, 1),
28711b918d9SHui.Liu 	PIN_FIELD_BASE(64, 64, 2, 0x0080, 0x10, 26, 1),
28811b918d9SHui.Liu 	PIN_FIELD_BASE(65, 65, 4, 0x0050, 0x10, 13, 1),
28911b918d9SHui.Liu 	PIN_FIELD_BASE(66, 66, 4, 0x0050, 0x10, 15, 1),
29011b918d9SHui.Liu 	PIN_FIELD_BASE(67, 67, 4, 0x0050, 0x10, 14, 1),
29111b918d9SHui.Liu 	PIN_FIELD_BASE(68, 68, 4, 0x0050, 0x10, 16, 1),
29211b918d9SHui.Liu 	PIN_FIELD_BASE(69, 69, 1, 0x0090, 0x10, 21, 1),
29311b918d9SHui.Liu 	PIN_FIELD_BASE(70, 70, 1, 0x0090, 0x10, 20, 1),
29411b918d9SHui.Liu 	PIN_FIELD_BASE(71, 71, 1, 0x0090, 0x10, 25, 1),
29511b918d9SHui.Liu 	PIN_FIELD_BASE(72, 72, 1, 0x0090, 0x10, 24, 1),
29611b918d9SHui.Liu 	PIN_FIELD_BASE(73, 73, 1, 0x0090, 0x10, 22, 1),
29711b918d9SHui.Liu 	PIN_FIELD_BASE(74, 74, 1, 0x0090, 0x10, 23, 1),
29811b918d9SHui.Liu 	PIN_FIELD_BASE(75, 75, 1, 0x0090, 0x10, 27, 1),
29911b918d9SHui.Liu 	PIN_FIELD_BASE(76, 76, 1, 0x0090, 0x10, 26, 1),
30011b918d9SHui.Liu 	PIN_FIELD_BASE(77, 77, 1, 0x0090, 0x10, 29, 1),
30111b918d9SHui.Liu 	PIN_FIELD_BASE(78, 78, 1, 0x0090, 0x10, 28, 1),
30211b918d9SHui.Liu 	PIN_FIELD_BASE(79, 79, 4, 0x0050, 0x10, 18, 1),
30311b918d9SHui.Liu 	PIN_FIELD_BASE(80, 80, 4, 0x0050, 0x10, 17, 1),
30411b918d9SHui.Liu 	PIN_FIELD_BASE(81, 81, 4, 0x0050, 0x10, 20, 1),
30511b918d9SHui.Liu 	PIN_FIELD_BASE(82, 82, 4, 0x0050, 0x10, 19, 1),
30611b918d9SHui.Liu 	PIN_FIELD_BASE(83, 83, 2, 0x0080, 0x10, 30, 1),
30711b918d9SHui.Liu 	PIN_FIELD_BASE(84, 84, 2, 0x0080, 0x10, 29, 1),
30811b918d9SHui.Liu 	PIN_FIELD_BASE(85, 85, 2, 0x0080, 0x10, 31, 1),
30911b918d9SHui.Liu 	PIN_FIELD_BASE(86, 86, 2, 0x0090, 0x10, 1, 1),
31011b918d9SHui.Liu 	PIN_FIELD_BASE(87, 87, 2, 0x0090, 0x10, 0, 1),
31111b918d9SHui.Liu 	PIN_FIELD_BASE(88, 88, 2, 0x0090, 0x10, 2, 1),
31211b918d9SHui.Liu 	PIN_FIELD_BASE(89, 89, 2, 0x0090, 0x10, 4, 1),
31311b918d9SHui.Liu 	PIN_FIELD_BASE(90, 90, 2, 0x0090, 0x10, 3, 1),
31411b918d9SHui.Liu 	PIN_FIELD_BASE(91, 91, 2, 0x0090, 0x10, 5, 1),
31511b918d9SHui.Liu 	PIN_FIELD_BASE(92, 92, 2, 0x0080, 0x10, 19, 1),
31611b918d9SHui.Liu 	PIN_FIELD_BASE(93, 93, 2, 0x0080, 0x10, 18, 1),
31711b918d9SHui.Liu 	PIN_FIELD_BASE(94, 94, 2, 0x0080, 0x10, 21, 1),
31811b918d9SHui.Liu 	PIN_FIELD_BASE(95, 95, 2, 0x0080, 0x10, 20, 1),
31911b918d9SHui.Liu 	PIN_FIELD_BASE(96, 96, 2, 0x0080, 0x10, 15, 1),
32011b918d9SHui.Liu 	PIN_FIELD_BASE(97, 97, 2, 0x0080, 0x10, 16, 1),
32111b918d9SHui.Liu 	PIN_FIELD_BASE(98, 98, 2, 0x0080, 0x10, 24, 1),
32211b918d9SHui.Liu 	PIN_FIELD_BASE(99, 99, 2, 0x0080, 0x10, 14, 1),
32311b918d9SHui.Liu 	PIN_FIELD_BASE(100, 100, 2, 0x0080, 0x10, 17, 1),
32411b918d9SHui.Liu 	PIN_FIELD_BASE(101, 101, 2, 0x0070, 0x10, 0, 1),
32511b918d9SHui.Liu 	PIN_FIELD_BASE(102, 102, 2, 0x0070, 0x10, 5, 1),
32611b918d9SHui.Liu 	PIN_FIELD_BASE(103, 103, 2, 0x0070, 0x10, 3, 1),
32711b918d9SHui.Liu 	PIN_FIELD_BASE(104, 104, 2, 0x0070, 0x10, 4, 1),
32811b918d9SHui.Liu 	PIN_FIELD_BASE(105, 105, 2, 0x0070, 0x10, 1, 1),
32911b918d9SHui.Liu 	PIN_FIELD_BASE(106, 106, 2, 0x0070, 0x10, 2, 1),
33011b918d9SHui.Liu 	PIN_FIELD_BASE(107, 107, 2, 0x0080, 0x10, 1, 1),
33111b918d9SHui.Liu 	PIN_FIELD_BASE(108, 108, 2, 0x0070, 0x10, 28, 1),
33211b918d9SHui.Liu 	PIN_FIELD_BASE(109, 109, 2, 0x0080, 0x10, 2, 1),
33311b918d9SHui.Liu 	PIN_FIELD_BASE(110, 110, 2, 0x0070, 0x10, 29, 1),
33411b918d9SHui.Liu 	PIN_FIELD_BASE(111, 111, 2, 0x0070, 0x10, 30, 1),
33511b918d9SHui.Liu 	PIN_FIELD_BASE(112, 112, 2, 0x0070, 0x10, 31, 1),
33611b918d9SHui.Liu 	PIN_FIELD_BASE(113, 113, 2, 0x0080, 0x10, 0, 1),
33711b918d9SHui.Liu 	PIN_FIELD_BASE(114, 114, 2, 0x0080, 0x10, 8, 1),
33811b918d9SHui.Liu 	PIN_FIELD_BASE(115, 115, 2, 0x0080, 0x10, 3, 1),
33911b918d9SHui.Liu 	PIN_FIELD_BASE(116, 116, 2, 0x0080, 0x10, 9, 1),
34011b918d9SHui.Liu 	PIN_FIELD_BASE(117, 117, 2, 0x0080, 0x10, 4, 1),
34111b918d9SHui.Liu 	PIN_FIELD_BASE(118, 118, 2, 0x0080, 0x10, 5, 1),
34211b918d9SHui.Liu 	PIN_FIELD_BASE(119, 119, 2, 0x0080, 0x10, 6, 1),
34311b918d9SHui.Liu 	PIN_FIELD_BASE(120, 120, 2, 0x0080, 0x10, 7, 1),
34411b918d9SHui.Liu 	PIN_FIELD_BASE(121, 121, 3, 0x0040, 0x10, 14, 1),
34511b918d9SHui.Liu 	PIN_FIELD_BASE(122, 122, 3, 0x0040, 0x10, 17, 1),
34611b918d9SHui.Liu 	PIN_FIELD_BASE(123, 123, 3, 0x0040, 0x10, 16, 1),
34711b918d9SHui.Liu 	PIN_FIELD_BASE(124, 124, 3, 0x0040, 0x10, 15, 1),
34811b918d9SHui.Liu 	PIN_FIELD_BASE(125, 125, 2, 0x0070, 0x10, 6, 1),
34911b918d9SHui.Liu 	PIN_FIELD_BASE(126, 126, 2, 0x0070, 0x10, 7, 1),
35011b918d9SHui.Liu 	PIN_FIELD_BASE(127, 127, 2, 0x0070, 0x10, 8, 1),
35111b918d9SHui.Liu 	PIN_FIELD_BASE(128, 128, 2, 0x0070, 0x10, 9, 1),
35211b918d9SHui.Liu 	PIN_FIELD_BASE(129, 129, 2, 0x0070, 0x10, 10, 1),
35311b918d9SHui.Liu 	PIN_FIELD_BASE(130, 130, 2, 0x0070, 0x10, 11, 1),
35411b918d9SHui.Liu 	PIN_FIELD_BASE(131, 131, 1, 0x0080, 0x10, 3, 1),
35511b918d9SHui.Liu 	PIN_FIELD_BASE(132, 132, 1, 0x0080, 0x10, 4, 1),
35611b918d9SHui.Liu 	PIN_FIELD_BASE(133, 133, 1, 0x0080, 0x10, 11, 1),
35711b918d9SHui.Liu 	PIN_FIELD_BASE(134, 134, 1, 0x0080, 0x10, 12, 1),
35811b918d9SHui.Liu 	PIN_FIELD_BASE(135, 135, 1, 0x0080, 0x10, 13, 1),
35911b918d9SHui.Liu 	PIN_FIELD_BASE(136, 136, 1, 0x0080, 0x10, 14, 1),
36011b918d9SHui.Liu 	PIN_FIELD_BASE(137, 137, 1, 0x0080, 0x10, 15, 1),
36111b918d9SHui.Liu 	PIN_FIELD_BASE(138, 138, 1, 0x0080, 0x10, 16, 1),
36211b918d9SHui.Liu 	PIN_FIELD_BASE(139, 139, 1, 0x0080, 0x10, 17, 1),
36311b918d9SHui.Liu 	PIN_FIELD_BASE(140, 140, 1, 0x0080, 0x10, 18, 1),
36411b918d9SHui.Liu 	PIN_FIELD_BASE(141, 141, 1, 0x0080, 0x10, 5, 1),
36511b918d9SHui.Liu 	PIN_FIELD_BASE(142, 142, 1, 0x0080, 0x10, 6, 1),
36611b918d9SHui.Liu 	PIN_FIELD_BASE(143, 143, 1, 0x0080, 0x10, 7, 1),
36711b918d9SHui.Liu 	PIN_FIELD_BASE(144, 144, 1, 0x0080, 0x10, 8, 1),
36811b918d9SHui.Liu 	PIN_FIELD_BASE(145, 145, 1, 0x0080, 0x10, 9, 1),
36911b918d9SHui.Liu 	PIN_FIELD_BASE(146, 146, 1, 0x0080, 0x10, 10, 1),
37011b918d9SHui.Liu 	PIN_FIELD_BASE(147, 147, 1, 0x0080, 0x10, 20, 1),
37111b918d9SHui.Liu 	PIN_FIELD_BASE(148, 148, 1, 0x0080, 0x10, 21, 1),
37211b918d9SHui.Liu 	PIN_FIELD_BASE(149, 149, 1, 0x0080, 0x10, 19, 1),
37311b918d9SHui.Liu 	PIN_FIELD_BASE(150, 150, 1, 0x0080, 0x10, 2, 1),
37411b918d9SHui.Liu 	PIN_FIELD_BASE(151, 151, 2, 0x0070, 0x10, 21, 1),
37511b918d9SHui.Liu 	PIN_FIELD_BASE(152, 152, 2, 0x0070, 0x10, 20, 1),
37611b918d9SHui.Liu 	PIN_FIELD_BASE(153, 153, 2, 0x0070, 0x10, 19, 1),
37711b918d9SHui.Liu 	PIN_FIELD_BASE(154, 154, 2, 0x0070, 0x10, 18, 1),
37811b918d9SHui.Liu 	PIN_FIELD_BASE(155, 155, 2, 0x0070, 0x10, 23, 1),
37911b918d9SHui.Liu 	PIN_FIELD_BASE(156, 156, 2, 0x0070, 0x10, 13, 1),
38011b918d9SHui.Liu 	PIN_FIELD_BASE(157, 157, 2, 0x0070, 0x10, 12, 1),
38111b918d9SHui.Liu 	PIN_FIELD_BASE(158, 158, 2, 0x0070, 0x10, 17, 1),
38211b918d9SHui.Liu 	PIN_FIELD_BASE(159, 159, 2, 0x0070, 0x10, 16, 1),
38311b918d9SHui.Liu 	PIN_FIELD_BASE(160, 160, 2, 0x0070, 0x10, 15, 1),
38411b918d9SHui.Liu 	PIN_FIELD_BASE(161, 161, 2, 0x0070, 0x10, 14, 1),
38511b918d9SHui.Liu 	PIN_FIELD_BASE(162, 162, 2, 0x0070, 0x10, 22, 1),
38611b918d9SHui.Liu 	PIN_FIELD_BASE(163, 163, 4, 0x0050, 0x10, 8, 1),
38711b918d9SHui.Liu 	PIN_FIELD_BASE(164, 164, 4, 0x0050, 0x10, 7, 1),
38811b918d9SHui.Liu 	PIN_FIELD_BASE(165, 165, 4, 0x0050, 0x10, 9, 1),
38911b918d9SHui.Liu 	PIN_FIELD_BASE(166, 166, 4, 0x0050, 0x10, 10, 1),
39011b918d9SHui.Liu 	PIN_FIELD_BASE(167, 167, 4, 0x0050, 0x10, 11, 1),
39111b918d9SHui.Liu 	PIN_FIELD_BASE(168, 168, 4, 0x0050, 0x10, 12, 1),
39211b918d9SHui.Liu 	PIN_FIELD_BASE(169, 169, 3, 0x0040, 0x10, 9, 1),
39311b918d9SHui.Liu 	PIN_FIELD_BASE(170, 170, 3, 0x0040, 0x10, 8, 1),
39411b918d9SHui.Liu 	PIN_FIELD_BASE(171, 171, 3, 0x0040, 0x10, 10, 1),
39511b918d9SHui.Liu 	PIN_FIELD_BASE(172, 172, 3, 0x0040, 0x10, 11, 1),
39611b918d9SHui.Liu 	PIN_FIELD_BASE(173, 173, 3, 0x0040, 0x10, 12, 1),
39711b918d9SHui.Liu 	PIN_FIELD_BASE(174, 174, 3, 0x0040, 0x10, 13, 1),
39811b918d9SHui.Liu 	PIN_FIELD_BASE(175, 175, 2, 0x0080, 0x10, 27, 1),
39911b918d9SHui.Liu 	PIN_FIELD_BASE(176, 176, 2, 0x0080, 0x10, 28, 1),
40011b918d9SHui.Liu };
40111b918d9SHui.Liu 
40211b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_tdsel_range[] = {
40311b918d9SHui.Liu 	PIN_FIELD_BASE(0, 0, 1, 0x01b0, 0x10, 0, 4),
40411b918d9SHui.Liu 	PIN_FIELD_BASE(1, 1, 1, 0x01b0, 0x10, 4, 4),
40511b918d9SHui.Liu 	PIN_FIELD_BASE(2, 2, 1, 0x01b0, 0x10, 8, 4),
40611b918d9SHui.Liu 	PIN_FIELD_BASE(3, 3, 1, 0x01b0, 0x10, 12, 4),
40711b918d9SHui.Liu 	PIN_FIELD_BASE(4, 4, 1, 0x01c0, 0x10, 16, 4),
40811b918d9SHui.Liu 	PIN_FIELD_BASE(5, 5, 1, 0x01c0, 0x10, 20, 4),
40911b918d9SHui.Liu 	PIN_FIELD_BASE(6, 6, 1, 0x01c0, 0x10, 20, 4),
41011b918d9SHui.Liu 	PIN_FIELD_BASE(7, 7, 1, 0x01b0, 0x10, 16, 4),
41111b918d9SHui.Liu 	PIN_FIELD_BASE(8, 8, 1, 0x01b0, 0x10, 20, 4),
41211b918d9SHui.Liu 	PIN_FIELD_BASE(9, 9, 1, 0x01b0, 0x10, 24, 4),
41311b918d9SHui.Liu 	PIN_FIELD_BASE(10, 10, 1, 0x01b0, 0x10, 28, 4),
41411b918d9SHui.Liu 	PIN_FIELD_BASE(11, 11, 1, 0x01c0, 0x10, 20, 4),
41511b918d9SHui.Liu 	PIN_FIELD_BASE(12, 12, 2, 0x0190, 0x10, 16, 4),
41611b918d9SHui.Liu 	PIN_FIELD_BASE(13, 13, 2, 0x0190, 0x10, 20, 4),
41711b918d9SHui.Liu 	PIN_FIELD_BASE(14, 14, 2, 0x0190, 0x10, 24, 4),
41811b918d9SHui.Liu 	PIN_FIELD_BASE(15, 15, 2, 0x0190, 0x10, 28, 4),
41911b918d9SHui.Liu 	PIN_FIELD_BASE(16, 16, 3, 0x0100, 0x10, 8, 4),
42011b918d9SHui.Liu 	PIN_FIELD_BASE(17, 17, 3, 0x0100, 0x10, 8, 4),
42111b918d9SHui.Liu 	PIN_FIELD_BASE(18, 18, 4, 0x0110, 0x10, 4, 4),
42211b918d9SHui.Liu 	PIN_FIELD_BASE(19, 19, 4, 0x0110, 0x10, 8, 4),
42311b918d9SHui.Liu 	PIN_FIELD_BASE(20, 20, 4, 0x0110, 0x10, 8, 4),
42411b918d9SHui.Liu 	PIN_FIELD_BASE(21, 21, 4, 0x0110, 0x10, 8, 4),
42511b918d9SHui.Liu 	PIN_FIELD_BASE(22, 22, 4, 0x0100, 0x10, 0, 4),
42611b918d9SHui.Liu 	PIN_FIELD_BASE(23, 23, 4, 0x0100, 0x10, 4, 4),
42711b918d9SHui.Liu 	PIN_FIELD_BASE(24, 24, 4, 0x0100, 0x10, 8, 4),
42811b918d9SHui.Liu 	PIN_FIELD_BASE(25, 25, 1, 0x01c0, 0x10, 8, 4),
42911b918d9SHui.Liu 	PIN_FIELD_BASE(26, 26, 1, 0x01c0, 0x10, 8, 4),
43011b918d9SHui.Liu 	PIN_FIELD_BASE(27, 27, 1, 0x01c0, 0x10, 8, 4),
43111b918d9SHui.Liu 	PIN_FIELD_BASE(28, 28, 1, 0x01c0, 0x10, 12, 4),
43211b918d9SHui.Liu 	PIN_FIELD_BASE(29, 29, 1, 0x01c0, 0x10, 0, 4),
43311b918d9SHui.Liu 	PIN_FIELD_BASE(30, 30, 1, 0x01c0, 0x10, 8, 4),
43411b918d9SHui.Liu 	PIN_FIELD_BASE(31, 31, 1, 0x01c0, 0x10, 20, 4),
43511b918d9SHui.Liu 	PIN_FIELD_BASE(32, 32, 1, 0x01c0, 0x10, 24, 4),
43611b918d9SHui.Liu 	PIN_FIELD_BASE(33, 33, 1, 0x01c0, 0x10, 24, 4),
43711b918d9SHui.Liu 	PIN_FIELD_BASE(34, 34, 1, 0x01c0, 0x10, 28, 4),
43811b918d9SHui.Liu 	PIN_FIELD_BASE(35, 35, 1, 0x01c0, 0x10, 24, 4),
43911b918d9SHui.Liu 	PIN_FIELD_BASE(36, 36, 1, 0x01c0, 0x10, 24, 4),
44011b918d9SHui.Liu 	PIN_FIELD_BASE(37, 37, 1, 0x01c0, 0x10, 28, 4),
44111b918d9SHui.Liu 	PIN_FIELD_BASE(38, 38, 1, 0x01c0, 0x10, 28, 4),
44211b918d9SHui.Liu 	PIN_FIELD_BASE(39, 39, 1, 0x01c0, 0x10, 28, 4),
44311b918d9SHui.Liu 	PIN_FIELD_BASE(40, 40, 1, 0x01d0, 0x10, 0, 4),
44411b918d9SHui.Liu 	PIN_FIELD_BASE(41, 41, 1, 0x01d0, 0x10, 0, 4),
44511b918d9SHui.Liu 	PIN_FIELD_BASE(42, 42, 2, 0x01a0, 0x10, 16, 4),
44611b918d9SHui.Liu 	PIN_FIELD_BASE(43, 43, 2, 0x01a0, 0x10, 20, 4),
44711b918d9SHui.Liu 	PIN_FIELD_BASE(44, 44, 2, 0x01a0, 0x10, 16, 4),
44811b918d9SHui.Liu 	PIN_FIELD_BASE(45, 45, 2, 0x01a0, 0x10, 20, 4),
44911b918d9SHui.Liu 	PIN_FIELD_BASE(46, 46, 3, 0x0100, 0x10, 8, 4),
45011b918d9SHui.Liu 	PIN_FIELD_BASE(47, 47, 1, 0x01c0, 0x10, 0, 4),
45111b918d9SHui.Liu 	PIN_FIELD_BASE(48, 48, 1, 0x01c0, 0x10, 0, 4),
45211b918d9SHui.Liu 	PIN_FIELD_BASE(49, 49, 1, 0x01c0, 0x10, 0, 4),
45311b918d9SHui.Liu 	PIN_FIELD_BASE(50, 50, 3, 0x0100, 0x10, 8, 4),
45411b918d9SHui.Liu 	PIN_FIELD_BASE(51, 51, 3, 0x0100, 0x10, 12, 4),
45511b918d9SHui.Liu 	PIN_FIELD_BASE(52, 52, 3, 0x0100, 0x10, 12, 4),
45611b918d9SHui.Liu 	PIN_FIELD_BASE(53, 53, 3, 0x0100, 0x10, 12, 4),
45711b918d9SHui.Liu 	PIN_FIELD_BASE(54, 54, 3, 0x0100, 0x10, 12, 4),
45811b918d9SHui.Liu 	PIN_FIELD_BASE(55, 55, 1, 0x01c0, 0x10, 12, 4),
45911b918d9SHui.Liu 	PIN_FIELD_BASE(56, 56, 1, 0x01c0, 0x10, 12, 4),
46011b918d9SHui.Liu 	PIN_FIELD_BASE(57, 57, 2, 0x01a0, 0x10, 24, 4),
46111b918d9SHui.Liu 	PIN_FIELD_BASE(58, 58, 2, 0x01a0, 0x10, 24, 4),
46211b918d9SHui.Liu 	PIN_FIELD_BASE(59, 59, 1, 0x01c0, 0x10, 16, 4),
46311b918d9SHui.Liu 	PIN_FIELD_BASE(60, 60, 1, 0x01c0, 0x10, 12, 4),
46411b918d9SHui.Liu 	PIN_FIELD_BASE(61, 61, 1, 0x01c0, 0x10, 16, 4),
46511b918d9SHui.Liu 	PIN_FIELD_BASE(62, 62, 1, 0x01c0, 0x10, 16, 4),
46611b918d9SHui.Liu 	PIN_FIELD_BASE(63, 63, 2, 0x01a0, 0x10, 20, 4),
46711b918d9SHui.Liu 	PIN_FIELD_BASE(64, 64, 2, 0x01a0, 0x10, 20, 4),
46811b918d9SHui.Liu 	PIN_FIELD_BASE(65, 65, 4, 0x0110, 0x10, 12, 4),
46911b918d9SHui.Liu 	PIN_FIELD_BASE(66, 66, 4, 0x0110, 0x10, 8, 4),
47011b918d9SHui.Liu 	PIN_FIELD_BASE(67, 67, 4, 0x0110, 0x10, 12, 4),
47111b918d9SHui.Liu 	PIN_FIELD_BASE(68, 68, 4, 0x0110, 0x10, 12, 4),
47211b918d9SHui.Liu 	PIN_FIELD_BASE(69, 69, 1, 0x01d0, 0x10, 16, 4),
47311b918d9SHui.Liu 	PIN_FIELD_BASE(70, 70, 1, 0x01d0, 0x10, 12, 4),
47411b918d9SHui.Liu 	PIN_FIELD_BASE(71, 71, 1, 0x01e0, 0x10, 0, 4),
47511b918d9SHui.Liu 	PIN_FIELD_BASE(72, 72, 1, 0x01d0, 0x10, 28, 4),
47611b918d9SHui.Liu 	PIN_FIELD_BASE(73, 73, 1, 0x01d0, 0x10, 20, 4),
47711b918d9SHui.Liu 	PIN_FIELD_BASE(74, 74, 1, 0x01d0, 0x10, 24, 4),
47811b918d9SHui.Liu 	PIN_FIELD_BASE(75, 75, 1, 0x01e0, 0x10, 8, 4),
47911b918d9SHui.Liu 	PIN_FIELD_BASE(76, 76, 1, 0x01e0, 0x10, 4, 4),
48011b918d9SHui.Liu 	PIN_FIELD_BASE(77, 77, 1, 0x01e0, 0x10, 16, 4),
48111b918d9SHui.Liu 	PIN_FIELD_BASE(78, 78, 1, 0x01e0, 0x10, 12, 4),
48211b918d9SHui.Liu 	PIN_FIELD_BASE(79, 79, 4, 0x0110, 0x10, 20, 4),
48311b918d9SHui.Liu 	PIN_FIELD_BASE(80, 80, 4, 0x0110, 0x10, 16, 4),
48411b918d9SHui.Liu 	PIN_FIELD_BASE(81, 81, 4, 0x0110, 0x10, 28, 4),
48511b918d9SHui.Liu 	PIN_FIELD_BASE(82, 82, 4, 0x0110, 0x10, 24, 4),
48611b918d9SHui.Liu 	PIN_FIELD_BASE(83, 83, 2, 0x01b0, 0x10, 8, 4),
48711b918d9SHui.Liu 	PIN_FIELD_BASE(84, 84, 2, 0x01b0, 0x10, 8, 4),
48811b918d9SHui.Liu 	PIN_FIELD_BASE(85, 85, 2, 0x01b0, 0x10, 12, 4),
48911b918d9SHui.Liu 	PIN_FIELD_BASE(86, 86, 2, 0x01a0, 0x10, 0, 4),
49011b918d9SHui.Liu 	PIN_FIELD_BASE(87, 87, 2, 0x01a0, 0x10, 0, 4),
49111b918d9SHui.Liu 	PIN_FIELD_BASE(88, 88, 2, 0x01a0, 0x10, 0, 4),
49211b918d9SHui.Liu 	PIN_FIELD_BASE(89, 89, 2, 0x01a0, 0x10, 0, 4),
49311b918d9SHui.Liu 	PIN_FIELD_BASE(90, 90, 2, 0x01b0, 0x10, 12, 4),
49411b918d9SHui.Liu 	PIN_FIELD_BASE(91, 91, 2, 0x01b0, 0x10, 12, 4),
49511b918d9SHui.Liu 	PIN_FIELD_BASE(92, 92, 2, 0x01a0, 0x10, 4, 4),
49611b918d9SHui.Liu 	PIN_FIELD_BASE(93, 93, 2, 0x01a0, 0x10, 4, 4),
49711b918d9SHui.Liu 	PIN_FIELD_BASE(94, 94, 2, 0x01a0, 0x10, 4, 4),
49811b918d9SHui.Liu 	PIN_FIELD_BASE(95, 95, 2, 0x01a0, 0x10, 4, 4),
49911b918d9SHui.Liu 	PIN_FIELD_BASE(96, 96, 2, 0x01a0, 0x10, 24, 4),
50011b918d9SHui.Liu 	PIN_FIELD_BASE(97, 97, 2, 0x01a0, 0x10, 28, 4),
50111b918d9SHui.Liu 	PIN_FIELD_BASE(98, 98, 2, 0x01b0, 0x10, 0, 4),
50211b918d9SHui.Liu 	PIN_FIELD_BASE(99, 99, 2, 0x01a0, 0x10, 24, 4),
50311b918d9SHui.Liu 	PIN_FIELD_BASE(100, 100, 2, 0x01b0, 0x10, 20, 4),
50411b918d9SHui.Liu 	PIN_FIELD_BASE(101, 101, 2, 0x01a0, 0x10, 28, 4),
50511b918d9SHui.Liu 	PIN_FIELD_BASE(102, 102, 2, 0x01a0, 0x10, 28, 4),
50611b918d9SHui.Liu 	PIN_FIELD_BASE(103, 103, 2, 0x01a0, 0x10, 28, 4),
50711b918d9SHui.Liu 	PIN_FIELD_BASE(104, 104, 2, 0x01b0, 0x10, 0, 4),
50811b918d9SHui.Liu 	PIN_FIELD_BASE(105, 105, 2, 0x01b0, 0x10, 0, 4),
50911b918d9SHui.Liu 	PIN_FIELD_BASE(106, 106, 2, 0x01b0, 0x10, 0, 4),
51011b918d9SHui.Liu 	PIN_FIELD_BASE(107, 107, 2, 0x01a0, 0x10, 0, 4),
51111b918d9SHui.Liu 	PIN_FIELD_BASE(108, 108, 2, 0x01a0, 0x10, 0, 4),
51211b918d9SHui.Liu 	PIN_FIELD_BASE(109, 109, 2, 0x01a0, 0x10, 0, 4),
51311b918d9SHui.Liu 	PIN_FIELD_BASE(110, 110, 2, 0x01a0, 0x10, 0, 4),
51411b918d9SHui.Liu 	PIN_FIELD_BASE(111, 111, 2, 0x01a0, 0x10, 8, 4),
51511b918d9SHui.Liu 	PIN_FIELD_BASE(112, 112, 2, 0x01a0, 0x10, 8, 4),
51611b918d9SHui.Liu 	PIN_FIELD_BASE(113, 113, 2, 0x01a0, 0x10, 8, 4),
51711b918d9SHui.Liu 	PIN_FIELD_BASE(114, 114, 2, 0x01a0, 0x10, 8, 4),
51811b918d9SHui.Liu 	PIN_FIELD_BASE(115, 115, 2, 0x01a0, 0x10, 12, 4),
51911b918d9SHui.Liu 	PIN_FIELD_BASE(116, 116, 2, 0x01a0, 0x10, 12, 4),
52011b918d9SHui.Liu 	PIN_FIELD_BASE(117, 117, 2, 0x01a0, 0x10, 12, 4),
52111b918d9SHui.Liu 	PIN_FIELD_BASE(118, 118, 2, 0x01a0, 0x10, 12, 4),
52211b918d9SHui.Liu 	PIN_FIELD_BASE(119, 119, 2, 0x01a0, 0x10, 16, 4),
52311b918d9SHui.Liu 	PIN_FIELD_BASE(120, 120, 2, 0x01a0, 0x10, 16, 4),
52411b918d9SHui.Liu 	PIN_FIELD_BASE(121, 121, 3, 0x00f0, 0x10, 24, 4),
52511b918d9SHui.Liu 	PIN_FIELD_BASE(122, 122, 3, 0x0100, 0x10, 4, 4),
52611b918d9SHui.Liu 	PIN_FIELD_BASE(123, 123, 3, 0x0100, 0x10, 0, 4),
52711b918d9SHui.Liu 	PIN_FIELD_BASE(124, 124, 3, 0x00f0, 0x10, 28, 4),
52811b918d9SHui.Liu 	PIN_FIELD_BASE(125, 125, 2, 0x01b0, 0x10, 4, 4),
52911b918d9SHui.Liu 	PIN_FIELD_BASE(126, 126, 2, 0x01b0, 0x10, 4, 4),
53011b918d9SHui.Liu 	PIN_FIELD_BASE(127, 127, 2, 0x01b0, 0x10, 4, 4),
53111b918d9SHui.Liu 	PIN_FIELD_BASE(128, 128, 2, 0x01b0, 0x10, 4, 4),
53211b918d9SHui.Liu 	PIN_FIELD_BASE(129, 129, 2, 0x01b0, 0x10, 8, 4),
53311b918d9SHui.Liu 	PIN_FIELD_BASE(130, 130, 2, 0x01b0, 0x10, 8, 4),
53411b918d9SHui.Liu 	PIN_FIELD_BASE(131, 131, 1, 0x01a0, 0x10, 0, 4),
53511b918d9SHui.Liu 	PIN_FIELD_BASE(132, 132, 1, 0x01a0, 0x10, 20, 4),
53611b918d9SHui.Liu 	PIN_FIELD_BASE(133, 133, 1, 0x01a0, 0x10, 24, 4),
53711b918d9SHui.Liu 	PIN_FIELD_BASE(134, 134, 1, 0x01a0, 0x10, 28, 4),
53811b918d9SHui.Liu 	PIN_FIELD_BASE(135, 135, 1, 0x01d0, 0x10, 0, 4),
53911b918d9SHui.Liu 	PIN_FIELD_BASE(136, 136, 1, 0x01d0, 0x10, 0, 4),
54011b918d9SHui.Liu 	PIN_FIELD_BASE(137, 137, 1, 0x01d0, 0x10, 4, 4),
54111b918d9SHui.Liu 	PIN_FIELD_BASE(138, 138, 1, 0x01d0, 0x10, 4, 4),
54211b918d9SHui.Liu 	PIN_FIELD_BASE(139, 139, 1, 0x01d0, 0x10, 4, 4),
54311b918d9SHui.Liu 	PIN_FIELD_BASE(140, 140, 1, 0x01d0, 0x10, 4, 4),
54411b918d9SHui.Liu 	PIN_FIELD_BASE(141, 141, 1, 0x01d0, 0x10, 8, 4),
54511b918d9SHui.Liu 	PIN_FIELD_BASE(142, 142, 1, 0x01d0, 0x10, 8, 4),
54611b918d9SHui.Liu 	PIN_FIELD_BASE(143, 143, 1, 0x01a0, 0x10, 4, 4),
54711b918d9SHui.Liu 	PIN_FIELD_BASE(144, 144, 1, 0x01a0, 0x10, 8, 4),
54811b918d9SHui.Liu 	PIN_FIELD_BASE(145, 145, 1, 0x01a0, 0x10, 12, 4),
54911b918d9SHui.Liu 	PIN_FIELD_BASE(146, 146, 1, 0x01a0, 0x10, 16, 4),
55011b918d9SHui.Liu 	PIN_FIELD_BASE(147, 147, 1, 0x01d0, 0x10, 8, 4),
55111b918d9SHui.Liu 	PIN_FIELD_BASE(148, 148, 1, 0x01d0, 0x10, 8, 4),
55211b918d9SHui.Liu 	PIN_FIELD_BASE(149, 149, 1, 0x01c0, 0x10, 4, 4),
55311b918d9SHui.Liu 	PIN_FIELD_BASE(150, 150, 1, 0x01c0, 0x10, 4, 4),
55411b918d9SHui.Liu 	PIN_FIELD_BASE(151, 151, 2, 0x0190, 0x10, 4, 4),
55511b918d9SHui.Liu 	PIN_FIELD_BASE(152, 152, 2, 0x0190, 0x10, 0, 4),
55611b918d9SHui.Liu 	PIN_FIELD_BASE(153, 153, 2, 0x0180, 0x10, 28, 4),
55711b918d9SHui.Liu 	PIN_FIELD_BASE(154, 154, 2, 0x0180, 0x10, 24, 4),
55811b918d9SHui.Liu 	PIN_FIELD_BASE(155, 155, 2, 0x0190, 0x10, 12, 4),
55911b918d9SHui.Liu 	PIN_FIELD_BASE(156, 156, 2, 0x0180, 0x10, 4, 4),
56011b918d9SHui.Liu 	PIN_FIELD_BASE(157, 157, 2, 0x0180, 0x10, 0, 4),
56111b918d9SHui.Liu 	PIN_FIELD_BASE(158, 158, 2, 0x0180, 0x10, 20, 4),
56211b918d9SHui.Liu 	PIN_FIELD_BASE(159, 159, 2, 0x0180, 0x10, 16, 4),
56311b918d9SHui.Liu 	PIN_FIELD_BASE(160, 160, 2, 0x0180, 0x10, 12, 4),
56411b918d9SHui.Liu 	PIN_FIELD_BASE(161, 161, 2, 0x0180, 0x10, 8, 4),
56511b918d9SHui.Liu 	PIN_FIELD_BASE(162, 162, 2, 0x0190, 0x10, 8, 4),
56611b918d9SHui.Liu 	PIN_FIELD_BASE(163, 163, 4, 0x0100, 0x10, 16, 4),
56711b918d9SHui.Liu 	PIN_FIELD_BASE(164, 164, 4, 0x0100, 0x10, 12, 4),
56811b918d9SHui.Liu 	PIN_FIELD_BASE(165, 165, 4, 0x0100, 0x10, 20, 4),
56911b918d9SHui.Liu 	PIN_FIELD_BASE(166, 166, 4, 0x0100, 0x10, 24, 4),
57011b918d9SHui.Liu 	PIN_FIELD_BASE(167, 167, 4, 0x0100, 0x10, 28, 4),
57111b918d9SHui.Liu 	PIN_FIELD_BASE(168, 168, 4, 0x0110, 0x10, 0, 4),
57211b918d9SHui.Liu 	PIN_FIELD_BASE(169, 169, 3, 0x00f0, 0x10, 4, 4),
57311b918d9SHui.Liu 	PIN_FIELD_BASE(170, 170, 3, 0x00f0, 0x10, 0, 4),
57411b918d9SHui.Liu 	PIN_FIELD_BASE(171, 171, 3, 0x00f0, 0x10, 8, 4),
57511b918d9SHui.Liu 	PIN_FIELD_BASE(172, 172, 3, 0x00f0, 0x10, 12, 4),
57611b918d9SHui.Liu 	PIN_FIELD_BASE(173, 173, 3, 0x00f0, 0x10, 16, 4),
57711b918d9SHui.Liu 	PIN_FIELD_BASE(174, 174, 3, 0x00f0, 0x10, 20, 4),
57811b918d9SHui.Liu 	PIN_FIELD_BASE(175, 175, 2, 0x01b0, 0x10, 16, 4),
57911b918d9SHui.Liu 	PIN_FIELD_BASE(176, 176, 2, 0x01b0, 0x10, 16, 4),
58011b918d9SHui.Liu };
58111b918d9SHui.Liu 
58211b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_rdsel_range[] = {
58311b918d9SHui.Liu 	PIN_FIELD_BASE(0, 0, 1, 0x0130, 0x10, 18, 2),
58411b918d9SHui.Liu 	PIN_FIELD_BASE(1, 1, 1, 0x0130, 0x10, 20, 2),
58511b918d9SHui.Liu 	PIN_FIELD_BASE(2, 2, 1, 0x0130, 0x10, 22, 2),
58611b918d9SHui.Liu 	PIN_FIELD_BASE(3, 3, 1, 0x0130, 0x10, 24, 2),
58711b918d9SHui.Liu 	PIN_FIELD_BASE(4, 4, 1, 0x0140, 0x10, 14, 2),
58811b918d9SHui.Liu 	PIN_FIELD_BASE(5, 5, 1, 0x0140, 0x10, 16, 2),
58911b918d9SHui.Liu 	PIN_FIELD_BASE(6, 6, 1, 0x0140, 0x10, 16, 2),
59011b918d9SHui.Liu 	PIN_FIELD_BASE(7, 7, 1, 0x0130, 0x10, 26, 2),
59111b918d9SHui.Liu 	PIN_FIELD_BASE(8, 8, 1, 0x0130, 0x10, 28, 2),
59211b918d9SHui.Liu 	PIN_FIELD_BASE(9, 9, 1, 0x0130, 0x10, 30, 2),
59311b918d9SHui.Liu 	PIN_FIELD_BASE(10, 10, 1, 0x0140, 0x10, 0, 2),
59411b918d9SHui.Liu 	PIN_FIELD_BASE(11, 11, 1, 0x0140, 0x10, 16, 2),
59511b918d9SHui.Liu 	PIN_FIELD_BASE(12, 12, 2, 0x0130, 0x10, 12, 2),
59611b918d9SHui.Liu 	PIN_FIELD_BASE(13, 13, 2, 0x0130, 0x10, 14, 2),
59711b918d9SHui.Liu 	PIN_FIELD_BASE(14, 14, 2, 0x0130, 0x10, 16, 2),
59811b918d9SHui.Liu 	PIN_FIELD_BASE(15, 15, 2, 0x0130, 0x10, 18, 2),
59911b918d9SHui.Liu 	PIN_FIELD_BASE(16, 16, 3, 0x00b0, 0x10, 14, 2),
60011b918d9SHui.Liu 	PIN_FIELD_BASE(17, 17, 3, 0x00b0, 0x10, 14, 2),
60111b918d9SHui.Liu 	PIN_FIELD_BASE(18, 18, 4, 0x00c0, 0x10, 12, 2),
60211b918d9SHui.Liu 	PIN_FIELD_BASE(19, 19, 4, 0x00c0, 0x10, 12, 2),
60311b918d9SHui.Liu 	PIN_FIELD_BASE(20, 20, 4, 0x00c0, 0x10, 12, 2),
60411b918d9SHui.Liu 	PIN_FIELD_BASE(21, 21, 4, 0x00c0, 0x10, 12, 2),
60511b918d9SHui.Liu 	PIN_FIELD_BASE(22, 22, 4, 0x00b0, 0x10, 0, 2),
60611b918d9SHui.Liu 	PIN_FIELD_BASE(23, 23, 4, 0x00b0, 0x10, 2, 2),
60711b918d9SHui.Liu 	PIN_FIELD_BASE(24, 24, 4, 0x00b0, 0x10, 4, 2),
60811b918d9SHui.Liu 	PIN_FIELD_BASE(25, 25, 1, 0x0140, 0x10, 10, 2),
60911b918d9SHui.Liu 	PIN_FIELD_BASE(26, 26, 1, 0x0140, 0x10, 10, 2),
61011b918d9SHui.Liu 	PIN_FIELD_BASE(27, 27, 1, 0x0140, 0x10, 10, 2),
61111b918d9SHui.Liu 	PIN_FIELD_BASE(28, 28, 1, 0x0140, 0x10, 12, 2),
61211b918d9SHui.Liu 	PIN_FIELD_BASE(29, 29, 1, 0x0140, 0x10, 2, 2),
61311b918d9SHui.Liu 	PIN_FIELD_BASE(30, 30, 1, 0x0140, 0x10, 10, 2),
61411b918d9SHui.Liu 	PIN_FIELD_BASE(31, 31, 1, 0x0140, 0x10, 16, 2),
61511b918d9SHui.Liu 	PIN_FIELD_BASE(32, 32, 1, 0x0140, 0x10, 18, 2),
61611b918d9SHui.Liu 	PIN_FIELD_BASE(33, 33, 1, 0x0140, 0x10, 18, 2),
61711b918d9SHui.Liu 	PIN_FIELD_BASE(34, 34, 1, 0x0140, 0x10, 20, 2),
61811b918d9SHui.Liu 	PIN_FIELD_BASE(35, 35, 1, 0x0140, 0x10, 18, 2),
61911b918d9SHui.Liu 	PIN_FIELD_BASE(36, 36, 1, 0x0140, 0x10, 18, 2),
62011b918d9SHui.Liu 	PIN_FIELD_BASE(37, 37, 1, 0x0140, 0x10, 20, 2),
62111b918d9SHui.Liu 	PIN_FIELD_BASE(38, 38, 1, 0x0140, 0x10, 20, 2),
62211b918d9SHui.Liu 	PIN_FIELD_BASE(39, 39, 1, 0x0140, 0x10, 20, 2),
62311b918d9SHui.Liu 	PIN_FIELD_BASE(40, 40, 1, 0x0140, 0x10, 22, 2),
62411b918d9SHui.Liu 	PIN_FIELD_BASE(41, 41, 1, 0x0140, 0x10, 22, 2),
62511b918d9SHui.Liu 	PIN_FIELD_BASE(42, 42, 2, 0x0130, 0x10, 30, 2),
62611b918d9SHui.Liu 	PIN_FIELD_BASE(43, 43, 2, 0x0140, 0x10, 0, 2),
62711b918d9SHui.Liu 	PIN_FIELD_BASE(44, 44, 2, 0x0130, 0x10, 30, 2),
62811b918d9SHui.Liu 	PIN_FIELD_BASE(45, 45, 2, 0x0140, 0x10, 0, 2),
62911b918d9SHui.Liu 	PIN_FIELD_BASE(46, 46, 3, 0x00b0, 0x10, 14, 2),
63011b918d9SHui.Liu 	PIN_FIELD_BASE(47, 47, 1, 0x0140, 0x10, 2, 2),
63111b918d9SHui.Liu 	PIN_FIELD_BASE(48, 48, 1, 0x0140, 0x10, 2, 2),
63211b918d9SHui.Liu 	PIN_FIELD_BASE(49, 49, 1, 0x0140, 0x10, 2, 2),
63311b918d9SHui.Liu 	PIN_FIELD_BASE(50, 50, 3, 0x00b0, 0x10, 14, 2),
63411b918d9SHui.Liu 	PIN_FIELD_BASE(51, 51, 3, 0x00b0, 0x10, 16, 2),
63511b918d9SHui.Liu 	PIN_FIELD_BASE(52, 52, 3, 0x00b0, 0x10, 16, 2),
63611b918d9SHui.Liu 	PIN_FIELD_BASE(53, 53, 3, 0x00b0, 0x10, 16, 2),
63711b918d9SHui.Liu 	PIN_FIELD_BASE(54, 54, 3, 0x00b0, 0x10, 16, 2),
63811b918d9SHui.Liu 	PIN_FIELD_BASE(55, 55, 1, 0x0140, 0x10, 12, 2),
63911b918d9SHui.Liu 	PIN_FIELD_BASE(56, 56, 1, 0x0140, 0x10, 12, 2),
64011b918d9SHui.Liu 	PIN_FIELD_BASE(57, 57, 2, 0x0140, 0x10, 2, 2),
64111b918d9SHui.Liu 	PIN_FIELD_BASE(58, 58, 2, 0x0140, 0x10, 2, 2),
64211b918d9SHui.Liu 	PIN_FIELD_BASE(59, 59, 1, 0x0140, 0x10, 14, 2),
64311b918d9SHui.Liu 	PIN_FIELD_BASE(60, 60, 1, 0x0140, 0x10, 12, 2),
64411b918d9SHui.Liu 	PIN_FIELD_BASE(61, 61, 1, 0x0140, 0x10, 14, 2),
64511b918d9SHui.Liu 	PIN_FIELD_BASE(62, 62, 1, 0x0140, 0x10, 14, 2),
64611b918d9SHui.Liu 	PIN_FIELD_BASE(63, 63, 2, 0x0140, 0x10, 0, 2),
64711b918d9SHui.Liu 	PIN_FIELD_BASE(64, 64, 2, 0x0140, 0x10, 0, 2),
64811b918d9SHui.Liu 	PIN_FIELD_BASE(65, 65, 4, 0x00c0, 0x10, 14, 2),
64911b918d9SHui.Liu 	PIN_FIELD_BASE(66, 66, 4, 0x00c0, 0x10, 14, 2),
65011b918d9SHui.Liu 	PIN_FIELD_BASE(67, 67, 4, 0x00c0, 0x10, 14, 2),
65111b918d9SHui.Liu 	PIN_FIELD_BASE(68, 68, 4, 0x00c0, 0x10, 14, 2),
65211b918d9SHui.Liu 	PIN_FIELD_BASE(69, 69, 1, 0x0150, 0x10, 14, 2),
65311b918d9SHui.Liu 	PIN_FIELD_BASE(70, 70, 1, 0x0150, 0x10, 12, 2),
65411b918d9SHui.Liu 	PIN_FIELD_BASE(71, 71, 1, 0x0150, 0x10, 22, 2),
65511b918d9SHui.Liu 	PIN_FIELD_BASE(72, 72, 1, 0x0150, 0x10, 20, 2),
65611b918d9SHui.Liu 	PIN_FIELD_BASE(73, 73, 1, 0x0150, 0x10, 16, 2),
65711b918d9SHui.Liu 	PIN_FIELD_BASE(74, 74, 1, 0x0150, 0x10, 18, 2),
65811b918d9SHui.Liu 	PIN_FIELD_BASE(75, 75, 1, 0x0150, 0x10, 26, 2),
65911b918d9SHui.Liu 	PIN_FIELD_BASE(76, 76, 1, 0x0150, 0x10, 24, 2),
66011b918d9SHui.Liu 	PIN_FIELD_BASE(77, 77, 1, 0x0150, 0x10, 30, 2),
66111b918d9SHui.Liu 	PIN_FIELD_BASE(78, 78, 1, 0x0150, 0x10, 28, 2),
66211b918d9SHui.Liu 	PIN_FIELD_BASE(79, 79, 4, 0x00c0, 0x10, 18, 2),
66311b918d9SHui.Liu 	PIN_FIELD_BASE(80, 80, 4, 0x00c0, 0x10, 16, 2),
66411b918d9SHui.Liu 	PIN_FIELD_BASE(81, 81, 4, 0x00c0, 0x10, 22, 2),
66511b918d9SHui.Liu 	PIN_FIELD_BASE(82, 82, 4, 0x00c0, 0x10, 20, 2),
66611b918d9SHui.Liu 	PIN_FIELD_BASE(83, 83, 2, 0x0140, 0x10, 10, 2),
66711b918d9SHui.Liu 	PIN_FIELD_BASE(84, 84, 2, 0x0140, 0x10, 10, 2),
66811b918d9SHui.Liu 	PIN_FIELD_BASE(85, 85, 2, 0x0140, 0x10, 12, 2),
66911b918d9SHui.Liu 	PIN_FIELD_BASE(86, 86, 2, 0x0130, 0x10, 20, 2),
67011b918d9SHui.Liu 	PIN_FIELD_BASE(87, 87, 2, 0x0130, 0x10, 20, 2),
67111b918d9SHui.Liu 	PIN_FIELD_BASE(88, 88, 2, 0x0130, 0x10, 20, 2),
67211b918d9SHui.Liu 	PIN_FIELD_BASE(89, 89, 2, 0x0130, 0x10, 20, 2),
67311b918d9SHui.Liu 	PIN_FIELD_BASE(90, 90, 2, 0x0140, 0x10, 12, 2),
67411b918d9SHui.Liu 	PIN_FIELD_BASE(91, 91, 2, 0x0140, 0x10, 12, 2),
67511b918d9SHui.Liu 	PIN_FIELD_BASE(92, 92, 2, 0x0130, 0x10, 22, 2),
67611b918d9SHui.Liu 	PIN_FIELD_BASE(93, 93, 2, 0x0130, 0x10, 22, 2),
67711b918d9SHui.Liu 	PIN_FIELD_BASE(94, 94, 2, 0x0130, 0x10, 22, 2),
67811b918d9SHui.Liu 	PIN_FIELD_BASE(95, 95, 2, 0x0130, 0x10, 22, 2),
67911b918d9SHui.Liu 	PIN_FIELD_BASE(96, 96, 2, 0x0140, 0x10, 2, 2),
68011b918d9SHui.Liu 	PIN_FIELD_BASE(97, 97, 2, 0x0140, 0x10, 4, 2),
68111b918d9SHui.Liu 	PIN_FIELD_BASE(98, 98, 2, 0x0140, 0x10, 6, 2),
68211b918d9SHui.Liu 	PIN_FIELD_BASE(99, 99, 2, 0x0140, 0x10, 2, 2),
68311b918d9SHui.Liu 	PIN_FIELD_BASE(100, 100, 2, 0x0140, 0x10, 16, 2),
68411b918d9SHui.Liu 	PIN_FIELD_BASE(101, 101, 2, 0x0140, 0x10, 4, 2),
68511b918d9SHui.Liu 	PIN_FIELD_BASE(102, 102, 2, 0x0140, 0x10, 4, 2),
68611b918d9SHui.Liu 	PIN_FIELD_BASE(103, 103, 2, 0x0140, 0x10, 4, 2),
68711b918d9SHui.Liu 	PIN_FIELD_BASE(104, 104, 2, 0x0140, 0x10, 6, 2),
68811b918d9SHui.Liu 	PIN_FIELD_BASE(105, 105, 2, 0x0140, 0x10, 6, 2),
68911b918d9SHui.Liu 	PIN_FIELD_BASE(106, 106, 2, 0x0140, 0x10, 6, 2),
69011b918d9SHui.Liu 	PIN_FIELD_BASE(107, 107, 2, 0x0130, 0x10, 20, 2),
69111b918d9SHui.Liu 	PIN_FIELD_BASE(108, 108, 2, 0x0130, 0x10, 20, 2),
69211b918d9SHui.Liu 	PIN_FIELD_BASE(109, 109, 2, 0x0130, 0x10, 20, 2),
69311b918d9SHui.Liu 	PIN_FIELD_BASE(110, 110, 2, 0x0130, 0x10, 20, 2),
69411b918d9SHui.Liu 	PIN_FIELD_BASE(111, 111, 2, 0x0130, 0x10, 24, 2),
69511b918d9SHui.Liu 	PIN_FIELD_BASE(112, 112, 2, 0x0130, 0x10, 24, 2),
69611b918d9SHui.Liu 	PIN_FIELD_BASE(113, 113, 2, 0x0130, 0x10, 24, 2),
69711b918d9SHui.Liu 	PIN_FIELD_BASE(114, 114, 2, 0x0130, 0x10, 24, 2),
69811b918d9SHui.Liu 	PIN_FIELD_BASE(115, 115, 2, 0x0130, 0x10, 28, 2),
69911b918d9SHui.Liu 	PIN_FIELD_BASE(116, 116, 2, 0x0130, 0x10, 28, 2),
70011b918d9SHui.Liu 	PIN_FIELD_BASE(117, 117, 2, 0x0130, 0x10, 28, 2),
70111b918d9SHui.Liu 	PIN_FIELD_BASE(118, 118, 2, 0x0130, 0x10, 28, 2),
70211b918d9SHui.Liu 	PIN_FIELD_BASE(119, 119, 2, 0x0130, 0x10, 30, 2),
70311b918d9SHui.Liu 	PIN_FIELD_BASE(120, 120, 2, 0x0130, 0x10, 30, 2),
70411b918d9SHui.Liu 	PIN_FIELD_BASE(121, 121, 3, 0x00b0, 0x10, 6, 2),
70511b918d9SHui.Liu 	PIN_FIELD_BASE(122, 122, 3, 0x00b0, 0x10, 12, 2),
70611b918d9SHui.Liu 	PIN_FIELD_BASE(123, 123, 3, 0x00b0, 0x10, 10, 2),
70711b918d9SHui.Liu 	PIN_FIELD_BASE(124, 124, 3, 0x00b0, 0x10, 8, 2),
70811b918d9SHui.Liu 	PIN_FIELD_BASE(125, 125, 2, 0x0140, 0x10, 8, 2),
70911b918d9SHui.Liu 	PIN_FIELD_BASE(126, 126, 2, 0x0140, 0x10, 8, 2),
71011b918d9SHui.Liu 	PIN_FIELD_BASE(127, 127, 2, 0x0140, 0x10, 8, 2),
71111b918d9SHui.Liu 	PIN_FIELD_BASE(128, 128, 2, 0x0140, 0x10, 8, 2),
71211b918d9SHui.Liu 	PIN_FIELD_BASE(129, 129, 2, 0x0140, 0x10, 10, 2),
71311b918d9SHui.Liu 	PIN_FIELD_BASE(130, 130, 2, 0x0140, 0x10, 10, 2),
71411b918d9SHui.Liu 	PIN_FIELD_BASE(131, 131, 1, 0x0120, 0x10, 0, 6),
71511b918d9SHui.Liu 	PIN_FIELD_BASE(132, 132, 1, 0x0130, 0x10, 0, 6),
71611b918d9SHui.Liu 	PIN_FIELD_BASE(133, 133, 1, 0x0130, 0x10, 6, 6),
71711b918d9SHui.Liu 	PIN_FIELD_BASE(134, 134, 1, 0x0130, 0x10, 12, 6),
71811b918d9SHui.Liu 	PIN_FIELD_BASE(135, 135, 1, 0x0140, 0x10, 24, 6),
71911b918d9SHui.Liu 	PIN_FIELD_BASE(136, 136, 1, 0x0140, 0x10, 24, 6),
72011b918d9SHui.Liu 	PIN_FIELD_BASE(137, 137, 1, 0x0150, 0x10, 0, 6),
72111b918d9SHui.Liu 	PIN_FIELD_BASE(138, 138, 1, 0x0150, 0x10, 0, 6),
72211b918d9SHui.Liu 	PIN_FIELD_BASE(139, 139, 1, 0x0150, 0x10, 0, 6),
72311b918d9SHui.Liu 	PIN_FIELD_BASE(140, 140, 1, 0x0150, 0x10, 0, 6),
72411b918d9SHui.Liu 	PIN_FIELD_BASE(141, 141, 1, 0x0150, 0x10, 6, 6),
72511b918d9SHui.Liu 	PIN_FIELD_BASE(142, 142, 1, 0x0150, 0x10, 6, 6),
72611b918d9SHui.Liu 	PIN_FIELD_BASE(143, 143, 1, 0x0120, 0x10, 6, 6),
72711b918d9SHui.Liu 	PIN_FIELD_BASE(144, 144, 1, 0x0120, 0x10, 12, 6),
72811b918d9SHui.Liu 	PIN_FIELD_BASE(145, 145, 1, 0x0120, 0x10, 18, 6),
72911b918d9SHui.Liu 	PIN_FIELD_BASE(146, 146, 1, 0x0120, 0x10, 24, 6),
73011b918d9SHui.Liu 	PIN_FIELD_BASE(147, 147, 1, 0x0150, 0x10, 6, 6),
73111b918d9SHui.Liu 	PIN_FIELD_BASE(148, 148, 1, 0x0150, 0x10, 6, 6),
73211b918d9SHui.Liu 	PIN_FIELD_BASE(149, 149, 1, 0x0140, 0x10, 4, 6),
73311b918d9SHui.Liu 	PIN_FIELD_BASE(150, 150, 1, 0x0140, 0x10, 4, 6),
73411b918d9SHui.Liu 	PIN_FIELD_BASE(151, 151, 2, 0x0120, 0x10, 24, 6),
73511b918d9SHui.Liu 	PIN_FIELD_BASE(152, 152, 2, 0x0120, 0x10, 18, 6),
73611b918d9SHui.Liu 	PIN_FIELD_BASE(153, 153, 2, 0x0120, 0x10, 12, 6),
73711b918d9SHui.Liu 	PIN_FIELD_BASE(154, 154, 2, 0x0120, 0x10, 6, 6),
73811b918d9SHui.Liu 	PIN_FIELD_BASE(155, 155, 2, 0x0130, 0x10, 6, 6),
73911b918d9SHui.Liu 	PIN_FIELD_BASE(156, 156, 2, 0x0110, 0x10, 6, 6),
74011b918d9SHui.Liu 	PIN_FIELD_BASE(157, 157, 2, 0x0110, 0x10, 0, 6),
74111b918d9SHui.Liu 	PIN_FIELD_BASE(158, 158, 2, 0x0120, 0x10, 0, 6),
74211b918d9SHui.Liu 	PIN_FIELD_BASE(159, 159, 2, 0x0110, 0x10, 24, 6),
74311b918d9SHui.Liu 	PIN_FIELD_BASE(160, 160, 2, 0x0110, 0x10, 18, 6),
74411b918d9SHui.Liu 	PIN_FIELD_BASE(161, 161, 2, 0x0110, 0x10, 12, 6),
74511b918d9SHui.Liu 	PIN_FIELD_BASE(162, 162, 2, 0x0130, 0x10, 0, 6),
74611b918d9SHui.Liu 	PIN_FIELD_BASE(163, 163, 4, 0x00b0, 0x10, 12, 6),
74711b918d9SHui.Liu 	PIN_FIELD_BASE(164, 164, 4, 0x00b0, 0x10, 6, 6),
74811b918d9SHui.Liu 	PIN_FIELD_BASE(165, 165, 4, 0x00b0, 0x10, 18, 6),
74911b918d9SHui.Liu 	PIN_FIELD_BASE(166, 166, 4, 0x00b0, 0x10, 24, 6),
75011b918d9SHui.Liu 	PIN_FIELD_BASE(167, 167, 4, 0x00c0, 0x10, 0, 6),
75111b918d9SHui.Liu 	PIN_FIELD_BASE(168, 168, 4, 0x00c0, 0x10, 6, 6),
75211b918d9SHui.Liu 	PIN_FIELD_BASE(169, 169, 3, 0x00a0, 0x10, 6, 6),
75311b918d9SHui.Liu 	PIN_FIELD_BASE(170, 170, 3, 0x00a0, 0x10, 0, 6),
75411b918d9SHui.Liu 	PIN_FIELD_BASE(171, 171, 3, 0x00a0, 0x10, 12, 6),
75511b918d9SHui.Liu 	PIN_FIELD_BASE(172, 172, 3, 0x00a0, 0x10, 18, 6),
75611b918d9SHui.Liu 	PIN_FIELD_BASE(173, 173, 3, 0x00a0, 0x10, 24, 6),
75711b918d9SHui.Liu 	PIN_FIELD_BASE(174, 174, 3, 0x00b0, 0x10, 0, 6),
75811b918d9SHui.Liu 	PIN_FIELD_BASE(175, 175, 2, 0x0140, 0x10, 14, 2),
75911b918d9SHui.Liu 	PIN_FIELD_BASE(176, 176, 2, 0x0140, 0x10, 14, 2),
76011b918d9SHui.Liu };
76111b918d9SHui.Liu 
76211b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_pupd_range[] = {
76311b918d9SHui.Liu 	PIN_FIELD_BASE(42, 42, 2, 0x00c0, 0x10, 12, 1),
76411b918d9SHui.Liu 	PIN_FIELD_BASE(43, 43, 2, 0x00c0, 0x10, 13, 1),
76511b918d9SHui.Liu 	PIN_FIELD_BASE(44, 44, 2, 0x00c0, 0x10, 14, 1),
76611b918d9SHui.Liu 	PIN_FIELD_BASE(45, 45, 2, 0x00c0, 0x10, 15, 1),
76711b918d9SHui.Liu 	PIN_FIELD_BASE(131, 131, 1, 0x00d0, 0x10, 1, 1),
76811b918d9SHui.Liu 	PIN_FIELD_BASE(132, 132, 1, 0x00d0, 0x10, 2, 1),
76911b918d9SHui.Liu 	PIN_FIELD_BASE(133, 133, 1, 0x00d0, 0x10, 9, 1),
77011b918d9SHui.Liu 	PIN_FIELD_BASE(134, 134, 1, 0x00d0, 0x10, 10, 1),
77111b918d9SHui.Liu 	PIN_FIELD_BASE(135, 135, 1, 0x00d0, 0x10, 11, 1),
77211b918d9SHui.Liu 	PIN_FIELD_BASE(136, 136, 1, 0x00d0, 0x10, 12, 1),
77311b918d9SHui.Liu 	PIN_FIELD_BASE(137, 137, 1, 0x00d0, 0x10, 13, 1),
77411b918d9SHui.Liu 	PIN_FIELD_BASE(138, 138, 1, 0x00d0, 0x10, 14, 1),
77511b918d9SHui.Liu 	PIN_FIELD_BASE(139, 139, 1, 0x00d0, 0x10, 15, 1),
77611b918d9SHui.Liu 	PIN_FIELD_BASE(140, 140, 1, 0x00d0, 0x10, 16, 1),
77711b918d9SHui.Liu 	PIN_FIELD_BASE(141, 141, 1, 0x00d0, 0x10, 3, 1),
77811b918d9SHui.Liu 	PIN_FIELD_BASE(142, 142, 1, 0x00d0, 0x10, 4, 1),
77911b918d9SHui.Liu 	PIN_FIELD_BASE(143, 143, 1, 0x00d0, 0x10, 5, 1),
78011b918d9SHui.Liu 	PIN_FIELD_BASE(144, 144, 1, 0x00d0, 0x10, 6, 1),
78111b918d9SHui.Liu 	PIN_FIELD_BASE(145, 145, 1, 0x00d0, 0x10, 7, 1),
78211b918d9SHui.Liu 	PIN_FIELD_BASE(146, 146, 1, 0x00d0, 0x10, 8, 1),
78311b918d9SHui.Liu 	PIN_FIELD_BASE(147, 147, 1, 0x00d0, 0x10, 18, 1),
78411b918d9SHui.Liu 	PIN_FIELD_BASE(148, 148, 1, 0x00d0, 0x10, 19, 1),
78511b918d9SHui.Liu 	PIN_FIELD_BASE(149, 149, 1, 0x00d0, 0x10, 17, 1),
78611b918d9SHui.Liu 	PIN_FIELD_BASE(150, 150, 1, 0x00d0, 0x10, 0, 1),
78711b918d9SHui.Liu 	PIN_FIELD_BASE(151, 151, 2, 0x00c0, 0x10, 9, 1),
78811b918d9SHui.Liu 	PIN_FIELD_BASE(152, 152, 2, 0x00c0, 0x10, 8, 1),
78911b918d9SHui.Liu 	PIN_FIELD_BASE(153, 153, 2, 0x00c0, 0x10, 7, 1),
79011b918d9SHui.Liu 	PIN_FIELD_BASE(154, 154, 2, 0x00c0, 0x10, 6, 1),
79111b918d9SHui.Liu 	PIN_FIELD_BASE(155, 155, 2, 0x00c0, 0x10, 11, 1),
79211b918d9SHui.Liu 	PIN_FIELD_BASE(156, 156, 2, 0x00c0, 0x10, 1, 1),
79311b918d9SHui.Liu 	PIN_FIELD_BASE(157, 157, 2, 0x00c0, 0x10, 0, 1),
79411b918d9SHui.Liu 	PIN_FIELD_BASE(158, 158, 2, 0x00c0, 0x10, 5, 1),
79511b918d9SHui.Liu 	PIN_FIELD_BASE(159, 159, 2, 0x00c0, 0x10, 4, 1),
79611b918d9SHui.Liu 	PIN_FIELD_BASE(160, 160, 2, 0x00c0, 0x10, 3, 1),
79711b918d9SHui.Liu 	PIN_FIELD_BASE(161, 161, 2, 0x00c0, 0x10, 2, 1),
79811b918d9SHui.Liu 	PIN_FIELD_BASE(162, 162, 2, 0x00c0, 0x10, 10, 1),
79911b918d9SHui.Liu 	PIN_FIELD_BASE(163, 163, 4, 0x0070, 0x10, 1, 1),
80011b918d9SHui.Liu 	PIN_FIELD_BASE(164, 164, 4, 0x0070, 0x10, 0, 1),
80111b918d9SHui.Liu 	PIN_FIELD_BASE(165, 165, 4, 0x0070, 0x10, 2, 1),
80211b918d9SHui.Liu 	PIN_FIELD_BASE(166, 166, 4, 0x0070, 0x10, 3, 1),
80311b918d9SHui.Liu 	PIN_FIELD_BASE(167, 167, 4, 0x0070, 0x10, 4, 1),
80411b918d9SHui.Liu 	PIN_FIELD_BASE(168, 168, 4, 0x0070, 0x10, 5, 1),
80511b918d9SHui.Liu 	PIN_FIELD_BASE(169, 169, 3, 0x0060, 0x10, 1, 1),
80611b918d9SHui.Liu 	PIN_FIELD_BASE(170, 170, 3, 0x0060, 0x10, 0, 1),
80711b918d9SHui.Liu 	PIN_FIELD_BASE(171, 171, 3, 0x0060, 0x10, 2, 1),
80811b918d9SHui.Liu 	PIN_FIELD_BASE(172, 172, 3, 0x0060, 0x10, 3, 1),
80911b918d9SHui.Liu 	PIN_FIELD_BASE(173, 173, 3, 0x0060, 0x10, 4, 1),
81011b918d9SHui.Liu 	PIN_FIELD_BASE(174, 174, 3, 0x0060, 0x10, 5, 1),
81111b918d9SHui.Liu };
81211b918d9SHui.Liu 
81311b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_r0_range[] = {
81411b918d9SHui.Liu 	PIN_FIELD_BASE(42, 42, 2, 0x00f0, 0x10, 12, 1),
81511b918d9SHui.Liu 	PIN_FIELD_BASE(43, 43, 2, 0x00f0, 0x10, 13, 1),
81611b918d9SHui.Liu 	PIN_FIELD_BASE(44, 44, 2, 0x00f0, 0x10, 14, 1),
81711b918d9SHui.Liu 	PIN_FIELD_BASE(45, 45, 2, 0x00f0, 0x10, 15, 1),
81811b918d9SHui.Liu 	PIN_FIELD_BASE(131, 131, 1, 0x0100, 0x10, 1, 1),
81911b918d9SHui.Liu 	PIN_FIELD_BASE(132, 132, 1, 0x0100, 0x10, 2, 1),
82011b918d9SHui.Liu 	PIN_FIELD_BASE(133, 133, 1, 0x0100, 0x10, 9, 1),
82111b918d9SHui.Liu 	PIN_FIELD_BASE(134, 134, 1, 0x0100, 0x10, 10, 1),
82211b918d9SHui.Liu 	PIN_FIELD_BASE(135, 135, 1, 0x0100, 0x10, 11, 1),
82311b918d9SHui.Liu 	PIN_FIELD_BASE(136, 136, 1, 0x0100, 0x10, 12, 1),
82411b918d9SHui.Liu 	PIN_FIELD_BASE(137, 137, 1, 0x0100, 0x10, 13, 1),
82511b918d9SHui.Liu 	PIN_FIELD_BASE(138, 138, 1, 0x0100, 0x10, 14, 1),
82611b918d9SHui.Liu 	PIN_FIELD_BASE(139, 139, 1, 0x0100, 0x10, 15, 1),
82711b918d9SHui.Liu 	PIN_FIELD_BASE(140, 140, 1, 0x0100, 0x10, 16, 1),
82811b918d9SHui.Liu 	PIN_FIELD_BASE(141, 141, 1, 0x0100, 0x10, 3, 1),
82911b918d9SHui.Liu 	PIN_FIELD_BASE(142, 142, 1, 0x0100, 0x10, 4, 1),
83011b918d9SHui.Liu 	PIN_FIELD_BASE(143, 143, 1, 0x0100, 0x10, 5, 1),
83111b918d9SHui.Liu 	PIN_FIELD_BASE(144, 144, 1, 0x0100, 0x10, 6, 1),
83211b918d9SHui.Liu 	PIN_FIELD_BASE(145, 145, 1, 0x0100, 0x10, 7, 1),
83311b918d9SHui.Liu 	PIN_FIELD_BASE(146, 146, 1, 0x0100, 0x10, 8, 1),
83411b918d9SHui.Liu 	PIN_FIELD_BASE(147, 147, 1, 0x0100, 0x10, 18, 1),
83511b918d9SHui.Liu 	PIN_FIELD_BASE(148, 148, 1, 0x0100, 0x10, 19, 1),
83611b918d9SHui.Liu 	PIN_FIELD_BASE(149, 149, 1, 0x0100, 0x10, 17, 1),
83711b918d9SHui.Liu 	PIN_FIELD_BASE(150, 150, 1, 0x0100, 0x10, 0, 1),
83811b918d9SHui.Liu 	PIN_FIELD_BASE(151, 151, 2, 0x00f0, 0x10, 9, 1),
83911b918d9SHui.Liu 	PIN_FIELD_BASE(152, 152, 2, 0x00f0, 0x10, 8, 1),
84011b918d9SHui.Liu 	PIN_FIELD_BASE(153, 153, 2, 0x00f0, 0x10, 7, 1),
84111b918d9SHui.Liu 	PIN_FIELD_BASE(154, 154, 2, 0x00f0, 0x10, 6, 1),
84211b918d9SHui.Liu 	PIN_FIELD_BASE(155, 155, 2, 0x00f0, 0x10, 11, 1),
84311b918d9SHui.Liu 	PIN_FIELD_BASE(156, 156, 2, 0x00f0, 0x10, 1, 1),
84411b918d9SHui.Liu 	PIN_FIELD_BASE(157, 157, 2, 0x00f0, 0x10, 0, 1),
84511b918d9SHui.Liu 	PIN_FIELD_BASE(158, 158, 2, 0x00f0, 0x10, 5, 1),
84611b918d9SHui.Liu 	PIN_FIELD_BASE(159, 159, 2, 0x00f0, 0x10, 4, 1),
84711b918d9SHui.Liu 	PIN_FIELD_BASE(160, 160, 2, 0x00f0, 0x10, 3, 1),
84811b918d9SHui.Liu 	PIN_FIELD_BASE(161, 161, 2, 0x00f0, 0x10, 2, 1),
84911b918d9SHui.Liu 	PIN_FIELD_BASE(162, 162, 2, 0x00f0, 0x10, 10, 1),
85011b918d9SHui.Liu 	PIN_FIELD_BASE(163, 163, 4, 0x0090, 0x10, 1, 1),
85111b918d9SHui.Liu 	PIN_FIELD_BASE(164, 164, 4, 0x0090, 0x10, 0, 1),
85211b918d9SHui.Liu 	PIN_FIELD_BASE(165, 165, 4, 0x0090, 0x10, 2, 1),
85311b918d9SHui.Liu 	PIN_FIELD_BASE(166, 166, 4, 0x0090, 0x10, 3, 1),
85411b918d9SHui.Liu 	PIN_FIELD_BASE(167, 167, 4, 0x0090, 0x10, 4, 1),
85511b918d9SHui.Liu 	PIN_FIELD_BASE(168, 168, 4, 0x0090, 0x10, 5, 1),
85611b918d9SHui.Liu 	PIN_FIELD_BASE(169, 169, 3, 0x0080, 0x10, 1, 1),
85711b918d9SHui.Liu 	PIN_FIELD_BASE(170, 170, 3, 0x0080, 0x10, 0, 1),
85811b918d9SHui.Liu 	PIN_FIELD_BASE(171, 171, 3, 0x0080, 0x10, 2, 1),
85911b918d9SHui.Liu 	PIN_FIELD_BASE(172, 172, 3, 0x0080, 0x10, 3, 1),
86011b918d9SHui.Liu 	PIN_FIELD_BASE(173, 173, 3, 0x0080, 0x10, 4, 1),
86111b918d9SHui.Liu 	PIN_FIELD_BASE(174, 174, 3, 0x0080, 0x10, 5, 1),
86211b918d9SHui.Liu };
86311b918d9SHui.Liu 
86411b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_r1_range[] = {
86511b918d9SHui.Liu 	PIN_FIELD_BASE(42, 42, 2, 0x0100, 0x10, 12, 1),
86611b918d9SHui.Liu 	PIN_FIELD_BASE(43, 43, 2, 0x0100, 0x10, 13, 1),
86711b918d9SHui.Liu 	PIN_FIELD_BASE(44, 44, 2, 0x0100, 0x10, 14, 1),
86811b918d9SHui.Liu 	PIN_FIELD_BASE(45, 45, 2, 0x0100, 0x10, 15, 1),
86911b918d9SHui.Liu 	PIN_FIELD_BASE(131, 131, 1, 0x0110, 0x10, 1, 1),
87011b918d9SHui.Liu 	PIN_FIELD_BASE(132, 132, 1, 0x0110, 0x10, 2, 1),
87111b918d9SHui.Liu 	PIN_FIELD_BASE(133, 133, 1, 0x0110, 0x10, 9, 1),
87211b918d9SHui.Liu 	PIN_FIELD_BASE(134, 134, 1, 0x0110, 0x10, 10, 1),
87311b918d9SHui.Liu 	PIN_FIELD_BASE(135, 135, 1, 0x0110, 0x10, 11, 1),
87411b918d9SHui.Liu 	PIN_FIELD_BASE(136, 136, 1, 0x0110, 0x10, 12, 1),
87511b918d9SHui.Liu 	PIN_FIELD_BASE(137, 137, 1, 0x0110, 0x10, 13, 1),
87611b918d9SHui.Liu 	PIN_FIELD_BASE(138, 138, 1, 0x0110, 0x10, 14, 1),
87711b918d9SHui.Liu 	PIN_FIELD_BASE(139, 139, 1, 0x0110, 0x10, 15, 1),
87811b918d9SHui.Liu 	PIN_FIELD_BASE(140, 140, 1, 0x0110, 0x10, 16, 1),
87911b918d9SHui.Liu 	PIN_FIELD_BASE(141, 141, 1, 0x0110, 0x10, 3, 1),
88011b918d9SHui.Liu 	PIN_FIELD_BASE(142, 142, 1, 0x0110, 0x10, 4, 1),
88111b918d9SHui.Liu 	PIN_FIELD_BASE(143, 143, 1, 0x0110, 0x10, 5, 1),
88211b918d9SHui.Liu 	PIN_FIELD_BASE(144, 144, 1, 0x0110, 0x10, 6, 1),
88311b918d9SHui.Liu 	PIN_FIELD_BASE(145, 145, 1, 0x0110, 0x10, 7, 1),
88411b918d9SHui.Liu 	PIN_FIELD_BASE(146, 146, 1, 0x0110, 0x10, 8, 1),
88511b918d9SHui.Liu 	PIN_FIELD_BASE(147, 147, 1, 0x0110, 0x10, 18, 1),
88611b918d9SHui.Liu 	PIN_FIELD_BASE(148, 148, 1, 0x0110, 0x10, 19, 1),
88711b918d9SHui.Liu 	PIN_FIELD_BASE(149, 149, 1, 0x0110, 0x10, 17, 1),
88811b918d9SHui.Liu 	PIN_FIELD_BASE(150, 150, 1, 0x0110, 0x10, 0, 1),
88911b918d9SHui.Liu 	PIN_FIELD_BASE(151, 151, 2, 0x0100, 0x10, 9, 1),
89011b918d9SHui.Liu 	PIN_FIELD_BASE(152, 152, 2, 0x0100, 0x10, 8, 1),
89111b918d9SHui.Liu 	PIN_FIELD_BASE(153, 153, 2, 0x0100, 0x10, 7, 1),
89211b918d9SHui.Liu 	PIN_FIELD_BASE(154, 154, 2, 0x0100, 0x10, 6, 1),
89311b918d9SHui.Liu 	PIN_FIELD_BASE(155, 155, 2, 0x0100, 0x10, 11, 1),
89411b918d9SHui.Liu 	PIN_FIELD_BASE(156, 156, 2, 0x0100, 0x10, 1, 1),
89511b918d9SHui.Liu 	PIN_FIELD_BASE(157, 157, 2, 0x0100, 0x10, 0, 1),
89611b918d9SHui.Liu 	PIN_FIELD_BASE(158, 158, 2, 0x0100, 0x10, 5, 1),
89711b918d9SHui.Liu 	PIN_FIELD_BASE(159, 159, 2, 0x0100, 0x10, 4, 1),
89811b918d9SHui.Liu 	PIN_FIELD_BASE(160, 160, 2, 0x0100, 0x10, 3, 1),
89911b918d9SHui.Liu 	PIN_FIELD_BASE(161, 161, 2, 0x0100, 0x10, 2, 1),
90011b918d9SHui.Liu 	PIN_FIELD_BASE(162, 162, 2, 0x0100, 0x10, 10, 1),
90111b918d9SHui.Liu 	PIN_FIELD_BASE(163, 163, 4, 0x00a0, 0x10, 1, 1),
90211b918d9SHui.Liu 	PIN_FIELD_BASE(164, 164, 4, 0x00a0, 0x10, 0, 1),
90311b918d9SHui.Liu 	PIN_FIELD_BASE(165, 165, 4, 0x00a0, 0x10, 2, 1),
90411b918d9SHui.Liu 	PIN_FIELD_BASE(166, 166, 4, 0x00a0, 0x10, 3, 1),
90511b918d9SHui.Liu 	PIN_FIELD_BASE(167, 167, 4, 0x00a0, 0x10, 4, 1),
90611b918d9SHui.Liu 	PIN_FIELD_BASE(168, 168, 4, 0x00a0, 0x10, 5, 1),
90711b918d9SHui.Liu 	PIN_FIELD_BASE(169, 169, 3, 0x0090, 0x10, 1, 1),
90811b918d9SHui.Liu 	PIN_FIELD_BASE(170, 170, 3, 0x0090, 0x10, 0, 1),
90911b918d9SHui.Liu 	PIN_FIELD_BASE(171, 171, 3, 0x0090, 0x10, 2, 1),
91011b918d9SHui.Liu 	PIN_FIELD_BASE(172, 172, 3, 0x0090, 0x10, 3, 1),
91111b918d9SHui.Liu 	PIN_FIELD_BASE(173, 173, 3, 0x0090, 0x10, 4, 1),
91211b918d9SHui.Liu 	PIN_FIELD_BASE(174, 174, 3, 0x0090, 0x10, 5, 1),
91311b918d9SHui.Liu };
91411b918d9SHui.Liu 
91511b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_pu_range[] = {
91611b918d9SHui.Liu 	PIN_FIELD_BASE(0, 0, 1, 0x00e0, 0x10, 6, 1),
91711b918d9SHui.Liu 	PIN_FIELD_BASE(1, 1, 1, 0x00e0, 0x10, 7, 1),
91811b918d9SHui.Liu 	PIN_FIELD_BASE(2, 2, 1, 0x00e0, 0x10, 8, 1),
91911b918d9SHui.Liu 	PIN_FIELD_BASE(3, 3, 1, 0x00e0, 0x10, 9, 1),
92011b918d9SHui.Liu 	PIN_FIELD_BASE(4, 4, 1, 0x00e0, 0x10, 10, 1),
92111b918d9SHui.Liu 	PIN_FIELD_BASE(5, 5, 1, 0x00e0, 0x10, 11, 1),
92211b918d9SHui.Liu 	PIN_FIELD_BASE(6, 6, 1, 0x00e0, 0x10, 12, 1),
92311b918d9SHui.Liu 	PIN_FIELD_BASE(7, 7, 1, 0x00e0, 0x10, 13, 1),
92411b918d9SHui.Liu 	PIN_FIELD_BASE(8, 8, 1, 0x00e0, 0x10, 14, 1),
92511b918d9SHui.Liu 	PIN_FIELD_BASE(9, 9, 1, 0x00e0, 0x10, 15, 1),
92611b918d9SHui.Liu 	PIN_FIELD_BASE(10, 10, 1, 0x00e0, 0x10, 16, 1),
92711b918d9SHui.Liu 	PIN_FIELD_BASE(11, 11, 1, 0x00e0, 0x10, 17, 1),
92811b918d9SHui.Liu 	PIN_FIELD_BASE(12, 12, 2, 0x00d0, 0x10, 12, 1),
92911b918d9SHui.Liu 	PIN_FIELD_BASE(13, 13, 2, 0x00d0, 0x10, 13, 1),
93011b918d9SHui.Liu 	PIN_FIELD_BASE(14, 14, 2, 0x00d0, 0x10, 14, 1),
93111b918d9SHui.Liu 	PIN_FIELD_BASE(15, 15, 2, 0x00d0, 0x10, 15, 1),
93211b918d9SHui.Liu 	PIN_FIELD_BASE(16, 16, 3, 0x0070, 0x10, 1, 1),
93311b918d9SHui.Liu 	PIN_FIELD_BASE(17, 17, 3, 0x0070, 0x10, 2, 1),
93411b918d9SHui.Liu 	PIN_FIELD_BASE(18, 18, 4, 0x0080, 0x10, 3, 1),
93511b918d9SHui.Liu 	PIN_FIELD_BASE(19, 19, 4, 0x0080, 0x10, 5, 1),
93611b918d9SHui.Liu 	PIN_FIELD_BASE(20, 20, 4, 0x0080, 0x10, 4, 1),
93711b918d9SHui.Liu 	PIN_FIELD_BASE(21, 21, 4, 0x0080, 0x10, 6, 1),
93811b918d9SHui.Liu 	PIN_FIELD_BASE(22, 22, 4, 0x0080, 0x10, 0, 1),
93911b918d9SHui.Liu 	PIN_FIELD_BASE(23, 23, 4, 0x0080, 0x10, 1, 1),
94011b918d9SHui.Liu 	PIN_FIELD_BASE(24, 24, 4, 0x0080, 0x10, 2, 1),
94111b918d9SHui.Liu 	PIN_FIELD_BASE(25, 25, 1, 0x00e0, 0x10, 3, 1),
94211b918d9SHui.Liu 	PIN_FIELD_BASE(26, 26, 1, 0x00e0, 0x10, 2, 1),
94311b918d9SHui.Liu 	PIN_FIELD_BASE(27, 27, 1, 0x00e0, 0x10, 5, 1),
94411b918d9SHui.Liu 	PIN_FIELD_BASE(28, 28, 1, 0x00e0, 0x10, 4, 1),
94511b918d9SHui.Liu 	PIN_FIELD_BASE(29, 29, 1, 0x00e0, 0x10, 0, 1),
94611b918d9SHui.Liu 	PIN_FIELD_BASE(30, 30, 1, 0x00e0, 0x10, 1, 1),
94711b918d9SHui.Liu 	PIN_FIELD_BASE(31, 31, 1, 0x00f0, 0x10, 11, 1),
94811b918d9SHui.Liu 	PIN_FIELD_BASE(32, 32, 1, 0x00f0, 0x10, 10, 1),
94911b918d9SHui.Liu 	PIN_FIELD_BASE(33, 33, 1, 0x00f0, 0x10, 13, 1),
95011b918d9SHui.Liu 	PIN_FIELD_BASE(34, 34, 1, 0x00f0, 0x10, 12, 1),
95111b918d9SHui.Liu 	PIN_FIELD_BASE(35, 35, 1, 0x00f0, 0x10, 15, 1),
95211b918d9SHui.Liu 	PIN_FIELD_BASE(36, 36, 1, 0x00f0, 0x10, 14, 1),
95311b918d9SHui.Liu 	PIN_FIELD_BASE(37, 37, 1, 0x00e0, 0x10, 21, 1),
95411b918d9SHui.Liu 	PIN_FIELD_BASE(38, 38, 1, 0x00e0, 0x10, 18, 1),
95511b918d9SHui.Liu 	PIN_FIELD_BASE(39, 39, 1, 0x00e0, 0x10, 19, 1),
95611b918d9SHui.Liu 	PIN_FIELD_BASE(40, 40, 1, 0x00e0, 0x10, 20, 1),
95711b918d9SHui.Liu 	PIN_FIELD_BASE(41, 41, 1, 0x00e0, 0x10, 22, 1),
95811b918d9SHui.Liu 	PIN_FIELD_BASE(46, 46, 3, 0x0070, 0x10, 0, 1),
95911b918d9SHui.Liu 	PIN_FIELD_BASE(47, 47, 1, 0x00e0, 0x10, 25, 1),
96011b918d9SHui.Liu 	PIN_FIELD_BASE(48, 48, 1, 0x00e0, 0x10, 24, 1),
96111b918d9SHui.Liu 	PIN_FIELD_BASE(49, 49, 1, 0x00e0, 0x10, 23, 1),
96211b918d9SHui.Liu 	PIN_FIELD_BASE(50, 50, 3, 0x0070, 0x10, 5, 1),
96311b918d9SHui.Liu 	PIN_FIELD_BASE(51, 51, 3, 0x0070, 0x10, 4, 1),
96411b918d9SHui.Liu 	PIN_FIELD_BASE(52, 52, 3, 0x0070, 0x10, 3, 1),
96511b918d9SHui.Liu 	PIN_FIELD_BASE(53, 53, 3, 0x0070, 0x10, 6, 1),
96611b918d9SHui.Liu 	PIN_FIELD_BASE(54, 54, 3, 0x0070, 0x10, 7, 1),
96711b918d9SHui.Liu 	PIN_FIELD_BASE(55, 55, 1, 0x00e0, 0x10, 26, 1),
96811b918d9SHui.Liu 	PIN_FIELD_BASE(56, 56, 1, 0x00e0, 0x10, 29, 1),
96911b918d9SHui.Liu 	PIN_FIELD_BASE(57, 57, 2, 0x00e0, 0x10, 6, 1),
97011b918d9SHui.Liu 	PIN_FIELD_BASE(58, 58, 2, 0x00e0, 0x10, 9, 1),
97111b918d9SHui.Liu 	PIN_FIELD_BASE(59, 59, 1, 0x00e0, 0x10, 27, 1),
97211b918d9SHui.Liu 	PIN_FIELD_BASE(60, 60, 1, 0x00e0, 0x10, 30, 1),
97311b918d9SHui.Liu 	PIN_FIELD_BASE(61, 61, 1, 0x00e0, 0x10, 28, 1),
97411b918d9SHui.Liu 	PIN_FIELD_BASE(62, 62, 1, 0x00e0, 0x10, 31, 1),
97511b918d9SHui.Liu 	PIN_FIELD_BASE(63, 63, 2, 0x00e0, 0x10, 7, 1),
97611b918d9SHui.Liu 	PIN_FIELD_BASE(64, 64, 2, 0x00e0, 0x10, 10, 1),
97711b918d9SHui.Liu 	PIN_FIELD_BASE(65, 65, 4, 0x0080, 0x10, 7, 1),
97811b918d9SHui.Liu 	PIN_FIELD_BASE(66, 66, 4, 0x0080, 0x10, 9, 1),
97911b918d9SHui.Liu 	PIN_FIELD_BASE(67, 67, 4, 0x0080, 0x10, 8, 1),
98011b918d9SHui.Liu 	PIN_FIELD_BASE(68, 68, 4, 0x0080, 0x10, 10, 1),
98111b918d9SHui.Liu 	PIN_FIELD_BASE(69, 69, 1, 0x00f0, 0x10, 1, 1),
98211b918d9SHui.Liu 	PIN_FIELD_BASE(70, 70, 1, 0x00f0, 0x10, 0, 1),
98311b918d9SHui.Liu 	PIN_FIELD_BASE(71, 71, 1, 0x00f0, 0x10, 5, 1),
98411b918d9SHui.Liu 	PIN_FIELD_BASE(72, 72, 1, 0x00f0, 0x10, 4, 1),
98511b918d9SHui.Liu 	PIN_FIELD_BASE(73, 73, 1, 0x00f0, 0x10, 2, 1),
98611b918d9SHui.Liu 	PIN_FIELD_BASE(74, 74, 1, 0x00f0, 0x10, 3, 1),
98711b918d9SHui.Liu 	PIN_FIELD_BASE(75, 75, 1, 0x00f0, 0x10, 7, 1),
98811b918d9SHui.Liu 	PIN_FIELD_BASE(76, 76, 1, 0x00f0, 0x10, 6, 1),
98911b918d9SHui.Liu 	PIN_FIELD_BASE(77, 77, 1, 0x00f0, 0x10, 9, 1),
99011b918d9SHui.Liu 	PIN_FIELD_BASE(78, 78, 1, 0x00f0, 0x10, 8, 1),
99111b918d9SHui.Liu 	PIN_FIELD_BASE(79, 79, 4, 0x0080, 0x10, 12, 1),
99211b918d9SHui.Liu 	PIN_FIELD_BASE(80, 80, 4, 0x0080, 0x10, 11, 1),
99311b918d9SHui.Liu 	PIN_FIELD_BASE(81, 81, 4, 0x0080, 0x10, 14, 1),
99411b918d9SHui.Liu 	PIN_FIELD_BASE(82, 82, 4, 0x0080, 0x10, 13, 1),
99511b918d9SHui.Liu 	PIN_FIELD_BASE(83, 83, 2, 0x00e0, 0x10, 16, 1),
99611b918d9SHui.Liu 	PIN_FIELD_BASE(84, 84, 2, 0x00e0, 0x10, 15, 1),
99711b918d9SHui.Liu 	PIN_FIELD_BASE(85, 85, 2, 0x00e0, 0x10, 17, 1),
99811b918d9SHui.Liu 	PIN_FIELD_BASE(86, 86, 2, 0x00e0, 0x10, 19, 1),
99911b918d9SHui.Liu 	PIN_FIELD_BASE(87, 87, 2, 0x00e0, 0x10, 18, 1),
100011b918d9SHui.Liu 	PIN_FIELD_BASE(88, 88, 2, 0x00e0, 0x10, 20, 1),
100111b918d9SHui.Liu 	PIN_FIELD_BASE(89, 89, 2, 0x00e0, 0x10, 22, 1),
100211b918d9SHui.Liu 	PIN_FIELD_BASE(90, 90, 2, 0x00e0, 0x10, 21, 1),
100311b918d9SHui.Liu 	PIN_FIELD_BASE(91, 91, 2, 0x00e0, 0x10, 23, 1),
100411b918d9SHui.Liu 	PIN_FIELD_BASE(92, 92, 2, 0x00e0, 0x10, 3, 1),
100511b918d9SHui.Liu 	PIN_FIELD_BASE(93, 93, 2, 0x00e0, 0x10, 2, 1),
100611b918d9SHui.Liu 	PIN_FIELD_BASE(94, 94, 2, 0x00e0, 0x10, 5, 1),
100711b918d9SHui.Liu 	PIN_FIELD_BASE(95, 95, 2, 0x00e0, 0x10, 4, 1),
100811b918d9SHui.Liu 	PIN_FIELD_BASE(96, 96, 2, 0x00d0, 0x10, 31, 1),
100911b918d9SHui.Liu 	PIN_FIELD_BASE(97, 97, 2, 0x00e0, 0x10, 0, 1),
101011b918d9SHui.Liu 	PIN_FIELD_BASE(98, 98, 2, 0x00e0, 0x10, 8, 1),
101111b918d9SHui.Liu 	PIN_FIELD_BASE(99, 99, 2, 0x00d0, 0x10, 30, 1),
101211b918d9SHui.Liu 	PIN_FIELD_BASE(100, 100, 2, 0x00e0, 0x10, 1, 1),
101311b918d9SHui.Liu 	PIN_FIELD_BASE(101, 101, 2, 0x00d0, 0x10, 0, 1),
101411b918d9SHui.Liu 	PIN_FIELD_BASE(102, 102, 2, 0x00d0, 0x10, 5, 1),
101511b918d9SHui.Liu 	PIN_FIELD_BASE(103, 103, 2, 0x00d0, 0x10, 3, 1),
101611b918d9SHui.Liu 	PIN_FIELD_BASE(104, 104, 2, 0x00d0, 0x10, 4, 1),
101711b918d9SHui.Liu 	PIN_FIELD_BASE(105, 105, 2, 0x00d0, 0x10, 1, 1),
101811b918d9SHui.Liu 	PIN_FIELD_BASE(106, 106, 2, 0x00d0, 0x10, 2, 1),
101911b918d9SHui.Liu 	PIN_FIELD_BASE(107, 107, 2, 0x00d0, 0x10, 21, 1),
102011b918d9SHui.Liu 	PIN_FIELD_BASE(108, 108, 2, 0x00d0, 0x10, 16, 1),
102111b918d9SHui.Liu 	PIN_FIELD_BASE(109, 109, 2, 0x00d0, 0x10, 22, 1),
102211b918d9SHui.Liu 	PIN_FIELD_BASE(110, 110, 2, 0x00d0, 0x10, 17, 1),
102311b918d9SHui.Liu 	PIN_FIELD_BASE(111, 111, 2, 0x00d0, 0x10, 18, 1),
102411b918d9SHui.Liu 	PIN_FIELD_BASE(112, 112, 2, 0x00d0, 0x10, 19, 1),
102511b918d9SHui.Liu 	PIN_FIELD_BASE(113, 113, 2, 0x00d0, 0x10, 20, 1),
102611b918d9SHui.Liu 	PIN_FIELD_BASE(114, 114, 2, 0x00d0, 0x10, 28, 1),
102711b918d9SHui.Liu 	PIN_FIELD_BASE(115, 115, 2, 0x00d0, 0x10, 23, 1),
102811b918d9SHui.Liu 	PIN_FIELD_BASE(116, 116, 2, 0x00d0, 0x10, 29, 1),
102911b918d9SHui.Liu 	PIN_FIELD_BASE(117, 117, 2, 0x00d0, 0x10, 24, 1),
103011b918d9SHui.Liu 	PIN_FIELD_BASE(118, 118, 2, 0x00d0, 0x10, 25, 1),
103111b918d9SHui.Liu 	PIN_FIELD_BASE(119, 119, 2, 0x00d0, 0x10, 26, 1),
103211b918d9SHui.Liu 	PIN_FIELD_BASE(120, 120, 2, 0x00d0, 0x10, 27, 1),
103311b918d9SHui.Liu 	PIN_FIELD_BASE(121, 121, 3, 0x0070, 0x10, 8, 1),
103411b918d9SHui.Liu 	PIN_FIELD_BASE(122, 122, 3, 0x0070, 0x10, 11, 1),
103511b918d9SHui.Liu 	PIN_FIELD_BASE(123, 123, 3, 0x0070, 0x10, 10, 1),
103611b918d9SHui.Liu 	PIN_FIELD_BASE(124, 124, 3, 0x0070, 0x10, 9, 1),
103711b918d9SHui.Liu 	PIN_FIELD_BASE(125, 125, 2, 0x00d0, 0x10, 6, 1),
103811b918d9SHui.Liu 	PIN_FIELD_BASE(126, 126, 2, 0x00d0, 0x10, 7, 1),
103911b918d9SHui.Liu 	PIN_FIELD_BASE(127, 127, 2, 0x00d0, 0x10, 8, 1),
104011b918d9SHui.Liu 	PIN_FIELD_BASE(128, 128, 2, 0x00d0, 0x10, 9, 1),
104111b918d9SHui.Liu 	PIN_FIELD_BASE(129, 129, 2, 0x00d0, 0x10, 10, 1),
104211b918d9SHui.Liu 	PIN_FIELD_BASE(130, 130, 2, 0x00d0, 0x10, 11, 1),
104311b918d9SHui.Liu 	PIN_FIELD_BASE(175, 175, 2, 0x00e0, 0x10, 11, 1),
104411b918d9SHui.Liu 	PIN_FIELD_BASE(176, 176, 2, 0x00e0, 0x10, 12, 1),
104511b918d9SHui.Liu };
104611b918d9SHui.Liu 
104711b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_pd_range[] = {
104811b918d9SHui.Liu 	PIN_FIELD_BASE(0, 0, 1, 0x00b0, 0x10, 6, 1),
104911b918d9SHui.Liu 	PIN_FIELD_BASE(1, 1, 1, 0x00b0, 0x10, 7, 1),
105011b918d9SHui.Liu 	PIN_FIELD_BASE(2, 2, 1, 0x00b0, 0x10, 8, 1),
105111b918d9SHui.Liu 	PIN_FIELD_BASE(3, 3, 1, 0x00b0, 0x10, 9, 1),
105211b918d9SHui.Liu 	PIN_FIELD_BASE(4, 4, 1, 0x00b0, 0x10, 10, 1),
105311b918d9SHui.Liu 	PIN_FIELD_BASE(5, 5, 1, 0x00b0, 0x10, 11, 1),
105411b918d9SHui.Liu 	PIN_FIELD_BASE(6, 6, 1, 0x00b0, 0x10, 12, 1),
105511b918d9SHui.Liu 	PIN_FIELD_BASE(7, 7, 1, 0x00b0, 0x10, 13, 1),
105611b918d9SHui.Liu 	PIN_FIELD_BASE(8, 8, 1, 0x00b0, 0x10, 14, 1),
105711b918d9SHui.Liu 	PIN_FIELD_BASE(9, 9, 1, 0x00b0, 0x10, 15, 1),
105811b918d9SHui.Liu 	PIN_FIELD_BASE(10, 10, 1, 0x00b0, 0x10, 16, 1),
105911b918d9SHui.Liu 	PIN_FIELD_BASE(11, 11, 1, 0x00b0, 0x10, 17, 1),
106011b918d9SHui.Liu 	PIN_FIELD_BASE(12, 12, 2, 0x00a0, 0x10, 12, 1),
106111b918d9SHui.Liu 	PIN_FIELD_BASE(13, 13, 2, 0x00a0, 0x10, 13, 1),
106211b918d9SHui.Liu 	PIN_FIELD_BASE(14, 14, 2, 0x00a0, 0x10, 14, 1),
106311b918d9SHui.Liu 	PIN_FIELD_BASE(15, 15, 2, 0x00a0, 0x10, 15, 1),
106411b918d9SHui.Liu 	PIN_FIELD_BASE(16, 16, 3, 0x0050, 0x10, 1, 1),
106511b918d9SHui.Liu 	PIN_FIELD_BASE(17, 17, 3, 0x0050, 0x10, 2, 1),
106611b918d9SHui.Liu 	PIN_FIELD_BASE(18, 18, 4, 0x0060, 0x10, 3, 1),
106711b918d9SHui.Liu 	PIN_FIELD_BASE(19, 19, 4, 0x0060, 0x10, 5, 1),
106811b918d9SHui.Liu 	PIN_FIELD_BASE(20, 20, 4, 0x0060, 0x10, 4, 1),
106911b918d9SHui.Liu 	PIN_FIELD_BASE(21, 21, 4, 0x0060, 0x10, 6, 1),
107011b918d9SHui.Liu 	PIN_FIELD_BASE(22, 22, 4, 0x0060, 0x10, 0, 1),
107111b918d9SHui.Liu 	PIN_FIELD_BASE(23, 23, 4, 0x0060, 0x10, 1, 1),
107211b918d9SHui.Liu 	PIN_FIELD_BASE(24, 24, 4, 0x0060, 0x10, 2, 1),
107311b918d9SHui.Liu 	PIN_FIELD_BASE(25, 25, 1, 0x00b0, 0x10, 3, 1),
107411b918d9SHui.Liu 	PIN_FIELD_BASE(26, 26, 1, 0x00b0, 0x10, 2, 1),
107511b918d9SHui.Liu 	PIN_FIELD_BASE(27, 27, 1, 0x00b0, 0x10, 5, 1),
107611b918d9SHui.Liu 	PIN_FIELD_BASE(28, 28, 1, 0x00b0, 0x10, 4, 1),
107711b918d9SHui.Liu 	PIN_FIELD_BASE(29, 29, 1, 0x00b0, 0x10, 0, 1),
107811b918d9SHui.Liu 	PIN_FIELD_BASE(30, 30, 1, 0x00b0, 0x10, 1, 1),
107911b918d9SHui.Liu 	PIN_FIELD_BASE(31, 31, 1, 0x00c0, 0x10, 11, 1),
108011b918d9SHui.Liu 	PIN_FIELD_BASE(32, 32, 1, 0x00c0, 0x10, 10, 1),
108111b918d9SHui.Liu 	PIN_FIELD_BASE(33, 33, 1, 0x00c0, 0x10, 13, 1),
108211b918d9SHui.Liu 	PIN_FIELD_BASE(34, 34, 1, 0x00c0, 0x10, 12, 1),
108311b918d9SHui.Liu 	PIN_FIELD_BASE(35, 35, 1, 0x00c0, 0x10, 15, 1),
108411b918d9SHui.Liu 	PIN_FIELD_BASE(36, 36, 1, 0x00c0, 0x10, 14, 1),
108511b918d9SHui.Liu 	PIN_FIELD_BASE(37, 37, 1, 0x00b0, 0x10, 21, 1),
108611b918d9SHui.Liu 	PIN_FIELD_BASE(38, 38, 1, 0x00b0, 0x10, 18, 1),
108711b918d9SHui.Liu 	PIN_FIELD_BASE(39, 39, 1, 0x00b0, 0x10, 19, 1),
108811b918d9SHui.Liu 	PIN_FIELD_BASE(40, 40, 1, 0x00b0, 0x10, 20, 1),
108911b918d9SHui.Liu 	PIN_FIELD_BASE(41, 41, 1, 0x00b0, 0x10, 22, 1),
109011b918d9SHui.Liu 	PIN_FIELD_BASE(46, 46, 3, 0x0050, 0x10, 0, 1),
109111b918d9SHui.Liu 	PIN_FIELD_BASE(47, 47, 1, 0x00b0, 0x10, 25, 1),
109211b918d9SHui.Liu 	PIN_FIELD_BASE(48, 48, 1, 0x00b0, 0x10, 24, 1),
109311b918d9SHui.Liu 	PIN_FIELD_BASE(49, 49, 1, 0x00b0, 0x10, 23, 1),
109411b918d9SHui.Liu 	PIN_FIELD_BASE(50, 50, 3, 0x0050, 0x10, 5, 1),
109511b918d9SHui.Liu 	PIN_FIELD_BASE(51, 51, 3, 0x0050, 0x10, 4, 1),
109611b918d9SHui.Liu 	PIN_FIELD_BASE(52, 52, 3, 0x0050, 0x10, 3, 1),
109711b918d9SHui.Liu 	PIN_FIELD_BASE(53, 53, 3, 0x0050, 0x10, 6, 1),
109811b918d9SHui.Liu 	PIN_FIELD_BASE(54, 54, 3, 0x0050, 0x10, 7, 1),
109911b918d9SHui.Liu 	PIN_FIELD_BASE(55, 55, 1, 0x00b0, 0x10, 26, 1),
110011b918d9SHui.Liu 	PIN_FIELD_BASE(56, 56, 1, 0x00b0, 0x10, 29, 1),
110111b918d9SHui.Liu 	PIN_FIELD_BASE(57, 57, 2, 0x00b0, 0x10, 6, 1),
110211b918d9SHui.Liu 	PIN_FIELD_BASE(58, 58, 2, 0x00b0, 0x10, 9, 1),
110311b918d9SHui.Liu 	PIN_FIELD_BASE(59, 59, 1, 0x00b0, 0x10, 27, 1),
110411b918d9SHui.Liu 	PIN_FIELD_BASE(60, 60, 1, 0x00b0, 0x10, 30, 1),
110511b918d9SHui.Liu 	PIN_FIELD_BASE(61, 61, 1, 0x00b0, 0x10, 28, 1),
110611b918d9SHui.Liu 	PIN_FIELD_BASE(62, 62, 1, 0x00b0, 0x10, 31, 1),
110711b918d9SHui.Liu 	PIN_FIELD_BASE(63, 63, 2, 0x00b0, 0x10, 7, 1),
110811b918d9SHui.Liu 	PIN_FIELD_BASE(64, 64, 2, 0x00b0, 0x10, 10, 1),
110911b918d9SHui.Liu 	PIN_FIELD_BASE(65, 65, 4, 0x0060, 0x10, 7, 1),
111011b918d9SHui.Liu 	PIN_FIELD_BASE(66, 66, 4, 0x0060, 0x10, 9, 1),
111111b918d9SHui.Liu 	PIN_FIELD_BASE(67, 67, 4, 0x0060, 0x10, 8, 1),
111211b918d9SHui.Liu 	PIN_FIELD_BASE(68, 68, 4, 0x0060, 0x10, 10, 1),
111311b918d9SHui.Liu 	PIN_FIELD_BASE(69, 69, 1, 0x00c0, 0x10, 1, 1),
111411b918d9SHui.Liu 	PIN_FIELD_BASE(70, 70, 1, 0x00c0, 0x10, 0, 1),
111511b918d9SHui.Liu 	PIN_FIELD_BASE(71, 71, 1, 0x00c0, 0x10, 5, 1),
111611b918d9SHui.Liu 	PIN_FIELD_BASE(72, 72, 1, 0x00c0, 0x10, 4, 1),
111711b918d9SHui.Liu 	PIN_FIELD_BASE(73, 73, 1, 0x00c0, 0x10, 2, 1),
111811b918d9SHui.Liu 	PIN_FIELD_BASE(74, 74, 1, 0x00c0, 0x10, 3, 1),
111911b918d9SHui.Liu 	PIN_FIELD_BASE(75, 75, 1, 0x00c0, 0x10, 7, 1),
112011b918d9SHui.Liu 	PIN_FIELD_BASE(76, 76, 1, 0x00c0, 0x10, 6, 1),
112111b918d9SHui.Liu 	PIN_FIELD_BASE(77, 77, 1, 0x00c0, 0x10, 9, 1),
112211b918d9SHui.Liu 	PIN_FIELD_BASE(78, 78, 1, 0x00c0, 0x10, 8, 1),
112311b918d9SHui.Liu 	PIN_FIELD_BASE(79, 79, 4, 0x0060, 0x10, 12, 1),
112411b918d9SHui.Liu 	PIN_FIELD_BASE(80, 80, 4, 0x0060, 0x10, 11, 1),
112511b918d9SHui.Liu 	PIN_FIELD_BASE(81, 81, 4, 0x0060, 0x10, 14, 1),
112611b918d9SHui.Liu 	PIN_FIELD_BASE(82, 82, 4, 0x0060, 0x10, 13, 1),
112711b918d9SHui.Liu 	PIN_FIELD_BASE(83, 83, 2, 0x00b0, 0x10, 16, 1),
112811b918d9SHui.Liu 	PIN_FIELD_BASE(84, 84, 2, 0x00b0, 0x10, 15, 1),
112911b918d9SHui.Liu 	PIN_FIELD_BASE(85, 85, 2, 0x00b0, 0x10, 17, 1),
113011b918d9SHui.Liu 	PIN_FIELD_BASE(86, 86, 2, 0x00b0, 0x10, 19, 1),
113111b918d9SHui.Liu 	PIN_FIELD_BASE(87, 87, 2, 0x00b0, 0x10, 18, 1),
113211b918d9SHui.Liu 	PIN_FIELD_BASE(88, 88, 2, 0x00b0, 0x10, 20, 1),
113311b918d9SHui.Liu 	PIN_FIELD_BASE(89, 89, 2, 0x00b0, 0x10, 22, 1),
113411b918d9SHui.Liu 	PIN_FIELD_BASE(90, 90, 2, 0x00b0, 0x10, 21, 1),
113511b918d9SHui.Liu 	PIN_FIELD_BASE(91, 91, 2, 0x00b0, 0x10, 23, 1),
113611b918d9SHui.Liu 	PIN_FIELD_BASE(92, 92, 2, 0x00b0, 0x10, 3, 1),
113711b918d9SHui.Liu 	PIN_FIELD_BASE(93, 93, 2, 0x00b0, 0x10, 2, 1),
113811b918d9SHui.Liu 	PIN_FIELD_BASE(94, 94, 2, 0x00b0, 0x10, 5, 1),
113911b918d9SHui.Liu 	PIN_FIELD_BASE(95, 95, 2, 0x00b0, 0x10, 4, 1),
114011b918d9SHui.Liu 	PIN_FIELD_BASE(96, 96, 2, 0x00a0, 0x10, 31, 1),
114111b918d9SHui.Liu 	PIN_FIELD_BASE(97, 97, 2, 0x00b0, 0x10, 0, 1),
114211b918d9SHui.Liu 	PIN_FIELD_BASE(98, 98, 2, 0x00b0, 0x10, 8, 1),
114311b918d9SHui.Liu 	PIN_FIELD_BASE(99, 99, 2, 0x00a0, 0x10, 30, 1),
114411b918d9SHui.Liu 	PIN_FIELD_BASE(100, 100, 2, 0x00b0, 0x10, 1, 1),
114511b918d9SHui.Liu 	PIN_FIELD_BASE(101, 101, 2, 0x00a0, 0x10, 0, 1),
114611b918d9SHui.Liu 	PIN_FIELD_BASE(102, 102, 2, 0x00a0, 0x10, 5, 1),
114711b918d9SHui.Liu 	PIN_FIELD_BASE(103, 103, 2, 0x00a0, 0x10, 3, 1),
114811b918d9SHui.Liu 	PIN_FIELD_BASE(104, 104, 2, 0x00a0, 0x10, 4, 1),
114911b918d9SHui.Liu 	PIN_FIELD_BASE(105, 105, 2, 0x00a0, 0x10, 1, 1),
115011b918d9SHui.Liu 	PIN_FIELD_BASE(106, 106, 2, 0x00a0, 0x10, 2, 1),
115111b918d9SHui.Liu 	PIN_FIELD_BASE(107, 107, 2, 0x00a0, 0x10, 21, 1),
115211b918d9SHui.Liu 	PIN_FIELD_BASE(108, 108, 2, 0x00a0, 0x10, 16, 1),
115311b918d9SHui.Liu 	PIN_FIELD_BASE(109, 109, 2, 0x00a0, 0x10, 22, 1),
115411b918d9SHui.Liu 	PIN_FIELD_BASE(110, 110, 2, 0x00a0, 0x10, 17, 1),
115511b918d9SHui.Liu 	PIN_FIELD_BASE(111, 111, 2, 0x00a0, 0x10, 18, 1),
115611b918d9SHui.Liu 	PIN_FIELD_BASE(112, 112, 2, 0x00a0, 0x10, 19, 1),
115711b918d9SHui.Liu 	PIN_FIELD_BASE(113, 113, 2, 0x00a0, 0x10, 20, 1),
115811b918d9SHui.Liu 	PIN_FIELD_BASE(114, 114, 2, 0x00a0, 0x10, 28, 1),
115911b918d9SHui.Liu 	PIN_FIELD_BASE(115, 115, 2, 0x00a0, 0x10, 23, 1),
116011b918d9SHui.Liu 	PIN_FIELD_BASE(116, 116, 2, 0x00a0, 0x10, 29, 1),
116111b918d9SHui.Liu 	PIN_FIELD_BASE(117, 117, 2, 0x00a0, 0x10, 24, 1),
116211b918d9SHui.Liu 	PIN_FIELD_BASE(118, 118, 2, 0x00a0, 0x10, 25, 1),
116311b918d9SHui.Liu 	PIN_FIELD_BASE(119, 119, 2, 0x00a0, 0x10, 26, 1),
116411b918d9SHui.Liu 	PIN_FIELD_BASE(120, 120, 2, 0x00a0, 0x10, 27, 1),
116511b918d9SHui.Liu 	PIN_FIELD_BASE(121, 121, 3, 0x0050, 0x10, 8, 1),
116611b918d9SHui.Liu 	PIN_FIELD_BASE(122, 122, 3, 0x0050, 0x10, 11, 1),
116711b918d9SHui.Liu 	PIN_FIELD_BASE(123, 123, 3, 0x0050, 0x10, 10, 1),
116811b918d9SHui.Liu 	PIN_FIELD_BASE(124, 124, 3, 0x0050, 0x10, 9, 1),
116911b918d9SHui.Liu 	PIN_FIELD_BASE(125, 125, 2, 0x00a0, 0x10, 6, 1),
117011b918d9SHui.Liu 	PIN_FIELD_BASE(126, 126, 2, 0x00a0, 0x10, 7, 1),
117111b918d9SHui.Liu 	PIN_FIELD_BASE(127, 127, 2, 0x00a0, 0x10, 8, 1),
117211b918d9SHui.Liu 	PIN_FIELD_BASE(128, 128, 2, 0x00a0, 0x10, 9, 1),
117311b918d9SHui.Liu 	PIN_FIELD_BASE(129, 129, 2, 0x00a0, 0x10, 10, 1),
117411b918d9SHui.Liu 	PIN_FIELD_BASE(130, 130, 2, 0x00a0, 0x10, 11, 1),
117511b918d9SHui.Liu 	PIN_FIELD_BASE(175, 175, 2, 0x00b0, 0x10, 11, 1),
117611b918d9SHui.Liu 	PIN_FIELD_BASE(176, 176, 2, 0x00b0, 0x10, 12, 1),
117711b918d9SHui.Liu };
117811b918d9SHui.Liu 
117911b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_drv_range[] = {
118011b918d9SHui.Liu 	PIN_FIELD_BASE(0, 0, 1, 0x0000, 0x10, 24, 3),
118111b918d9SHui.Liu 	PIN_FIELD_BASE(1, 1, 1, 0x0000, 0x10, 27, 3),
118211b918d9SHui.Liu 	PIN_FIELD_BASE(2, 2, 1, 0x0010, 0x10, 0, 3),
118311b918d9SHui.Liu 	PIN_FIELD_BASE(3, 3, 1, 0x0010, 0x10, 3, 3),
118411b918d9SHui.Liu 	PIN_FIELD_BASE(4, 4, 1, 0x0020, 0x10, 9, 3),
118511b918d9SHui.Liu 	PIN_FIELD_BASE(5, 5, 1, 0x0020, 0x10, 9, 3),
118611b918d9SHui.Liu 	PIN_FIELD_BASE(6, 6, 1, 0x0020, 0x10, 9, 3),
118711b918d9SHui.Liu 	PIN_FIELD_BASE(7, 7, 1, 0x0010, 0x10, 6, 3),
118811b918d9SHui.Liu 	PIN_FIELD_BASE(8, 8, 1, 0x0010, 0x10, 9, 3),
118911b918d9SHui.Liu 	PIN_FIELD_BASE(9, 9, 1, 0x0010, 0x10, 12, 3),
119011b918d9SHui.Liu 	PIN_FIELD_BASE(10, 10, 1, 0x0010, 0x10, 15, 3),
119111b918d9SHui.Liu 	PIN_FIELD_BASE(11, 11, 1, 0x0020, 0x10, 12, 3),
119211b918d9SHui.Liu 	PIN_FIELD_BASE(12, 12, 2, 0x0010, 0x10, 24, 3),
119311b918d9SHui.Liu 	PIN_FIELD_BASE(13, 13, 2, 0x0010, 0x10, 27, 3),
119411b918d9SHui.Liu 	PIN_FIELD_BASE(14, 14, 2, 0x0020, 0x10, 0, 3),
119511b918d9SHui.Liu 	PIN_FIELD_BASE(15, 15, 2, 0x0020, 0x10, 3, 3),
119611b918d9SHui.Liu 	PIN_FIELD_BASE(16, 16, 3, 0x0010, 0x10, 15, 3),
119711b918d9SHui.Liu 	PIN_FIELD_BASE(17, 17, 3, 0x0010, 0x10, 15, 3),
119811b918d9SHui.Liu 	PIN_FIELD_BASE(18, 18, 4, 0x0000, 0x10, 27, 3),
119911b918d9SHui.Liu 	PIN_FIELD_BASE(19, 19, 4, 0x0000, 0x10, 27, 3),
120011b918d9SHui.Liu 	PIN_FIELD_BASE(20, 20, 4, 0x0000, 0x10, 27, 3),
120111b918d9SHui.Liu 	PIN_FIELD_BASE(21, 21, 4, 0x0000, 0x10, 27, 3),
120211b918d9SHui.Liu 	PIN_FIELD_BASE(22, 22, 4, 0x0000, 0x10, 0, 3),
120311b918d9SHui.Liu 	PIN_FIELD_BASE(23, 23, 4, 0x0000, 0x10, 3, 3),
120411b918d9SHui.Liu 	PIN_FIELD_BASE(24, 24, 4, 0x0000, 0x10, 6, 3),
120511b918d9SHui.Liu 	PIN_FIELD_BASE(25, 25, 1, 0x0020, 0x10, 6, 3),
120611b918d9SHui.Liu 	PIN_FIELD_BASE(26, 26, 1, 0x0020, 0x10, 6, 3),
120711b918d9SHui.Liu 	PIN_FIELD_BASE(27, 27, 1, 0x0020, 0x10, 6, 3),
120811b918d9SHui.Liu 	PIN_FIELD_BASE(28, 28, 1, 0x0020, 0x10, 9, 3),
120911b918d9SHui.Liu 	PIN_FIELD_BASE(29, 29, 1, 0x0020, 0x10, 3, 3),
121011b918d9SHui.Liu 	PIN_FIELD_BASE(30, 30, 1, 0x0020, 0x10, 6, 3),
121111b918d9SHui.Liu 	PIN_FIELD_BASE(31, 31, 1, 0x0020, 0x10, 12, 3),
121211b918d9SHui.Liu 	PIN_FIELD_BASE(32, 32, 1, 0x0020, 0x10, 12, 3),
121311b918d9SHui.Liu 	PIN_FIELD_BASE(33, 33, 1, 0x0020, 0x10, 15, 3),
121411b918d9SHui.Liu 	PIN_FIELD_BASE(34, 34, 1, 0x0020, 0x10, 15, 3),
121511b918d9SHui.Liu 	PIN_FIELD_BASE(35, 35, 1, 0x0020, 0x10, 12, 3),
121611b918d9SHui.Liu 	PIN_FIELD_BASE(36, 36, 1, 0x0020, 0x10, 15, 3),
121711b918d9SHui.Liu 	PIN_FIELD_BASE(37, 37, 1, 0x0010, 0x10, 27, 3),
121811b918d9SHui.Liu 	PIN_FIELD_BASE(38, 38, 1, 0x0010, 0x10, 18, 3),
121911b918d9SHui.Liu 	PIN_FIELD_BASE(39, 39, 1, 0x0010, 0x10, 21, 3),
122011b918d9SHui.Liu 	PIN_FIELD_BASE(40, 40, 1, 0x0010, 0x10, 24, 3),
122111b918d9SHui.Liu 	PIN_FIELD_BASE(41, 41, 1, 0x0020, 0x10, 0, 3),
122211b918d9SHui.Liu 	PIN_FIELD_BASE(42, 42, 2, 0x0020, 0x10, 18, 3),
122311b918d9SHui.Liu 	PIN_FIELD_BASE(43, 43, 2, 0x0020, 0x10, 18, 3),
122411b918d9SHui.Liu 	PIN_FIELD_BASE(44, 44, 2, 0x0020, 0x10, 18, 3),
122511b918d9SHui.Liu 	PIN_FIELD_BASE(45, 45, 2, 0x0020, 0x10, 21, 3),
122611b918d9SHui.Liu 	PIN_FIELD_BASE(46, 46, 3, 0x0010, 0x10, 15, 3),
122711b918d9SHui.Liu 	PIN_FIELD_BASE(47, 47, 1, 0x0020, 0x10, 3, 3),
122811b918d9SHui.Liu 	PIN_FIELD_BASE(48, 48, 1, 0x0020, 0x10, 3, 3),
122911b918d9SHui.Liu 	PIN_FIELD_BASE(49, 49, 1, 0x0020, 0x10, 3, 3),
123011b918d9SHui.Liu 	PIN_FIELD_BASE(50, 50, 3, 0x0000, 0x10, 6, 3),
123111b918d9SHui.Liu 	PIN_FIELD_BASE(51, 51, 3, 0x0000, 0x10, 3, 3),
123211b918d9SHui.Liu 	PIN_FIELD_BASE(52, 52, 3, 0x0000, 0x10, 0, 3),
123311b918d9SHui.Liu 	PIN_FIELD_BASE(53, 53, 3, 0x0000, 0x10, 9, 3),
123411b918d9SHui.Liu 	PIN_FIELD_BASE(54, 54, 3, 0x0000, 0x10, 12, 3),
123511b918d9SHui.Liu 	PIN_FIELD_BASE(55, 55, 1, 0x0020, 0x10, 27, 3),
123611b918d9SHui.Liu 	PIN_FIELD_BASE(56, 56, 1, 0x0030, 0x10, 6, 3),
123711b918d9SHui.Liu 	PIN_FIELD_BASE(57, 57, 2, 0x0030, 0x10, 9, 3),
123811b918d9SHui.Liu 	PIN_FIELD_BASE(58, 58, 2, 0x0030, 0x10, 15, 3),
123911b918d9SHui.Liu 	PIN_FIELD_BASE(59, 59, 1, 0x0030, 0x10, 0, 3),
124011b918d9SHui.Liu 	PIN_FIELD_BASE(60, 60, 1, 0x0030, 0x10, 9, 3),
124111b918d9SHui.Liu 	PIN_FIELD_BASE(61, 61, 1, 0x0030, 0x10, 3, 3),
124211b918d9SHui.Liu 	PIN_FIELD_BASE(62, 62, 1, 0x0030, 0x10, 12, 3),
124311b918d9SHui.Liu 	PIN_FIELD_BASE(63, 63, 2, 0x0030, 0x10, 12, 3),
124411b918d9SHui.Liu 	PIN_FIELD_BASE(64, 64, 2, 0x0030, 0x10, 18, 3),
124511b918d9SHui.Liu 	PIN_FIELD_BASE(65, 65, 4, 0x0010, 0x10, 0, 3),
124611b918d9SHui.Liu 	PIN_FIELD_BASE(66, 66, 4, 0x0010, 0x10, 6, 3),
124711b918d9SHui.Liu 	PIN_FIELD_BASE(67, 67, 4, 0x0010, 0x10, 3, 3),
124811b918d9SHui.Liu 	PIN_FIELD_BASE(68, 68, 4, 0x0010, 0x10, 9, 3),
124911b918d9SHui.Liu 	PIN_FIELD_BASE(69, 69, 1, 0x0030, 0x10, 18, 3),
125011b918d9SHui.Liu 	PIN_FIELD_BASE(70, 70, 1, 0x0030, 0x10, 15, 3),
125111b918d9SHui.Liu 	PIN_FIELD_BASE(71, 71, 1, 0x0040, 0x10, 0, 3),
125211b918d9SHui.Liu 	PIN_FIELD_BASE(72, 72, 1, 0x0030, 0x10, 27, 3),
125311b918d9SHui.Liu 	PIN_FIELD_BASE(73, 73, 1, 0x0030, 0x10, 21, 3),
125411b918d9SHui.Liu 	PIN_FIELD_BASE(74, 74, 1, 0x0030, 0x10, 24, 3),
125511b918d9SHui.Liu 	PIN_FIELD_BASE(75, 75, 1, 0x0040, 0x10, 6, 3),
125611b918d9SHui.Liu 	PIN_FIELD_BASE(76, 76, 1, 0x0040, 0x10, 3, 3),
125711b918d9SHui.Liu 	PIN_FIELD_BASE(77, 77, 1, 0x0040, 0x10, 12, 3),
125811b918d9SHui.Liu 	PIN_FIELD_BASE(78, 78, 1, 0x0040, 0x10, 9, 3),
125911b918d9SHui.Liu 	PIN_FIELD_BASE(79, 79, 4, 0x0010, 0x10, 15, 3),
126011b918d9SHui.Liu 	PIN_FIELD_BASE(80, 80, 4, 0x0010, 0x10, 12, 3),
126111b918d9SHui.Liu 	PIN_FIELD_BASE(81, 81, 4, 0x0010, 0x10, 21, 3),
126211b918d9SHui.Liu 	PIN_FIELD_BASE(82, 82, 4, 0x0010, 0x10, 18, 3),
126311b918d9SHui.Liu 	PIN_FIELD_BASE(83, 83, 2, 0x0030, 0x10, 0, 3),
126411b918d9SHui.Liu 	PIN_FIELD_BASE(84, 84, 2, 0x0020, 0x10, 27, 3),
126511b918d9SHui.Liu 	PIN_FIELD_BASE(85, 85, 2, 0x0030, 0x10, 0, 3),
126611b918d9SHui.Liu 	PIN_FIELD_BASE(86, 86, 2, 0x0020, 0x10, 6, 3),
126711b918d9SHui.Liu 	PIN_FIELD_BASE(87, 87, 2, 0x0020, 0x10, 6, 3),
126811b918d9SHui.Liu 	PIN_FIELD_BASE(88, 88, 2, 0x0020, 0x10, 6, 3),
126911b918d9SHui.Liu 	PIN_FIELD_BASE(89, 89, 2, 0x0020, 0x10, 6, 3),
127011b918d9SHui.Liu 	PIN_FIELD_BASE(90, 90, 2, 0x0030, 0x10, 0, 3),
127111b918d9SHui.Liu 	PIN_FIELD_BASE(91, 91, 2, 0x0030, 0x10, 0, 3),
127211b918d9SHui.Liu 	PIN_FIELD_BASE(92, 92, 2, 0x0020, 0x10, 9, 3),
127311b918d9SHui.Liu 	PIN_FIELD_BASE(93, 93, 2, 0x0020, 0x10, 9, 3),
127411b918d9SHui.Liu 	PIN_FIELD_BASE(94, 94, 2, 0x0020, 0x10, 9, 3),
127511b918d9SHui.Liu 	PIN_FIELD_BASE(95, 95, 2, 0x0020, 0x10, 9, 3),
127611b918d9SHui.Liu 	PIN_FIELD_BASE(96, 96, 2, 0x0020, 0x10, 21, 3),
127711b918d9SHui.Liu 	PIN_FIELD_BASE(97, 97, 2, 0x0020, 0x10, 21, 3),
127811b918d9SHui.Liu 	PIN_FIELD_BASE(98, 98, 2, 0x0020, 0x10, 24, 3),
127911b918d9SHui.Liu 	PIN_FIELD_BASE(99, 99, 2, 0x0020, 0x10, 21, 3),
128011b918d9SHui.Liu 	PIN_FIELD_BASE(100, 100, 2, 0x0030, 0x10, 6, 3),
128111b918d9SHui.Liu 	PIN_FIELD_BASE(101, 101, 2, 0x0000, 0x10, 0, 3),
128211b918d9SHui.Liu 	PIN_FIELD_BASE(102, 102, 2, 0x0000, 0x10, 15, 3),
128311b918d9SHui.Liu 	PIN_FIELD_BASE(103, 103, 2, 0x0000, 0x10, 9, 3),
128411b918d9SHui.Liu 	PIN_FIELD_BASE(104, 104, 2, 0x0000, 0x10, 12, 3),
128511b918d9SHui.Liu 	PIN_FIELD_BASE(105, 105, 2, 0x0000, 0x10, 3, 3),
128611b918d9SHui.Liu 	PIN_FIELD_BASE(106, 106, 2, 0x0000, 0x10, 6, 3),
128711b918d9SHui.Liu 	PIN_FIELD_BASE(107, 107, 2, 0x0020, 0x10, 6, 3),
128811b918d9SHui.Liu 	PIN_FIELD_BASE(108, 108, 2, 0x0020, 0x10, 6, 3),
128911b918d9SHui.Liu 	PIN_FIELD_BASE(109, 109, 2, 0x0020, 0x10, 6, 3),
129011b918d9SHui.Liu 	PIN_FIELD_BASE(110, 110, 2, 0x0020, 0x10, 6, 3),
129111b918d9SHui.Liu 	PIN_FIELD_BASE(111, 111, 2, 0x0020, 0x10, 15, 3),
129211b918d9SHui.Liu 	PIN_FIELD_BASE(112, 112, 2, 0x0020, 0x10, 15, 3),
129311b918d9SHui.Liu 	PIN_FIELD_BASE(113, 113, 2, 0x0020, 0x10, 15, 3),
129411b918d9SHui.Liu 	PIN_FIELD_BASE(114, 114, 2, 0x0020, 0x10, 12, 3),
129511b918d9SHui.Liu 	PIN_FIELD_BASE(115, 115, 2, 0x0020, 0x10, 12, 3),
129611b918d9SHui.Liu 	PIN_FIELD_BASE(116, 116, 2, 0x0020, 0x10, 12, 3),
129711b918d9SHui.Liu 	PIN_FIELD_BASE(117, 117, 2, 0x0020, 0x10, 12, 3),
129811b918d9SHui.Liu 	PIN_FIELD_BASE(118, 118, 2, 0x0020, 0x10, 12, 3),
129911b918d9SHui.Liu 	PIN_FIELD_BASE(119, 119, 2, 0x0020, 0x10, 15, 3),
130011b918d9SHui.Liu 	PIN_FIELD_BASE(120, 120, 2, 0x0020, 0x10, 18, 3),
130111b918d9SHui.Liu 	PIN_FIELD_BASE(121, 121, 3, 0x0010, 0x10, 3, 3),
130211b918d9SHui.Liu 	PIN_FIELD_BASE(122, 122, 3, 0x0010, 0x10, 12, 3),
130311b918d9SHui.Liu 	PIN_FIELD_BASE(123, 123, 3, 0x0010, 0x10, 9, 3),
130411b918d9SHui.Liu 	PIN_FIELD_BASE(124, 124, 3, 0x0010, 0x10, 6, 3),
130511b918d9SHui.Liu 	PIN_FIELD_BASE(125, 125, 2, 0x0020, 0x10, 24, 3),
130611b918d9SHui.Liu 	PIN_FIELD_BASE(126, 126, 2, 0x0020, 0x10, 24, 3),
130711b918d9SHui.Liu 	PIN_FIELD_BASE(127, 127, 2, 0x0020, 0x10, 24, 3),
130811b918d9SHui.Liu 	PIN_FIELD_BASE(128, 128, 2, 0x0020, 0x10, 27, 3),
130911b918d9SHui.Liu 	PIN_FIELD_BASE(129, 129, 2, 0x0020, 0x10, 27, 3),
131011b918d9SHui.Liu 	PIN_FIELD_BASE(130, 130, 2, 0x0020, 0x10, 27, 3),
131111b918d9SHui.Liu 	PIN_FIELD_BASE(131, 131, 1, 0x0000, 0x10, 0, 3),
131211b918d9SHui.Liu 	PIN_FIELD_BASE(132, 132, 1, 0x0000, 0x10, 15, 3),
131311b918d9SHui.Liu 	PIN_FIELD_BASE(133, 133, 1, 0x0000, 0x10, 18, 3),
131411b918d9SHui.Liu 	PIN_FIELD_BASE(134, 134, 1, 0x0000, 0x10, 21, 3),
131511b918d9SHui.Liu 	PIN_FIELD_BASE(135, 135, 1, 0x0020, 0x10, 15, 3),
131611b918d9SHui.Liu 	PIN_FIELD_BASE(136, 136, 1, 0x0020, 0x10, 18, 3),
131711b918d9SHui.Liu 	PIN_FIELD_BASE(137, 137, 1, 0x0020, 0x10, 18, 3),
131811b918d9SHui.Liu 	PIN_FIELD_BASE(138, 138, 1, 0x0020, 0x10, 18, 3),
131911b918d9SHui.Liu 	PIN_FIELD_BASE(139, 139, 1, 0x0020, 0x10, 18, 3),
132011b918d9SHui.Liu 	PIN_FIELD_BASE(140, 140, 1, 0x0020, 0x10, 21, 3),
132111b918d9SHui.Liu 	PIN_FIELD_BASE(141, 141, 1, 0x0020, 0x10, 21, 3),
132211b918d9SHui.Liu 	PIN_FIELD_BASE(142, 142, 1, 0x0020, 0x10, 21, 3),
132311b918d9SHui.Liu 	PIN_FIELD_BASE(143, 143, 1, 0x0000, 0x10, 3, 3),
132411b918d9SHui.Liu 	PIN_FIELD_BASE(144, 144, 1, 0x0000, 0x10, 6, 3),
132511b918d9SHui.Liu 	PIN_FIELD_BASE(145, 145, 1, 0x0000, 0x10, 9, 3),
132611b918d9SHui.Liu 	PIN_FIELD_BASE(146, 146, 1, 0x0000, 0x10, 12, 3),
132711b918d9SHui.Liu 	PIN_FIELD_BASE(147, 147, 1, 0x0020, 0x10, 21, 3),
132811b918d9SHui.Liu 	PIN_FIELD_BASE(148, 148, 1, 0x0020, 0x10, 24, 3),
132911b918d9SHui.Liu 	PIN_FIELD_BASE(149, 149, 1, 0x0020, 0x10, 24, 3),
133011b918d9SHui.Liu 	PIN_FIELD_BASE(150, 150, 1, 0x0020, 0x10, 24, 3),
133111b918d9SHui.Liu 	PIN_FIELD_BASE(151, 151, 2, 0x0010, 0x10, 15, 3),
133211b918d9SHui.Liu 	PIN_FIELD_BASE(152, 152, 2, 0x0010, 0x10, 12, 3),
133311b918d9SHui.Liu 	PIN_FIELD_BASE(153, 153, 2, 0x0010, 0x10, 9, 3),
133411b918d9SHui.Liu 	PIN_FIELD_BASE(154, 154, 2, 0x0010, 0x10, 6, 3),
133511b918d9SHui.Liu 	PIN_FIELD_BASE(155, 155, 2, 0x0010, 0x10, 21, 3),
133611b918d9SHui.Liu 	PIN_FIELD_BASE(156, 156, 2, 0x0000, 0x10, 21, 3),
133711b918d9SHui.Liu 	PIN_FIELD_BASE(157, 157, 2, 0x0000, 0x10, 18, 3),
133811b918d9SHui.Liu 	PIN_FIELD_BASE(158, 158, 2, 0x0010, 0x10, 3, 3),
133911b918d9SHui.Liu 	PIN_FIELD_BASE(159, 159, 2, 0x0010, 0x10, 0, 3),
134011b918d9SHui.Liu 	PIN_FIELD_BASE(160, 160, 2, 0x0000, 0x10, 27, 3),
134111b918d9SHui.Liu 	PIN_FIELD_BASE(161, 161, 2, 0x0000, 0x10, 24, 3),
134211b918d9SHui.Liu 	PIN_FIELD_BASE(162, 162, 2, 0x0010, 0x10, 18, 3),
134311b918d9SHui.Liu 	PIN_FIELD_BASE(163, 163, 4, 0x0000, 0x10, 12, 3),
134411b918d9SHui.Liu 	PIN_FIELD_BASE(164, 164, 4, 0x0000, 0x10, 9, 3),
134511b918d9SHui.Liu 	PIN_FIELD_BASE(165, 165, 4, 0x0000, 0x10, 15, 3),
134611b918d9SHui.Liu 	PIN_FIELD_BASE(166, 166, 4, 0x0000, 0x10, 18, 3),
134711b918d9SHui.Liu 	PIN_FIELD_BASE(167, 167, 4, 0x0000, 0x10, 21, 3),
134811b918d9SHui.Liu 	PIN_FIELD_BASE(168, 168, 4, 0x0000, 0x10, 24, 3),
134911b918d9SHui.Liu 	PIN_FIELD_BASE(169, 169, 3, 0x0000, 0x10, 18, 3),
135011b918d9SHui.Liu 	PIN_FIELD_BASE(170, 170, 3, 0x0000, 0x10, 15, 3),
135111b918d9SHui.Liu 	PIN_FIELD_BASE(171, 171, 3, 0x0000, 0x10, 21, 3),
135211b918d9SHui.Liu 	PIN_FIELD_BASE(172, 172, 3, 0x0000, 0x10, 24, 3),
135311b918d9SHui.Liu 	PIN_FIELD_BASE(173, 173, 3, 0x0000, 0x10, 27, 3),
135411b918d9SHui.Liu 	PIN_FIELD_BASE(174, 174, 3, 0x0010, 0x10, 0, 3),
135511b918d9SHui.Liu 	PIN_FIELD_BASE(175, 175, 2, 0x0030, 0x10, 3, 3),
135611b918d9SHui.Liu 	PIN_FIELD_BASE(176, 176, 2, 0x0030, 0x10, 3, 3),
135711b918d9SHui.Liu };
135811b918d9SHui.Liu 
135911b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_drv_adv_range[] = {
136011b918d9SHui.Liu 	PIN_FIELD_BASE(53, 53, 3, 0x0020, 0x10, 0, 3),
136111b918d9SHui.Liu 	PIN_FIELD_BASE(54, 54, 3, 0x0020, 0x10, 3, 3),
136211b918d9SHui.Liu 	PIN_FIELD_BASE(55, 55, 1, 0x0060, 0x10, 0, 3),
136311b918d9SHui.Liu 	PIN_FIELD_BASE(56, 56, 1, 0x0060, 0x10, 9, 3),
136411b918d9SHui.Liu 	PIN_FIELD_BASE(57, 57, 2, 0x0050, 0x10, 0, 3),
136511b918d9SHui.Liu 	PIN_FIELD_BASE(58, 58, 2, 0x0050, 0x10, 6, 3),
136611b918d9SHui.Liu 	PIN_FIELD_BASE(59, 59, 1, 0x0060, 0x10, 3, 3),
136711b918d9SHui.Liu 	PIN_FIELD_BASE(60, 60, 1, 0x0060, 0x10, 12, 3),
136811b918d9SHui.Liu 	PIN_FIELD_BASE(61, 61, 1, 0x0060, 0x10, 6, 3),
136911b918d9SHui.Liu 	PIN_FIELD_BASE(62, 62, 1, 0x0060, 0x10, 15, 3),
137011b918d9SHui.Liu 	PIN_FIELD_BASE(63, 63, 2, 0x0050, 0x10, 3, 3),
137111b918d9SHui.Liu 	PIN_FIELD_BASE(64, 64, 2, 0x0050, 0x10, 9, 3),
137211b918d9SHui.Liu 	PIN_FIELD_BASE(65, 65, 4, 0x0030, 0x10, 0, 3),
137311b918d9SHui.Liu 	PIN_FIELD_BASE(66, 66, 4, 0x0030, 0x10, 6, 3),
137411b918d9SHui.Liu 	PIN_FIELD_BASE(67, 67, 4, 0x0030, 0x10, 3, 3),
137511b918d9SHui.Liu 	PIN_FIELD_BASE(68, 68, 4, 0x0030, 0x10, 9, 3),
137611b918d9SHui.Liu 	PIN_FIELD_BASE(175, 175, 2, 0x0050, 0x10, 12, 3),
137711b918d9SHui.Liu 	PIN_FIELD_BASE(176, 176, 2, 0x0050, 0x10, 15, 3),
137811b918d9SHui.Liu };
137911b918d9SHui.Liu 
138011b918d9SHui.Liu static const struct mtk_pin_field_calc mt8188_pin_rsel_range[] = {
138111b918d9SHui.Liu 	PIN_FIELD_BASE(53, 53, 3, 0x00c0, 0x10, 0, 3),
138211b918d9SHui.Liu 	PIN_FIELD_BASE(54, 54, 3, 0x00c0, 0x10, 3, 3),
138311b918d9SHui.Liu 	PIN_FIELD_BASE(55, 55, 1, 0x0160, 0x10, 0, 3),
138411b918d9SHui.Liu 	PIN_FIELD_BASE(56, 56, 1, 0x0160, 0x10, 9, 3),
138511b918d9SHui.Liu 	PIN_FIELD_BASE(57, 57, 2, 0x0150, 0x10, 0, 3),
138611b918d9SHui.Liu 	PIN_FIELD_BASE(58, 58, 2, 0x0150, 0x10, 6, 3),
138711b918d9SHui.Liu 	PIN_FIELD_BASE(59, 59, 1, 0x0160, 0x10, 3, 3),
138811b918d9SHui.Liu 	PIN_FIELD_BASE(60, 60, 1, 0x0160, 0x10, 12, 3),
138911b918d9SHui.Liu 	PIN_FIELD_BASE(61, 61, 1, 0x0160, 0x10, 6, 3),
139011b918d9SHui.Liu 	PIN_FIELD_BASE(62, 62, 1, 0x0160, 0x10, 15, 3),
139111b918d9SHui.Liu 	PIN_FIELD_BASE(63, 63, 2, 0x0150, 0x10, 3, 3),
139211b918d9SHui.Liu 	PIN_FIELD_BASE(64, 64, 2, 0x0150, 0x10, 9, 3),
139311b918d9SHui.Liu 	PIN_FIELD_BASE(65, 65, 4, 0x00d0, 0x10, 0, 3),
139411b918d9SHui.Liu 	PIN_FIELD_BASE(66, 66, 4, 0x00d0, 0x10, 6, 3),
139511b918d9SHui.Liu 	PIN_FIELD_BASE(67, 67, 4, 0x00d0, 0x10, 3, 3),
139611b918d9SHui.Liu 	PIN_FIELD_BASE(68, 68, 4, 0x00d0, 0x10, 9, 3),
139711b918d9SHui.Liu 	PIN_FIELD_BASE(175, 175, 2, 0x0150, 0x10, 12, 3),
139811b918d9SHui.Liu 	PIN_FIELD_BASE(176, 176, 2, 0x0150, 0x10, 15, 3),
139911b918d9SHui.Liu };
140011b918d9SHui.Liu 
140111b918d9SHui.Liu static const struct mtk_pin_rsel mt8188_pin_rsel_val_range[] = {
140211b918d9SHui.Liu 	PIN_RSEL(53, 68, 0x0, 75000, 75000),
140311b918d9SHui.Liu 	PIN_RSEL(53, 68, 0x1, 10000, 5000),
140411b918d9SHui.Liu 	PIN_RSEL(53, 68, 0x2, 5000, 75000),
140511b918d9SHui.Liu 	PIN_RSEL(53, 68, 0x3, 4000, 5000),
140611b918d9SHui.Liu 	PIN_RSEL(53, 68, 0x4, 3000, 75000),
140711b918d9SHui.Liu 	PIN_RSEL(53, 68, 0x5, 2000, 5000),
140811b918d9SHui.Liu 	PIN_RSEL(53, 68, 0x6, 1500, 75000),
140911b918d9SHui.Liu 	PIN_RSEL(53, 68, 0x7, 1000, 5000),
141011b918d9SHui.Liu 	PIN_RSEL(175, 176, 0x0, 75000, 75000),
141111b918d9SHui.Liu 	PIN_RSEL(175, 176, 0x1, 10000, 5000),
141211b918d9SHui.Liu 	PIN_RSEL(175, 176, 0x2, 5000, 75000),
141311b918d9SHui.Liu 	PIN_RSEL(175, 176, 0x3, 4000, 5000),
141411b918d9SHui.Liu 	PIN_RSEL(175, 176, 0x4, 3000, 75000),
141511b918d9SHui.Liu 	PIN_RSEL(175, 176, 0x5, 2000, 5000),
141611b918d9SHui.Liu 	PIN_RSEL(175, 176, 0x6, 1500, 75000),
141711b918d9SHui.Liu 	PIN_RSEL(175, 176, 0x7, 1000, 5000),
141811b918d9SHui.Liu };
141911b918d9SHui.Liu 
142011b918d9SHui.Liu static const unsigned int mt8188_pull_type[] = {
142111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*0*/
142211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*1*/
142311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*2*/
142411b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*3*/
142511b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*4*/
142611b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*5*/
142711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*6*/
142811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*7*/
142911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*8*/
143011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*9*/
143111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*10*/
143211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*11*/
143311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*12*/
143411b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*13*/
143511b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*14*/
143611b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*15*/
143711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*16*/
143811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*17*/
143911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*18*/
144011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*19*/
144111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*20*/
144211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*21*/
144311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*22*/
144411b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*23*/
144511b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*24*/
144611b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*25*/
144711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*26*/
144811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*27*/
144911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*28*/
145011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*29*/
145111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*30*/
145211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*31*/
145311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*32*/
145411b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*33*/
145511b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*34*/
145611b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*35*/
145711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*36*/
145811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*37*/
145911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*38*/
146011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*39*/
146111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*40*/
146211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*41*/
146311b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*42*/
146411b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*43*/
146511b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*44*/
146611b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*45*/
146711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*46*/
146811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*47*/
146911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*48*/
147011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*49*/
147111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*50*/
147211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*51*/
147311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*52*/
147411b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*53*/
147511b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*54*/
147611b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*55*/
147711b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*56*/
147811b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*57*/
147911b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*58*/
148011b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*59*/
148111b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*60*/
148211b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*61*/
148311b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*62*/
148411b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*63*/
148511b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*64*/
148611b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*65*/
148711b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*66*/
148811b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*67*/
148911b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*68*/
149011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*69*/
149111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*70*/
149211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*71*/
149311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*72*/
149411b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*73*/
149511b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*74*/
149611b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*75*/
149711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*76*/
149811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*77*/
149911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*78*/
150011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*79*/
150111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*80*/
150211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*81*/
150311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*82*/
150411b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*83*/
150511b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*84*/
150611b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*85*/
150711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*86*/
150811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*87*/
150911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*88*/
151011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*89*/
151111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*90*/
151211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*91*/
151311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*92*/
151411b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*93*/
151511b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*94*/
151611b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*95*/
151711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*96*/
151811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*97*/
151911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*98*/
152011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*99*/
152111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*100*/
152211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*101*/
152311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*102*/
152411b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*103*/
152511b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*104*/
152611b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*105*/
152711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*106*/
152811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*107*/
152911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*108*/
153011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*109*/
153111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*110*/
153211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*111*/
153311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*112*/
153411b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*113*/
153511b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*114*/
153611b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*115*/
153711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*116*/
153811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*117*/
153911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*118*/
154011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*119*/
154111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*120*/
154211b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*121*/
154311b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*122*/
154411b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*123*/
154511b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*124*/
154611b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*125*/
154711b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*126*/
154811b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*127*/
154911b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*128*/
155011b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*129*/
155111b918d9SHui.Liu 	MTK_PULL_PU_PD_TYPE, /*130*/
155211b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*131*/
155311b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*132*/
155411b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*133*/
155511b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*134*/
155611b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*135*/
155711b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*136*/
155811b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*137*/
155911b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*138*/
156011b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*139*/
156111b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*140*/
156211b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*141*/
156311b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*142*/
156411b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*143*/
156511b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*144*/
156611b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*145*/
156711b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*146*/
156811b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*147*/
156911b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*148*/
157011b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*149*/
157111b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*150*/
157211b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*151*/
157311b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*152*/
157411b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*153*/
157511b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*154*/
157611b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*155*/
157711b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*156*/
157811b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*157*/
157911b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*158*/
158011b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*159*/
158111b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*160*/
158211b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*161*/
158311b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*162*/
158411b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*163*/
158511b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*164*/
158611b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*165*/
158711b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*166*/
158811b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*167*/
158911b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*168*/
159011b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*169*/
159111b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*170*/
159211b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*171*/
159311b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*172*/
159411b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*173*/
159511b918d9SHui.Liu 	MTK_PULL_PUPD_R1R0_TYPE, /*174*/
159611b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*175*/
159711b918d9SHui.Liu 	MTK_PULL_PU_PD_RSEL_TYPE, /*176*/
159811b918d9SHui.Liu };
159911b918d9SHui.Liu 
160011b918d9SHui.Liu static const struct mtk_pin_reg_calc mt8188_reg_cals[PINCTRL_PIN_REG_MAX] = {
160111b918d9SHui.Liu 	[PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt8188_pin_mode_range),
160211b918d9SHui.Liu 	[PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt8188_pin_dir_range),
160311b918d9SHui.Liu 	[PINCTRL_PIN_REG_DI] = MTK_RANGE(mt8188_pin_di_range),
160411b918d9SHui.Liu 	[PINCTRL_PIN_REG_DO] = MTK_RANGE(mt8188_pin_do_range),
160511b918d9SHui.Liu 	[PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt8188_pin_smt_range),
160611b918d9SHui.Liu 	[PINCTRL_PIN_REG_IES] = MTK_RANGE(mt8188_pin_ies_range),
160711b918d9SHui.Liu 	[PINCTRL_PIN_REG_TDSEL] = MTK_RANGE(mt8188_pin_tdsel_range),
160811b918d9SHui.Liu 	[PINCTRL_PIN_REG_RDSEL] = MTK_RANGE(mt8188_pin_rdsel_range),
160911b918d9SHui.Liu 	[PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt8188_pin_pupd_range),
161011b918d9SHui.Liu 	[PINCTRL_PIN_REG_R0] = MTK_RANGE(mt8188_pin_r0_range),
161111b918d9SHui.Liu 	[PINCTRL_PIN_REG_R1] = MTK_RANGE(mt8188_pin_r1_range),
161211b918d9SHui.Liu 	[PINCTRL_PIN_REG_PU] = MTK_RANGE(mt8188_pin_pu_range),
161311b918d9SHui.Liu 	[PINCTRL_PIN_REG_PD] = MTK_RANGE(mt8188_pin_pd_range),
161411b918d9SHui.Liu 	[PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt8188_pin_drv_range),
161511b918d9SHui.Liu 	[PINCTRL_PIN_REG_DRV_ADV] = MTK_RANGE(mt8188_pin_drv_adv_range),
161611b918d9SHui.Liu 	[PINCTRL_PIN_REG_RSEL] = MTK_RANGE(mt8188_pin_rsel_range),
161711b918d9SHui.Liu };
161811b918d9SHui.Liu 
161911b918d9SHui.Liu static const char * const mt8188_pinctrl_register_base_name[] = {
162011b918d9SHui.Liu 	"iocfg0", "iocfg_rm", "iocfg_lt", "iocfg_lm", "iocfg_rt",
162111b918d9SHui.Liu };
162211b918d9SHui.Liu 
162311b918d9SHui.Liu static const struct mtk_eint_hw mt8188_eint_hw = {
162411b918d9SHui.Liu 	.port_mask = 0xf,
162511b918d9SHui.Liu 	.ports     = 7,
162611b918d9SHui.Liu 	.ap_num    = 225,
162711b918d9SHui.Liu 	.db_cnt    = 32,
1628*e1ff91f9SAngeloGioacchino Del Regno 	.db_time   = debounce_time_mt6765,
162911b918d9SHui.Liu };
163011b918d9SHui.Liu 
163111b918d9SHui.Liu static const struct mtk_pin_soc mt8188_data = {
163211b918d9SHui.Liu 	.reg_cal = mt8188_reg_cals,
163311b918d9SHui.Liu 	.pins = mtk_pins_mt8188,
163411b918d9SHui.Liu 	.npins = ARRAY_SIZE(mtk_pins_mt8188),
163511b918d9SHui.Liu 	.ngrps = ARRAY_SIZE(mtk_pins_mt8188),
163611b918d9SHui.Liu 	.eint_hw = &mt8188_eint_hw,
163711b918d9SHui.Liu 	.nfuncs = 8,
163811b918d9SHui.Liu 	.gpio_m = 0,
163911b918d9SHui.Liu 	.base_names = mt8188_pinctrl_register_base_name,
164011b918d9SHui.Liu 	.nbase_names = ARRAY_SIZE(mt8188_pinctrl_register_base_name),
164111b918d9SHui.Liu 	.pull_type = mt8188_pull_type,
164211b918d9SHui.Liu 	.pin_rsel = mt8188_pin_rsel_val_range,
164311b918d9SHui.Liu 	.npin_rsel = ARRAY_SIZE(mt8188_pin_rsel_val_range),
164411b918d9SHui.Liu 	.bias_set_combo = mtk_pinconf_bias_set_combo,
164511b918d9SHui.Liu 	.bias_get_combo = mtk_pinconf_bias_get_combo,
164611b918d9SHui.Liu 	.drive_set = mtk_pinconf_drive_set_rev1,
164711b918d9SHui.Liu 	.drive_get = mtk_pinconf_drive_get_rev1,
164811b918d9SHui.Liu 	.adv_drive_set = mtk_pinconf_adv_drive_set_raw,
164911b918d9SHui.Liu 	.adv_drive_get = mtk_pinconf_adv_drive_get_raw,
165011b918d9SHui.Liu };
165111b918d9SHui.Liu 
165211b918d9SHui.Liu static const struct of_device_id mt8188_pinctrl_of_match[] = {
165311b918d9SHui.Liu 	{ .compatible = "mediatek,mt8188-pinctrl", .data = &mt8188_data },
165411b918d9SHui.Liu 	{ }
165511b918d9SHui.Liu };
165611b918d9SHui.Liu 
165711b918d9SHui.Liu static struct platform_driver mt8188_pinctrl_driver = {
165811b918d9SHui.Liu 	.driver = {
165911b918d9SHui.Liu 		.name = "mt8188-pinctrl",
166011b918d9SHui.Liu 		.of_match_table = mt8188_pinctrl_of_match,
166111b918d9SHui.Liu 		.pm = &mtk_paris_pinctrl_pm_ops
166211b918d9SHui.Liu 	},
166311b918d9SHui.Liu 	.probe = mtk_paris_pinctrl_probe,
166411b918d9SHui.Liu };
166511b918d9SHui.Liu 
mt8188_pinctrl_init(void)166611b918d9SHui.Liu static int __init mt8188_pinctrl_init(void)
166711b918d9SHui.Liu {
166811b918d9SHui.Liu 	return platform_driver_register(&mt8188_pinctrl_driver);
166911b918d9SHui.Liu }
167011b918d9SHui.Liu 
167111b918d9SHui.Liu arch_initcall(mt8188_pinctrl_init);
167211b918d9SHui.Liu 
167311b918d9SHui.Liu MODULE_DESCRIPTION("MediaTek MT8188 Pinctrl Driver");
1674