162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * The MT7981 driver based on Linux generic pinctrl binding.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2020 MediaTek Inc.
662306a36Sopenharmony_ci * Author: Sam Shih <sam.shih@mediatek.com>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#include "pinctrl-moore.h"
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#define MT7981_PIN(_number, _name)				\
1262306a36Sopenharmony_ci	MTK_PIN(_number, _name, 0, _number, DRV_GRP4)
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#define PIN_FIELD_BASE(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, _x_bits)	\
1562306a36Sopenharmony_ci	PIN_FIELD_CALC(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit,	\
1662306a36Sopenharmony_ci		       _x_bits, 32, 0)
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#define PINS_FIELD_BASE(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, _x_bits)	\
1962306a36Sopenharmony_ci	PIN_FIELD_CALC(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit,	\
2062306a36Sopenharmony_ci		      _x_bits, 32, 1)
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_mode_range[] = {
2362306a36Sopenharmony_ci	PIN_FIELD(0, 56, 0x300, 0x10, 0, 4),
2462306a36Sopenharmony_ci};
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_dir_range[] = {
2762306a36Sopenharmony_ci	PIN_FIELD(0, 56, 0x0, 0x10, 0, 1),
2862306a36Sopenharmony_ci};
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_di_range[] = {
3162306a36Sopenharmony_ci	PIN_FIELD(0, 56, 0x200, 0x10, 0, 1),
3262306a36Sopenharmony_ci};
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_do_range[] = {
3562306a36Sopenharmony_ci	PIN_FIELD(0, 56, 0x100, 0x10, 0, 1),
3662306a36Sopenharmony_ci};
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_ies_range[] = {
3962306a36Sopenharmony_ci	PIN_FIELD_BASE(0, 0, 1, 0x10, 0x10, 1, 1),
4062306a36Sopenharmony_ci	PIN_FIELD_BASE(1, 1, 1, 0x10, 0x10, 0, 1),
4162306a36Sopenharmony_ci	PIN_FIELD_BASE(2, 2, 5, 0x20, 0x10, 6, 1),
4262306a36Sopenharmony_ci	PIN_FIELD_BASE(3, 3, 4, 0x20, 0x10, 6, 1),
4362306a36Sopenharmony_ci	PIN_FIELD_BASE(4, 4, 4, 0x20, 0x10, 2, 1),
4462306a36Sopenharmony_ci	PIN_FIELD_BASE(5, 5, 4, 0x20, 0x10, 1, 1),
4562306a36Sopenharmony_ci	PIN_FIELD_BASE(6, 6, 4, 0x20, 0x10, 3, 1),
4662306a36Sopenharmony_ci	PIN_FIELD_BASE(7, 7, 4, 0x20, 0x10, 0, 1),
4762306a36Sopenharmony_ci	PIN_FIELD_BASE(8, 8, 4, 0x20, 0x10, 4, 1),
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci	PIN_FIELD_BASE(9, 9, 5, 0x20, 0x10, 9, 1),
5062306a36Sopenharmony_ci	PIN_FIELD_BASE(10, 10, 5, 0x20, 0x10, 8, 1),
5162306a36Sopenharmony_ci	PIN_FIELD_BASE(11, 11, 5, 0x40, 0x10, 10, 1),
5262306a36Sopenharmony_ci	PIN_FIELD_BASE(12, 12, 5, 0x20, 0x10, 7, 1),
5362306a36Sopenharmony_ci	PIN_FIELD_BASE(13, 13, 5, 0x20, 0x10, 11, 1),
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci	PIN_FIELD_BASE(14, 14, 4, 0x20, 0x10, 8, 1),
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci	PIN_FIELD_BASE(15, 15, 2, 0x20, 0x10, 0, 1),
5862306a36Sopenharmony_ci	PIN_FIELD_BASE(16, 16, 2, 0x20, 0x10, 1, 1),
5962306a36Sopenharmony_ci	PIN_FIELD_BASE(17, 17, 2, 0x20, 0x10, 5, 1),
6062306a36Sopenharmony_ci	PIN_FIELD_BASE(18, 18, 2, 0x20, 0x10, 4, 1),
6162306a36Sopenharmony_ci	PIN_FIELD_BASE(19, 19, 2, 0x20, 0x10, 2, 1),
6262306a36Sopenharmony_ci	PIN_FIELD_BASE(20, 20, 2, 0x20, 0x10, 3, 1),
6362306a36Sopenharmony_ci	PIN_FIELD_BASE(21, 21, 2, 0x20, 0x10, 6, 1),
6462306a36Sopenharmony_ci	PIN_FIELD_BASE(22, 22, 2, 0x20, 0x10, 7, 1),
6562306a36Sopenharmony_ci	PIN_FIELD_BASE(23, 23, 2, 0x20, 0x10, 10, 1),
6662306a36Sopenharmony_ci	PIN_FIELD_BASE(24, 24, 2, 0x20, 0x10, 9, 1),
6762306a36Sopenharmony_ci	PIN_FIELD_BASE(25, 25, 2, 0x20, 0x10, 8, 1),
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci	PIN_FIELD_BASE(26, 26, 5, 0x20, 0x10, 0, 1),
7062306a36Sopenharmony_ci	PIN_FIELD_BASE(27, 27, 5, 0x20, 0x10, 4, 1),
7162306a36Sopenharmony_ci	PIN_FIELD_BASE(28, 28, 5, 0x20, 0x10, 3, 1),
7262306a36Sopenharmony_ci	PIN_FIELD_BASE(29, 29, 5, 0x20, 0x10, 1, 1),
7362306a36Sopenharmony_ci	PIN_FIELD_BASE(30, 30, 5, 0x20, 0x10, 2, 1),
7462306a36Sopenharmony_ci	PIN_FIELD_BASE(31, 31, 5, 0x20, 0x10, 5, 1),
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ci	PIN_FIELD_BASE(32, 32, 1, 0x10, 0x10, 2, 1),
7762306a36Sopenharmony_ci	PIN_FIELD_BASE(33, 33, 1, 0x10, 0x10, 3, 1),
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci	PIN_FIELD_BASE(34, 34, 4, 0x20, 0x10, 5, 1),
8062306a36Sopenharmony_ci	PIN_FIELD_BASE(35, 35, 4, 0x20, 0x10, 7, 1),
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci	PIN_FIELD_BASE(36, 36, 3, 0x10, 0x10, 2, 1),
8362306a36Sopenharmony_ci	PIN_FIELD_BASE(37, 37, 3, 0x10, 0x10, 3, 1),
8462306a36Sopenharmony_ci	PIN_FIELD_BASE(38, 38, 3, 0x10, 0x10, 0, 1),
8562306a36Sopenharmony_ci	PIN_FIELD_BASE(39, 39, 3, 0x10, 0x10, 1, 1),
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci	PIN_FIELD_BASE(40, 40, 7, 0x30, 0x10, 1, 1),
8862306a36Sopenharmony_ci	PIN_FIELD_BASE(41, 41, 7, 0x30, 0x10, 0, 1),
8962306a36Sopenharmony_ci	PIN_FIELD_BASE(42, 42, 7, 0x30, 0x10, 9, 1),
9062306a36Sopenharmony_ci	PIN_FIELD_BASE(43, 43, 7, 0x30, 0x10, 7, 1),
9162306a36Sopenharmony_ci	PIN_FIELD_BASE(44, 44, 7, 0x30, 0x10, 8, 1),
9262306a36Sopenharmony_ci	PIN_FIELD_BASE(45, 45, 7, 0x30, 0x10, 3, 1),
9362306a36Sopenharmony_ci	PIN_FIELD_BASE(46, 46, 7, 0x30, 0x10, 4, 1),
9462306a36Sopenharmony_ci	PIN_FIELD_BASE(47, 47, 7, 0x30, 0x10, 5, 1),
9562306a36Sopenharmony_ci	PIN_FIELD_BASE(48, 48, 7, 0x30, 0x10, 6, 1),
9662306a36Sopenharmony_ci	PIN_FIELD_BASE(49, 49, 7, 0x30, 0x10, 2, 1),
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci	PIN_FIELD_BASE(50, 50, 6, 0x10, 0x10, 0, 1),
9962306a36Sopenharmony_ci	PIN_FIELD_BASE(51, 51, 6, 0x10, 0x10, 2, 1),
10062306a36Sopenharmony_ci	PIN_FIELD_BASE(52, 52, 6, 0x10, 0x10, 3, 1),
10162306a36Sopenharmony_ci	PIN_FIELD_BASE(53, 53, 6, 0x10, 0x10, 4, 1),
10262306a36Sopenharmony_ci	PIN_FIELD_BASE(54, 54, 6, 0x10, 0x10, 5, 1),
10362306a36Sopenharmony_ci	PIN_FIELD_BASE(55, 55, 6, 0x10, 0x10, 6, 1),
10462306a36Sopenharmony_ci	PIN_FIELD_BASE(56, 56, 6, 0x10, 0x10, 1, 1),
10562306a36Sopenharmony_ci};
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_smt_range[] = {
10862306a36Sopenharmony_ci	PIN_FIELD_BASE(0, 0, 1, 0x60, 0x10, 1, 1),
10962306a36Sopenharmony_ci	PIN_FIELD_BASE(1, 1, 1, 0x60, 0x10, 0, 1),
11062306a36Sopenharmony_ci	PIN_FIELD_BASE(2, 2, 5, 0x90, 0x10, 6, 1),
11162306a36Sopenharmony_ci	PIN_FIELD_BASE(3, 3, 4, 0x80, 0x10, 6, 1),
11262306a36Sopenharmony_ci	PIN_FIELD_BASE(4, 4, 4, 0x80, 0x10, 2, 1),
11362306a36Sopenharmony_ci	PIN_FIELD_BASE(5, 5, 4, 0x80, 0x10, 1, 1),
11462306a36Sopenharmony_ci	PIN_FIELD_BASE(6, 6, 4, 0x80, 0x10, 3, 1),
11562306a36Sopenharmony_ci	PIN_FIELD_BASE(7, 7, 4, 0x80, 0x10, 0, 1),
11662306a36Sopenharmony_ci	PIN_FIELD_BASE(8, 8, 4, 0x80, 0x10, 4, 1),
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci	PIN_FIELD_BASE(9, 9, 5, 0x90, 0x10, 9, 1),
11962306a36Sopenharmony_ci	PIN_FIELD_BASE(10, 10, 5, 0x90, 0x10, 8, 1),
12062306a36Sopenharmony_ci	PIN_FIELD_BASE(11, 11, 5, 0x90, 0x10, 10, 1),
12162306a36Sopenharmony_ci	PIN_FIELD_BASE(12, 12, 5, 0x90, 0x10, 7, 1),
12262306a36Sopenharmony_ci	PIN_FIELD_BASE(13, 13, 5, 0x90, 0x10, 11, 1),
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_ci	PIN_FIELD_BASE(14, 14, 4, 0x80, 0x10, 8, 1),
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci	PIN_FIELD_BASE(15, 15, 2, 0x90, 0x10, 0, 1),
12762306a36Sopenharmony_ci	PIN_FIELD_BASE(16, 16, 2, 0x90, 0x10, 1, 1),
12862306a36Sopenharmony_ci	PIN_FIELD_BASE(17, 17, 2, 0x90, 0x10, 5, 1),
12962306a36Sopenharmony_ci	PIN_FIELD_BASE(18, 18, 2, 0x90, 0x10, 4, 1),
13062306a36Sopenharmony_ci	PIN_FIELD_BASE(19, 19, 2, 0x90, 0x10, 2, 1),
13162306a36Sopenharmony_ci	PIN_FIELD_BASE(20, 20, 2, 0x90, 0x10, 3, 1),
13262306a36Sopenharmony_ci	PIN_FIELD_BASE(21, 21, 2, 0x90, 0x10, 6, 1),
13362306a36Sopenharmony_ci	PIN_FIELD_BASE(22, 22, 2, 0x90, 0x10, 7, 1),
13462306a36Sopenharmony_ci	PIN_FIELD_BASE(23, 23, 2, 0x90, 0x10, 10, 1),
13562306a36Sopenharmony_ci	PIN_FIELD_BASE(24, 24, 2, 0x90, 0x10, 9, 1),
13662306a36Sopenharmony_ci	PIN_FIELD_BASE(25, 25, 2, 0x90, 0x10, 8, 1),
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ci	PIN_FIELD_BASE(26, 26, 5, 0x90, 0x10, 0, 1),
13962306a36Sopenharmony_ci	PIN_FIELD_BASE(27, 27, 5, 0x90, 0x10, 4, 1),
14062306a36Sopenharmony_ci	PIN_FIELD_BASE(28, 28, 5, 0x90, 0x10, 3, 1),
14162306a36Sopenharmony_ci	PIN_FIELD_BASE(29, 29, 5, 0x90, 0x10, 1, 1),
14262306a36Sopenharmony_ci	PIN_FIELD_BASE(30, 30, 5, 0x90, 0x10, 2, 1),
14362306a36Sopenharmony_ci	PIN_FIELD_BASE(31, 31, 5, 0x90, 0x10, 5, 1),
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ci	PIN_FIELD_BASE(32, 32, 1, 0x60, 0x10, 2, 1),
14662306a36Sopenharmony_ci	PIN_FIELD_BASE(33, 33, 1, 0x60, 0x10, 3, 1),
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_ci	PIN_FIELD_BASE(34, 34, 4, 0x80, 0x10, 5, 1),
14962306a36Sopenharmony_ci	PIN_FIELD_BASE(35, 35, 4, 0x80, 0x10, 7, 1),
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci	PIN_FIELD_BASE(36, 36, 3, 0x60, 0x10, 2, 1),
15262306a36Sopenharmony_ci	PIN_FIELD_BASE(37, 37, 3, 0x60, 0x10, 3, 1),
15362306a36Sopenharmony_ci	PIN_FIELD_BASE(38, 38, 3, 0x60, 0x10, 0, 1),
15462306a36Sopenharmony_ci	PIN_FIELD_BASE(39, 39, 3, 0x60, 0x10, 1, 1),
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ci	PIN_FIELD_BASE(40, 40, 7, 0x70, 0x10, 1, 1),
15762306a36Sopenharmony_ci	PIN_FIELD_BASE(41, 41, 7, 0x70, 0x10, 0, 1),
15862306a36Sopenharmony_ci	PIN_FIELD_BASE(42, 42, 7, 0x70, 0x10, 9, 1),
15962306a36Sopenharmony_ci	PIN_FIELD_BASE(43, 43, 7, 0x70, 0x10, 7, 1),
16062306a36Sopenharmony_ci	PIN_FIELD_BASE(44, 44, 7, 0x30, 0x10, 8, 1),
16162306a36Sopenharmony_ci	PIN_FIELD_BASE(45, 45, 7, 0x70, 0x10, 3, 1),
16262306a36Sopenharmony_ci	PIN_FIELD_BASE(46, 46, 7, 0x70, 0x10, 4, 1),
16362306a36Sopenharmony_ci	PIN_FIELD_BASE(47, 47, 7, 0x70, 0x10, 5, 1),
16462306a36Sopenharmony_ci	PIN_FIELD_BASE(48, 48, 7, 0x70, 0x10, 6, 1),
16562306a36Sopenharmony_ci	PIN_FIELD_BASE(49, 49, 7, 0x70, 0x10, 2, 1),
16662306a36Sopenharmony_ci
16762306a36Sopenharmony_ci	PIN_FIELD_BASE(50, 50, 6, 0x50, 0x10, 0, 1),
16862306a36Sopenharmony_ci	PIN_FIELD_BASE(51, 51, 6, 0x50, 0x10, 2, 1),
16962306a36Sopenharmony_ci	PIN_FIELD_BASE(52, 52, 6, 0x50, 0x10, 3, 1),
17062306a36Sopenharmony_ci	PIN_FIELD_BASE(53, 53, 6, 0x50, 0x10, 4, 1),
17162306a36Sopenharmony_ci	PIN_FIELD_BASE(54, 54, 6, 0x50, 0x10, 5, 1),
17262306a36Sopenharmony_ci	PIN_FIELD_BASE(55, 55, 6, 0x50, 0x10, 6, 1),
17362306a36Sopenharmony_ci	PIN_FIELD_BASE(56, 56, 6, 0x50, 0x10, 1, 1),
17462306a36Sopenharmony_ci};
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_pu_range[] = {
17762306a36Sopenharmony_ci	PIN_FIELD_BASE(40, 40, 7, 0x50, 0x10, 1, 1),
17862306a36Sopenharmony_ci	PIN_FIELD_BASE(41, 41, 7, 0x50, 0x10, 0, 1),
17962306a36Sopenharmony_ci	PIN_FIELD_BASE(42, 42, 7, 0x50, 0x10, 9, 1),
18062306a36Sopenharmony_ci	PIN_FIELD_BASE(43, 43, 7, 0x50, 0x10, 7, 1),
18162306a36Sopenharmony_ci	PIN_FIELD_BASE(44, 44, 7, 0x50, 0x10, 8, 1),
18262306a36Sopenharmony_ci	PIN_FIELD_BASE(45, 45, 7, 0x50, 0x10, 3, 1),
18362306a36Sopenharmony_ci	PIN_FIELD_BASE(46, 46, 7, 0x50, 0x10, 4, 1),
18462306a36Sopenharmony_ci	PIN_FIELD_BASE(47, 47, 7, 0x50, 0x10, 5, 1),
18562306a36Sopenharmony_ci	PIN_FIELD_BASE(48, 48, 7, 0x50, 0x10, 6, 1),
18662306a36Sopenharmony_ci	PIN_FIELD_BASE(49, 49, 7, 0x50, 0x10, 2, 1),
18762306a36Sopenharmony_ci
18862306a36Sopenharmony_ci	PIN_FIELD_BASE(50, 50, 6, 0x30, 0x10, 0, 1),
18962306a36Sopenharmony_ci	PIN_FIELD_BASE(51, 51, 6, 0x30, 0x10, 2, 1),
19062306a36Sopenharmony_ci	PIN_FIELD_BASE(52, 52, 6, 0x30, 0x10, 3, 1),
19162306a36Sopenharmony_ci	PIN_FIELD_BASE(53, 53, 6, 0x30, 0x10, 4, 1),
19262306a36Sopenharmony_ci	PIN_FIELD_BASE(54, 54, 6, 0x30, 0x10, 5, 1),
19362306a36Sopenharmony_ci	PIN_FIELD_BASE(55, 55, 6, 0x30, 0x10, 6, 1),
19462306a36Sopenharmony_ci	PIN_FIELD_BASE(56, 56, 6, 0x30, 0x10, 1, 1),
19562306a36Sopenharmony_ci};
19662306a36Sopenharmony_ci
19762306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_pd_range[] = {
19862306a36Sopenharmony_ci	PIN_FIELD_BASE(40, 40, 7, 0x40, 0x10, 1, 1),
19962306a36Sopenharmony_ci	PIN_FIELD_BASE(41, 41, 7, 0x40, 0x10, 0, 1),
20062306a36Sopenharmony_ci	PIN_FIELD_BASE(42, 42, 7, 0x40, 0x10, 9, 1),
20162306a36Sopenharmony_ci	PIN_FIELD_BASE(43, 43, 7, 0x40, 0x10, 7, 1),
20262306a36Sopenharmony_ci	PIN_FIELD_BASE(44, 44, 7, 0x40, 0x10, 8, 1),
20362306a36Sopenharmony_ci	PIN_FIELD_BASE(45, 45, 7, 0x40, 0x10, 3, 1),
20462306a36Sopenharmony_ci	PIN_FIELD_BASE(46, 46, 7, 0x40, 0x10, 4, 1),
20562306a36Sopenharmony_ci	PIN_FIELD_BASE(47, 47, 7, 0x40, 0x10, 5, 1),
20662306a36Sopenharmony_ci	PIN_FIELD_BASE(48, 48, 7, 0x40, 0x10, 6, 1),
20762306a36Sopenharmony_ci	PIN_FIELD_BASE(49, 49, 7, 0x40, 0x10, 2, 1),
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci	PIN_FIELD_BASE(50, 50, 6, 0x20, 0x10, 0, 1),
21062306a36Sopenharmony_ci	PIN_FIELD_BASE(51, 51, 6, 0x20, 0x10, 2, 1),
21162306a36Sopenharmony_ci	PIN_FIELD_BASE(52, 52, 6, 0x20, 0x10, 3, 1),
21262306a36Sopenharmony_ci	PIN_FIELD_BASE(53, 53, 6, 0x20, 0x10, 4, 1),
21362306a36Sopenharmony_ci	PIN_FIELD_BASE(54, 54, 6, 0x20, 0x10, 5, 1),
21462306a36Sopenharmony_ci	PIN_FIELD_BASE(55, 55, 6, 0x20, 0x10, 6, 1),
21562306a36Sopenharmony_ci	PIN_FIELD_BASE(56, 56, 6, 0x20, 0x10, 1, 1),
21662306a36Sopenharmony_ci};
21762306a36Sopenharmony_ci
21862306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_drv_range[] = {
21962306a36Sopenharmony_ci	PIN_FIELD_BASE(0, 0, 1, 0x00, 0x10, 3, 3),
22062306a36Sopenharmony_ci	PIN_FIELD_BASE(1, 1, 1, 0x00, 0x10, 0, 3),
22162306a36Sopenharmony_ci
22262306a36Sopenharmony_ci	PIN_FIELD_BASE(2, 2, 5, 0x00, 0x10, 18, 3),
22362306a36Sopenharmony_ci
22462306a36Sopenharmony_ci	PIN_FIELD_BASE(3, 3, 4, 0x00, 0x10, 18, 1),
22562306a36Sopenharmony_ci	PIN_FIELD_BASE(4, 4, 4, 0x00, 0x10, 6, 1),
22662306a36Sopenharmony_ci	PIN_FIELD_BASE(5, 5, 4, 0x00, 0x10, 3, 3),
22762306a36Sopenharmony_ci	PIN_FIELD_BASE(6, 6, 4, 0x00, 0x10, 9, 3),
22862306a36Sopenharmony_ci	PIN_FIELD_BASE(7, 7, 4, 0x00, 0x10, 0, 3),
22962306a36Sopenharmony_ci	PIN_FIELD_BASE(8, 8, 4, 0x00, 0x10, 12, 3),
23062306a36Sopenharmony_ci
23162306a36Sopenharmony_ci	PIN_FIELD_BASE(9, 9, 5, 0x00, 0x10, 27, 3),
23262306a36Sopenharmony_ci	PIN_FIELD_BASE(10, 10, 5, 0x00, 0x10, 24, 3),
23362306a36Sopenharmony_ci	PIN_FIELD_BASE(11, 11, 5, 0x00, 0x10, 0, 3),
23462306a36Sopenharmony_ci	PIN_FIELD_BASE(12, 12, 5, 0x00, 0x10, 21, 3),
23562306a36Sopenharmony_ci	PIN_FIELD_BASE(13, 13, 5, 0x00, 0x10, 3, 3),
23662306a36Sopenharmony_ci
23762306a36Sopenharmony_ci	PIN_FIELD_BASE(14, 14, 4, 0x00, 0x10, 27, 3),
23862306a36Sopenharmony_ci
23962306a36Sopenharmony_ci	PIN_FIELD_BASE(15, 15, 2, 0x00, 0x10, 0, 3),
24062306a36Sopenharmony_ci	PIN_FIELD_BASE(16, 16, 2, 0x00, 0x10, 3, 3),
24162306a36Sopenharmony_ci	PIN_FIELD_BASE(17, 17, 2, 0x00, 0x10, 15, 3),
24262306a36Sopenharmony_ci	PIN_FIELD_BASE(18, 18, 2, 0x00, 0x10, 12, 3),
24362306a36Sopenharmony_ci	PIN_FIELD_BASE(19, 19, 2, 0x00, 0x10, 6, 3),
24462306a36Sopenharmony_ci	PIN_FIELD_BASE(20, 20, 2, 0x00, 0x10, 9, 3),
24562306a36Sopenharmony_ci	PIN_FIELD_BASE(21, 21, 2, 0x00, 0x10, 18, 3),
24662306a36Sopenharmony_ci	PIN_FIELD_BASE(22, 22, 2, 0x00, 0x10, 21, 3),
24762306a36Sopenharmony_ci	PIN_FIELD_BASE(23, 23, 2, 0x00, 0x10, 0, 3),
24862306a36Sopenharmony_ci	PIN_FIELD_BASE(24, 24, 2, 0x00, 0x10, 27, 3),
24962306a36Sopenharmony_ci	PIN_FIELD_BASE(25, 25, 2, 0x00, 0x10, 24, 3),
25062306a36Sopenharmony_ci
25162306a36Sopenharmony_ci	PIN_FIELD_BASE(26, 26, 5, 0x00, 0x10, 0, 3),
25262306a36Sopenharmony_ci	PIN_FIELD_BASE(27, 27, 5, 0x00, 0x10, 12, 3),
25362306a36Sopenharmony_ci	PIN_FIELD_BASE(28, 28, 5, 0x00, 0x10, 9, 3),
25462306a36Sopenharmony_ci	PIN_FIELD_BASE(29, 29, 5, 0x00, 0x10, 3, 3),
25562306a36Sopenharmony_ci	PIN_FIELD_BASE(30, 30, 5, 0x00, 0x10, 6, 3),
25662306a36Sopenharmony_ci	PIN_FIELD_BASE(31, 31, 5, 0x00, 0x10, 15, 3),
25762306a36Sopenharmony_ci
25862306a36Sopenharmony_ci	PIN_FIELD_BASE(32, 32, 1, 0x00, 0x10, 9, 3),
25962306a36Sopenharmony_ci	PIN_FIELD_BASE(33, 33, 1, 0x00, 0x10, 12, 3),
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_ci	PIN_FIELD_BASE(34, 34, 4, 0x00, 0x10, 15, 3),
26262306a36Sopenharmony_ci	PIN_FIELD_BASE(35, 35, 4, 0x00, 0x10, 21, 3),
26362306a36Sopenharmony_ci
26462306a36Sopenharmony_ci	PIN_FIELD_BASE(36, 36, 3, 0x00, 0x10, 6, 3),
26562306a36Sopenharmony_ci	PIN_FIELD_BASE(37, 37, 3, 0x00, 0x10, 9, 3),
26662306a36Sopenharmony_ci	PIN_FIELD_BASE(38, 38, 3, 0x00, 0x10, 0, 3),
26762306a36Sopenharmony_ci	PIN_FIELD_BASE(39, 39, 3, 0x00, 0x10, 3, 3),
26862306a36Sopenharmony_ci
26962306a36Sopenharmony_ci	PIN_FIELD_BASE(40, 40, 7, 0x00, 0x10, 3, 3),
27062306a36Sopenharmony_ci	PIN_FIELD_BASE(41, 41, 7, 0x00, 0x10, 0, 3),
27162306a36Sopenharmony_ci	PIN_FIELD_BASE(42, 42, 7, 0x00, 0x10, 27, 3),
27262306a36Sopenharmony_ci	PIN_FIELD_BASE(43, 43, 7, 0x00, 0x10, 21, 3),
27362306a36Sopenharmony_ci	PIN_FIELD_BASE(44, 44, 7, 0x00, 0x10, 24, 3),
27462306a36Sopenharmony_ci	PIN_FIELD_BASE(45, 45, 7, 0x00, 0x10, 9, 3),
27562306a36Sopenharmony_ci	PIN_FIELD_BASE(46, 46, 7, 0x00, 0x10, 12, 3),
27662306a36Sopenharmony_ci	PIN_FIELD_BASE(47, 47, 7, 0x00, 0x10, 15, 3),
27762306a36Sopenharmony_ci	PIN_FIELD_BASE(48, 48, 7, 0x00, 0x10, 18, 3),
27862306a36Sopenharmony_ci	PIN_FIELD_BASE(49, 49, 7, 0x00, 0x10, 6, 3),
27962306a36Sopenharmony_ci
28062306a36Sopenharmony_ci	PIN_FIELD_BASE(50, 50, 6, 0x00, 0x10, 0, 3),
28162306a36Sopenharmony_ci	PIN_FIELD_BASE(51, 51, 6, 0x00, 0x10, 6, 3),
28262306a36Sopenharmony_ci	PIN_FIELD_BASE(52, 52, 6, 0x00, 0x10, 9, 3),
28362306a36Sopenharmony_ci	PIN_FIELD_BASE(53, 53, 6, 0x00, 0x10, 12, 3),
28462306a36Sopenharmony_ci	PIN_FIELD_BASE(54, 54, 6, 0x00, 0x10, 15, 3),
28562306a36Sopenharmony_ci	PIN_FIELD_BASE(55, 55, 6, 0x00, 0x10, 18, 3),
28662306a36Sopenharmony_ci	PIN_FIELD_BASE(56, 56, 6, 0x00, 0x10, 3, 3),
28762306a36Sopenharmony_ci};
28862306a36Sopenharmony_ci
28962306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_pupd_range[] = {
29062306a36Sopenharmony_ci	PIN_FIELD_BASE(0, 0, 1, 0x20, 0x10, 1, 1),
29162306a36Sopenharmony_ci	PIN_FIELD_BASE(1, 1, 1, 0x20, 0x10, 0, 1),
29262306a36Sopenharmony_ci	PIN_FIELD_BASE(2, 2, 5, 0x30, 0x10, 6, 1),
29362306a36Sopenharmony_ci	PIN_FIELD_BASE(3, 3, 4, 0x30, 0x10, 6, 1),
29462306a36Sopenharmony_ci	PIN_FIELD_BASE(4, 4, 4, 0x30, 0x10, 2, 1),
29562306a36Sopenharmony_ci	PIN_FIELD_BASE(5, 5, 4, 0x30, 0x10, 1, 1),
29662306a36Sopenharmony_ci	PIN_FIELD_BASE(6, 6, 4, 0x30, 0x10, 3, 1),
29762306a36Sopenharmony_ci	PIN_FIELD_BASE(7, 7, 4, 0x30, 0x10, 0, 1),
29862306a36Sopenharmony_ci	PIN_FIELD_BASE(8, 8, 4, 0x30, 0x10, 4, 1),
29962306a36Sopenharmony_ci
30062306a36Sopenharmony_ci	PIN_FIELD_BASE(9, 9, 5, 0x30, 0x10, 9, 1),
30162306a36Sopenharmony_ci	PIN_FIELD_BASE(10, 10, 5, 0x30, 0x10, 8, 1),
30262306a36Sopenharmony_ci	PIN_FIELD_BASE(11, 11, 5, 0x30, 0x10, 10, 1),
30362306a36Sopenharmony_ci	PIN_FIELD_BASE(12, 12, 5, 0x30, 0x10, 7, 1),
30462306a36Sopenharmony_ci	PIN_FIELD_BASE(13, 13, 5, 0x30, 0x10, 11, 1),
30562306a36Sopenharmony_ci
30662306a36Sopenharmony_ci	PIN_FIELD_BASE(14, 14, 4, 0x30, 0x10, 8, 1),
30762306a36Sopenharmony_ci
30862306a36Sopenharmony_ci	PIN_FIELD_BASE(15, 15, 2, 0x30, 0x10, 0, 1),
30962306a36Sopenharmony_ci	PIN_FIELD_BASE(16, 16, 2, 0x30, 0x10, 1, 1),
31062306a36Sopenharmony_ci	PIN_FIELD_BASE(17, 17, 2, 0x30, 0x10, 5, 1),
31162306a36Sopenharmony_ci	PIN_FIELD_BASE(18, 18, 2, 0x30, 0x10, 4, 1),
31262306a36Sopenharmony_ci	PIN_FIELD_BASE(19, 19, 2, 0x30, 0x10, 2, 1),
31362306a36Sopenharmony_ci	PIN_FIELD_BASE(20, 20, 2, 0x90, 0x10, 3, 1),
31462306a36Sopenharmony_ci	PIN_FIELD_BASE(21, 21, 2, 0x30, 0x10, 6, 1),
31562306a36Sopenharmony_ci	PIN_FIELD_BASE(22, 22, 2, 0x30, 0x10, 7, 1),
31662306a36Sopenharmony_ci	PIN_FIELD_BASE(23, 23, 2, 0x30, 0x10, 10, 1),
31762306a36Sopenharmony_ci	PIN_FIELD_BASE(24, 24, 2, 0x30, 0x10, 9, 1),
31862306a36Sopenharmony_ci	PIN_FIELD_BASE(25, 25, 2, 0x30, 0x10, 8, 1),
31962306a36Sopenharmony_ci
32062306a36Sopenharmony_ci	PIN_FIELD_BASE(26, 26, 5, 0x30, 0x10, 0, 1),
32162306a36Sopenharmony_ci	PIN_FIELD_BASE(27, 27, 5, 0x30, 0x10, 4, 1),
32262306a36Sopenharmony_ci	PIN_FIELD_BASE(28, 28, 5, 0x30, 0x10, 3, 1),
32362306a36Sopenharmony_ci	PIN_FIELD_BASE(29, 29, 5, 0x30, 0x10, 1, 1),
32462306a36Sopenharmony_ci	PIN_FIELD_BASE(30, 30, 5, 0x30, 0x10, 2, 1),
32562306a36Sopenharmony_ci	PIN_FIELD_BASE(31, 31, 5, 0x30, 0x10, 5, 1),
32662306a36Sopenharmony_ci
32762306a36Sopenharmony_ci	PIN_FIELD_BASE(32, 32, 1, 0x20, 0x10, 2, 1),
32862306a36Sopenharmony_ci	PIN_FIELD_BASE(33, 33, 1, 0x20, 0x10, 3, 1),
32962306a36Sopenharmony_ci
33062306a36Sopenharmony_ci	PIN_FIELD_BASE(34, 34, 4, 0x30, 0x10, 5, 1),
33162306a36Sopenharmony_ci	PIN_FIELD_BASE(35, 35, 4, 0x30, 0x10, 7, 1),
33262306a36Sopenharmony_ci
33362306a36Sopenharmony_ci	PIN_FIELD_BASE(36, 36, 3, 0x20, 0x10, 2, 1),
33462306a36Sopenharmony_ci	PIN_FIELD_BASE(37, 37, 3, 0x20, 0x10, 3, 1),
33562306a36Sopenharmony_ci	PIN_FIELD_BASE(38, 38, 3, 0x20, 0x10, 0, 1),
33662306a36Sopenharmony_ci	PIN_FIELD_BASE(39, 39, 3, 0x20, 0x10, 1, 1),
33762306a36Sopenharmony_ci};
33862306a36Sopenharmony_ci
33962306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_r0_range[] = {
34062306a36Sopenharmony_ci	PIN_FIELD_BASE(0, 0, 1, 0x30, 0x10, 1, 1),
34162306a36Sopenharmony_ci	PIN_FIELD_BASE(1, 1, 1, 0x30, 0x10, 0, 1),
34262306a36Sopenharmony_ci	PIN_FIELD_BASE(2, 2, 5, 0x40, 0x10, 6, 1),
34362306a36Sopenharmony_ci	PIN_FIELD_BASE(3, 3, 4, 0x40, 0x10, 6, 1),
34462306a36Sopenharmony_ci	PIN_FIELD_BASE(4, 4, 4, 0x40, 0x10, 2, 1),
34562306a36Sopenharmony_ci	PIN_FIELD_BASE(5, 5, 4, 0x40, 0x10, 1, 1),
34662306a36Sopenharmony_ci	PIN_FIELD_BASE(6, 6, 4, 0x40, 0x10, 3, 1),
34762306a36Sopenharmony_ci	PIN_FIELD_BASE(7, 7, 4, 0x40, 0x10, 0, 1),
34862306a36Sopenharmony_ci	PIN_FIELD_BASE(8, 8, 4, 0x40, 0x10, 4, 1),
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_ci	PIN_FIELD_BASE(9, 9, 5, 0x40, 0x10, 9, 1),
35162306a36Sopenharmony_ci	PIN_FIELD_BASE(10, 10, 5, 0x40, 0x10, 8, 1),
35262306a36Sopenharmony_ci	PIN_FIELD_BASE(11, 11, 5, 0x40, 0x10, 10, 1),
35362306a36Sopenharmony_ci	PIN_FIELD_BASE(12, 12, 5, 0x40, 0x10, 7, 1),
35462306a36Sopenharmony_ci	PIN_FIELD_BASE(13, 13, 5, 0x40, 0x10, 11, 1),
35562306a36Sopenharmony_ci
35662306a36Sopenharmony_ci	PIN_FIELD_BASE(14, 14, 4, 0x40, 0x10, 8, 1),
35762306a36Sopenharmony_ci
35862306a36Sopenharmony_ci	PIN_FIELD_BASE(15, 15, 2, 0x40, 0x10, 0, 1),
35962306a36Sopenharmony_ci	PIN_FIELD_BASE(16, 16, 2, 0x40, 0x10, 1, 1),
36062306a36Sopenharmony_ci	PIN_FIELD_BASE(17, 17, 2, 0x40, 0x10, 5, 1),
36162306a36Sopenharmony_ci	PIN_FIELD_BASE(18, 18, 2, 0x40, 0x10, 4, 1),
36262306a36Sopenharmony_ci	PIN_FIELD_BASE(19, 19, 2, 0x40, 0x10, 2, 1),
36362306a36Sopenharmony_ci	PIN_FIELD_BASE(20, 20, 2, 0x40, 0x10, 3, 1),
36462306a36Sopenharmony_ci	PIN_FIELD_BASE(21, 21, 2, 0x40, 0x10, 6, 1),
36562306a36Sopenharmony_ci	PIN_FIELD_BASE(22, 22, 2, 0x40, 0x10, 7, 1),
36662306a36Sopenharmony_ci	PIN_FIELD_BASE(23, 23, 2, 0x40, 0x10, 10, 1),
36762306a36Sopenharmony_ci	PIN_FIELD_BASE(24, 24, 2, 0x40, 0x10, 9, 1),
36862306a36Sopenharmony_ci	PIN_FIELD_BASE(25, 25, 2, 0x40, 0x10, 8, 1),
36962306a36Sopenharmony_ci
37062306a36Sopenharmony_ci	PIN_FIELD_BASE(26, 26, 5, 0x40, 0x10, 0, 1),
37162306a36Sopenharmony_ci	PIN_FIELD_BASE(27, 27, 5, 0x40, 0x10, 4, 1),
37262306a36Sopenharmony_ci	PIN_FIELD_BASE(28, 28, 5, 0x40, 0x10, 3, 1),
37362306a36Sopenharmony_ci	PIN_FIELD_BASE(29, 29, 5, 0x40, 0x10, 1, 1),
37462306a36Sopenharmony_ci	PIN_FIELD_BASE(30, 30, 5, 0x40, 0x10, 2, 1),
37562306a36Sopenharmony_ci	PIN_FIELD_BASE(31, 31, 5, 0x40, 0x10, 5, 1),
37662306a36Sopenharmony_ci
37762306a36Sopenharmony_ci	PIN_FIELD_BASE(32, 32, 1, 0x30, 0x10, 2, 1),
37862306a36Sopenharmony_ci	PIN_FIELD_BASE(33, 33, 1, 0x30, 0x10, 3, 1),
37962306a36Sopenharmony_ci
38062306a36Sopenharmony_ci	PIN_FIELD_BASE(34, 34, 4, 0x40, 0x10, 5, 1),
38162306a36Sopenharmony_ci	PIN_FIELD_BASE(35, 35, 4, 0x40, 0x10, 7, 1),
38262306a36Sopenharmony_ci
38362306a36Sopenharmony_ci	PIN_FIELD_BASE(36, 36, 3, 0x30, 0x10, 2, 1),
38462306a36Sopenharmony_ci	PIN_FIELD_BASE(37, 37, 3, 0x30, 0x10, 3, 1),
38562306a36Sopenharmony_ci	PIN_FIELD_BASE(38, 38, 3, 0x30, 0x10, 0, 1),
38662306a36Sopenharmony_ci	PIN_FIELD_BASE(39, 39, 3, 0x30, 0x10, 1, 1),
38762306a36Sopenharmony_ci};
38862306a36Sopenharmony_ci
38962306a36Sopenharmony_cistatic const struct mtk_pin_field_calc mt7981_pin_r1_range[] = {
39062306a36Sopenharmony_ci	PIN_FIELD_BASE(0, 0, 1, 0x40, 0x10, 1, 1),
39162306a36Sopenharmony_ci	PIN_FIELD_BASE(1, 1, 1, 0x40, 0x10, 0, 1),
39262306a36Sopenharmony_ci	PIN_FIELD_BASE(2, 2, 5, 0x50, 0x10, 6, 1),
39362306a36Sopenharmony_ci	PIN_FIELD_BASE(3, 3, 4, 0x50, 0x10, 6, 1),
39462306a36Sopenharmony_ci	PIN_FIELD_BASE(4, 4, 4, 0x50, 0x10, 2, 1),
39562306a36Sopenharmony_ci	PIN_FIELD_BASE(5, 5, 4, 0x50, 0x10, 1, 1),
39662306a36Sopenharmony_ci	PIN_FIELD_BASE(6, 6, 4, 0x50, 0x10, 3, 1),
39762306a36Sopenharmony_ci	PIN_FIELD_BASE(7, 7, 4, 0x50, 0x10, 0, 1),
39862306a36Sopenharmony_ci	PIN_FIELD_BASE(8, 8, 4, 0x50, 0x10, 4, 1),
39962306a36Sopenharmony_ci
40062306a36Sopenharmony_ci	PIN_FIELD_BASE(9, 9, 5, 0x50, 0x10, 9, 1),
40162306a36Sopenharmony_ci	PIN_FIELD_BASE(10, 10, 5, 0x50, 0x10, 8, 1),
40262306a36Sopenharmony_ci	PIN_FIELD_BASE(11, 11, 5, 0x50, 0x10, 10, 1),
40362306a36Sopenharmony_ci	PIN_FIELD_BASE(12, 12, 5, 0x50, 0x10, 7, 1),
40462306a36Sopenharmony_ci	PIN_FIELD_BASE(13, 13, 5, 0x50, 0x10, 11, 1),
40562306a36Sopenharmony_ci
40662306a36Sopenharmony_ci	PIN_FIELD_BASE(14, 14, 4, 0x50, 0x10, 8, 1),
40762306a36Sopenharmony_ci
40862306a36Sopenharmony_ci	PIN_FIELD_BASE(15, 15, 2, 0x50, 0x10, 0, 1),
40962306a36Sopenharmony_ci	PIN_FIELD_BASE(16, 16, 2, 0x50, 0x10, 1, 1),
41062306a36Sopenharmony_ci	PIN_FIELD_BASE(17, 17, 2, 0x50, 0x10, 5, 1),
41162306a36Sopenharmony_ci	PIN_FIELD_BASE(18, 18, 2, 0x50, 0x10, 4, 1),
41262306a36Sopenharmony_ci	PIN_FIELD_BASE(19, 19, 2, 0x50, 0x10, 2, 1),
41362306a36Sopenharmony_ci	PIN_FIELD_BASE(20, 20, 2, 0x50, 0x10, 3, 1),
41462306a36Sopenharmony_ci	PIN_FIELD_BASE(21, 21, 2, 0x50, 0x10, 6, 1),
41562306a36Sopenharmony_ci	PIN_FIELD_BASE(22, 22, 2, 0x50, 0x10, 7, 1),
41662306a36Sopenharmony_ci	PIN_FIELD_BASE(23, 23, 2, 0x50, 0x10, 10, 1),
41762306a36Sopenharmony_ci	PIN_FIELD_BASE(24, 24, 2, 0x50, 0x10, 9, 1),
41862306a36Sopenharmony_ci	PIN_FIELD_BASE(25, 25, 2, 0x50, 0x10, 8, 1),
41962306a36Sopenharmony_ci
42062306a36Sopenharmony_ci	PIN_FIELD_BASE(26, 26, 5, 0x50, 0x10, 0, 1),
42162306a36Sopenharmony_ci	PIN_FIELD_BASE(27, 27, 5, 0x50, 0x10, 4, 1),
42262306a36Sopenharmony_ci	PIN_FIELD_BASE(28, 28, 5, 0x50, 0x10, 3, 1),
42362306a36Sopenharmony_ci	PIN_FIELD_BASE(29, 29, 5, 0x50, 0x10, 1, 1),
42462306a36Sopenharmony_ci	PIN_FIELD_BASE(30, 30, 5, 0x50, 0x10, 2, 1),
42562306a36Sopenharmony_ci	PIN_FIELD_BASE(31, 31, 5, 0x50, 0x10, 5, 1),
42662306a36Sopenharmony_ci
42762306a36Sopenharmony_ci	PIN_FIELD_BASE(32, 32, 1, 0x40, 0x10, 2, 1),
42862306a36Sopenharmony_ci	PIN_FIELD_BASE(33, 33, 1, 0x40, 0x10, 3, 1),
42962306a36Sopenharmony_ci
43062306a36Sopenharmony_ci	PIN_FIELD_BASE(34, 34, 4, 0x50, 0x10, 5, 1),
43162306a36Sopenharmony_ci	PIN_FIELD_BASE(35, 35, 4, 0x50, 0x10, 7, 1),
43262306a36Sopenharmony_ci
43362306a36Sopenharmony_ci	PIN_FIELD_BASE(36, 36, 3, 0x40, 0x10, 2, 1),
43462306a36Sopenharmony_ci	PIN_FIELD_BASE(37, 37, 3, 0x40, 0x10, 3, 1),
43562306a36Sopenharmony_ci	PIN_FIELD_BASE(38, 38, 3, 0x40, 0x10, 0, 1),
43662306a36Sopenharmony_ci	PIN_FIELD_BASE(39, 39, 3, 0x40, 0x10, 1, 1),
43762306a36Sopenharmony_ci};
43862306a36Sopenharmony_ci
43962306a36Sopenharmony_cistatic const unsigned int mt7981_pull_type[] = {
44062306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*0*/ MTK_PULL_PUPD_R1R0_TYPE,/*1*/
44162306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*2*/ MTK_PULL_PUPD_R1R0_TYPE,/*3*/
44262306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*4*/ MTK_PULL_PUPD_R1R0_TYPE,/*5*/
44362306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*6*/ MTK_PULL_PUPD_R1R0_TYPE,/*7*/
44462306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*8*/ MTK_PULL_PUPD_R1R0_TYPE,/*9*/
44562306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*10*/ MTK_PULL_PUPD_R1R0_TYPE,/*11*/
44662306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*12*/ MTK_PULL_PUPD_R1R0_TYPE,/*13*/
44762306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*14*/ MTK_PULL_PUPD_R1R0_TYPE,/*15*/
44862306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*16*/ MTK_PULL_PUPD_R1R0_TYPE,/*17*/
44962306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*18*/ MTK_PULL_PUPD_R1R0_TYPE,/*19*/
45062306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*20*/ MTK_PULL_PUPD_R1R0_TYPE,/*21*/
45162306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*22*/ MTK_PULL_PUPD_R1R0_TYPE,/*23*/
45262306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*24*/ MTK_PULL_PUPD_R1R0_TYPE,/*25*/
45362306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*26*/ MTK_PULL_PUPD_R1R0_TYPE,/*27*/
45462306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*28*/ MTK_PULL_PUPD_R1R0_TYPE,/*29*/
45562306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*30*/ MTK_PULL_PUPD_R1R0_TYPE,/*31*/
45662306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*32*/ MTK_PULL_PUPD_R1R0_TYPE,/*33*/
45762306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*34*/ MTK_PULL_PUPD_R1R0_TYPE,/*35*/
45862306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*36*/ MTK_PULL_PUPD_R1R0_TYPE,/*37*/
45962306a36Sopenharmony_ci	MTK_PULL_PUPD_R1R0_TYPE,/*38*/ MTK_PULL_PUPD_R1R0_TYPE,/*39*/
46062306a36Sopenharmony_ci	MTK_PULL_PU_PD_TYPE,/*40*/ MTK_PULL_PU_PD_TYPE,/*41*/
46162306a36Sopenharmony_ci	MTK_PULL_PU_PD_TYPE,/*42*/ MTK_PULL_PU_PD_TYPE,/*43*/
46262306a36Sopenharmony_ci	MTK_PULL_PU_PD_TYPE,/*44*/ MTK_PULL_PU_PD_TYPE,/*45*/
46362306a36Sopenharmony_ci	MTK_PULL_PU_PD_TYPE,/*46*/ MTK_PULL_PU_PD_TYPE,/*47*/
46462306a36Sopenharmony_ci	MTK_PULL_PU_PD_TYPE,/*48*/ MTK_PULL_PU_PD_TYPE,/*49*/
46562306a36Sopenharmony_ci	MTK_PULL_PU_PD_TYPE,/*50*/ MTK_PULL_PU_PD_TYPE,/*51*/
46662306a36Sopenharmony_ci	MTK_PULL_PU_PD_TYPE,/*52*/ MTK_PULL_PU_PD_TYPE,/*53*/
46762306a36Sopenharmony_ci	MTK_PULL_PU_PD_TYPE,/*54*/ MTK_PULL_PU_PD_TYPE,/*55*/
46862306a36Sopenharmony_ci	MTK_PULL_PU_PD_TYPE,/*56*/
46962306a36Sopenharmony_ci};
47062306a36Sopenharmony_ci
47162306a36Sopenharmony_cistatic const struct mtk_pin_reg_calc mt7981_reg_cals[] = {
47262306a36Sopenharmony_ci	[PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt7981_pin_mode_range),
47362306a36Sopenharmony_ci	[PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt7981_pin_dir_range),
47462306a36Sopenharmony_ci	[PINCTRL_PIN_REG_DI] = MTK_RANGE(mt7981_pin_di_range),
47562306a36Sopenharmony_ci	[PINCTRL_PIN_REG_DO] = MTK_RANGE(mt7981_pin_do_range),
47662306a36Sopenharmony_ci	[PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt7981_pin_smt_range),
47762306a36Sopenharmony_ci	[PINCTRL_PIN_REG_IES] = MTK_RANGE(mt7981_pin_ies_range),
47862306a36Sopenharmony_ci	[PINCTRL_PIN_REG_PU] = MTK_RANGE(mt7981_pin_pu_range),
47962306a36Sopenharmony_ci	[PINCTRL_PIN_REG_PD] = MTK_RANGE(mt7981_pin_pd_range),
48062306a36Sopenharmony_ci	[PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt7981_pin_drv_range),
48162306a36Sopenharmony_ci	[PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt7981_pin_pupd_range),
48262306a36Sopenharmony_ci	[PINCTRL_PIN_REG_R0] = MTK_RANGE(mt7981_pin_r0_range),
48362306a36Sopenharmony_ci	[PINCTRL_PIN_REG_R1] = MTK_RANGE(mt7981_pin_r1_range),
48462306a36Sopenharmony_ci};
48562306a36Sopenharmony_ci
48662306a36Sopenharmony_cistatic const struct mtk_pin_desc mt7981_pins[] = {
48762306a36Sopenharmony_ci	MT7981_PIN(0, "GPIO_WPS"),
48862306a36Sopenharmony_ci	MT7981_PIN(1, "GPIO_RESET"),
48962306a36Sopenharmony_ci	MT7981_PIN(2, "SYS_WATCHDOG"),
49062306a36Sopenharmony_ci	MT7981_PIN(3, "PCIE_PERESET_N"),
49162306a36Sopenharmony_ci	MT7981_PIN(4, "JTAG_JTDO"),
49262306a36Sopenharmony_ci	MT7981_PIN(5, "JTAG_JTDI"),
49362306a36Sopenharmony_ci	MT7981_PIN(6, "JTAG_JTMS"),
49462306a36Sopenharmony_ci	MT7981_PIN(7, "JTAG_JTCLK"),
49562306a36Sopenharmony_ci	MT7981_PIN(8, "JTAG_JTRST_N"),
49662306a36Sopenharmony_ci	MT7981_PIN(9, "WO_JTAG_JTDO"),
49762306a36Sopenharmony_ci	MT7981_PIN(10, "WO_JTAG_JTDI"),
49862306a36Sopenharmony_ci	MT7981_PIN(11, "WO_JTAG_JTMS"),
49962306a36Sopenharmony_ci	MT7981_PIN(12, "WO_JTAG_JTCLK"),
50062306a36Sopenharmony_ci	MT7981_PIN(13, "WO_JTAG_JTRST_N"),
50162306a36Sopenharmony_ci	MT7981_PIN(14, "USB_VBUS"),
50262306a36Sopenharmony_ci	MT7981_PIN(15, "PWM0"),
50362306a36Sopenharmony_ci	MT7981_PIN(16, "SPI0_CLK"),
50462306a36Sopenharmony_ci	MT7981_PIN(17, "SPI0_MOSI"),
50562306a36Sopenharmony_ci	MT7981_PIN(18, "SPI0_MISO"),
50662306a36Sopenharmony_ci	MT7981_PIN(19, "SPI0_CS"),
50762306a36Sopenharmony_ci	MT7981_PIN(20, "SPI0_HOLD"),
50862306a36Sopenharmony_ci	MT7981_PIN(21, "SPI0_WP"),
50962306a36Sopenharmony_ci	MT7981_PIN(22, "SPI1_CLK"),
51062306a36Sopenharmony_ci	MT7981_PIN(23, "SPI1_MOSI"),
51162306a36Sopenharmony_ci	MT7981_PIN(24, "SPI1_MISO"),
51262306a36Sopenharmony_ci	MT7981_PIN(25, "SPI1_CS"),
51362306a36Sopenharmony_ci	MT7981_PIN(26, "SPI2_CLK"),
51462306a36Sopenharmony_ci	MT7981_PIN(27, "SPI2_MOSI"),
51562306a36Sopenharmony_ci	MT7981_PIN(28, "SPI2_MISO"),
51662306a36Sopenharmony_ci	MT7981_PIN(29, "SPI2_CS"),
51762306a36Sopenharmony_ci	MT7981_PIN(30, "SPI2_HOLD"),
51862306a36Sopenharmony_ci	MT7981_PIN(31, "SPI2_WP"),
51962306a36Sopenharmony_ci	MT7981_PIN(32, "UART0_RXD"),
52062306a36Sopenharmony_ci	MT7981_PIN(33, "UART0_TXD"),
52162306a36Sopenharmony_ci	MT7981_PIN(34, "PCIE_CLK_REQ"),
52262306a36Sopenharmony_ci	MT7981_PIN(35, "PCIE_WAKE_N"),
52362306a36Sopenharmony_ci	MT7981_PIN(36, "SMI_MDC"),
52462306a36Sopenharmony_ci	MT7981_PIN(37, "SMI_MDIO"),
52562306a36Sopenharmony_ci	MT7981_PIN(38, "GBE_INT"),
52662306a36Sopenharmony_ci	MT7981_PIN(39, "GBE_RESET"),
52762306a36Sopenharmony_ci	MT7981_PIN(40, "WF_DIG_RESETB"),
52862306a36Sopenharmony_ci	MT7981_PIN(41, "WF_CBA_RESETB"),
52962306a36Sopenharmony_ci	MT7981_PIN(42, "WF_XO_REQ"),
53062306a36Sopenharmony_ci	MT7981_PIN(43, "WF_TOP_CLK"),
53162306a36Sopenharmony_ci	MT7981_PIN(44, "WF_TOP_DATA"),
53262306a36Sopenharmony_ci	MT7981_PIN(45, "WF_HB1"),
53362306a36Sopenharmony_ci	MT7981_PIN(46, "WF_HB2"),
53462306a36Sopenharmony_ci	MT7981_PIN(47, "WF_HB3"),
53562306a36Sopenharmony_ci	MT7981_PIN(48, "WF_HB4"),
53662306a36Sopenharmony_ci	MT7981_PIN(49, "WF_HB0"),
53762306a36Sopenharmony_ci	MT7981_PIN(50, "WF_HB0_B"),
53862306a36Sopenharmony_ci	MT7981_PIN(51, "WF_HB5"),
53962306a36Sopenharmony_ci	MT7981_PIN(52, "WF_HB6"),
54062306a36Sopenharmony_ci	MT7981_PIN(53, "WF_HB7"),
54162306a36Sopenharmony_ci	MT7981_PIN(54, "WF_HB8"),
54262306a36Sopenharmony_ci	MT7981_PIN(55, "WF_HB9"),
54362306a36Sopenharmony_ci	MT7981_PIN(56, "WF_HB10"),
54462306a36Sopenharmony_ci};
54562306a36Sopenharmony_ci
54662306a36Sopenharmony_ci/* List all groups consisting of these pins dedicated to the enablement of
54762306a36Sopenharmony_ci * certain hardware block and the corresponding mode for all of the pins.
54862306a36Sopenharmony_ci * The hardware probably has multiple combinations of these pinouts.
54962306a36Sopenharmony_ci */
55062306a36Sopenharmony_ci
55162306a36Sopenharmony_ci/* WA_AICE */
55262306a36Sopenharmony_cistatic int mt7981_wa_aice1_pins[] = { 0, 1, };
55362306a36Sopenharmony_cistatic int mt7981_wa_aice1_funcs[] = { 2, 2, };
55462306a36Sopenharmony_ci
55562306a36Sopenharmony_cistatic int mt7981_wa_aice2_pins[] = { 0, 1, };
55662306a36Sopenharmony_cistatic int mt7981_wa_aice2_funcs[] = { 3, 3, };
55762306a36Sopenharmony_ci
55862306a36Sopenharmony_cistatic int mt7981_wa_aice3_pins[] = { 28, 29, };
55962306a36Sopenharmony_cistatic int mt7981_wa_aice3_funcs[] = { 3, 3, };
56062306a36Sopenharmony_ci
56162306a36Sopenharmony_cistatic int mt7981_wm_aice1_pins[] = { 9, 10, };
56262306a36Sopenharmony_cistatic int mt7981_wm_aice1_funcs[] = { 2, 2, };
56362306a36Sopenharmony_ci
56462306a36Sopenharmony_cistatic int mt7981_wm_aice2_pins[] = { 30, 31, };
56562306a36Sopenharmony_cistatic int mt7981_wm_aice2_funcs[] = { 5, 5, };
56662306a36Sopenharmony_ci
56762306a36Sopenharmony_ci/* WM_UART */
56862306a36Sopenharmony_cistatic int mt7981_wm_uart_0_pins[] = { 0, 1, };
56962306a36Sopenharmony_cistatic int mt7981_wm_uart_0_funcs[] = { 5, 5, };
57062306a36Sopenharmony_ci
57162306a36Sopenharmony_cistatic int mt7981_wm_uart_1_pins[] = { 20, 21, };
57262306a36Sopenharmony_cistatic int mt7981_wm_uart_1_funcs[] = { 4, 4, };
57362306a36Sopenharmony_ci
57462306a36Sopenharmony_cistatic int mt7981_wm_uart_2_pins[] = { 30, 31, };
57562306a36Sopenharmony_cistatic int mt7981_wm_uart_2_funcs[] = { 3, 3, };
57662306a36Sopenharmony_ci
57762306a36Sopenharmony_ci/* DFD */
57862306a36Sopenharmony_cistatic int mt7981_dfd_pins[] = { 0, 1, 4, 5, };
57962306a36Sopenharmony_cistatic int mt7981_dfd_funcs[] = { 5, 5, 6, 6, };
58062306a36Sopenharmony_ci
58162306a36Sopenharmony_ci/* SYS_WATCHDOG */
58262306a36Sopenharmony_cistatic int mt7981_watchdog_pins[] = { 2, };
58362306a36Sopenharmony_cistatic int mt7981_watchdog_funcs[] = { 1, };
58462306a36Sopenharmony_ci
58562306a36Sopenharmony_cistatic int mt7981_watchdog1_pins[] = { 13, };
58662306a36Sopenharmony_cistatic int mt7981_watchdog1_funcs[] = { 5, };
58762306a36Sopenharmony_ci
58862306a36Sopenharmony_ci/* PCIE_PERESET_N */
58962306a36Sopenharmony_cistatic int mt7981_pcie_pereset_pins[] = { 3, };
59062306a36Sopenharmony_cistatic int mt7981_pcie_pereset_funcs[] = { 1, };
59162306a36Sopenharmony_ci
59262306a36Sopenharmony_ci/* JTAG */
59362306a36Sopenharmony_cistatic int mt7981_jtag_pins[] = { 4, 5, 6, 7, 8, };
59462306a36Sopenharmony_cistatic int mt7981_jtag_funcs[] = { 1, 1, 1, 1, 1, };
59562306a36Sopenharmony_ci
59662306a36Sopenharmony_ci/* WM_JTAG */
59762306a36Sopenharmony_cistatic int mt7981_wm_jtag_0_pins[] = { 4, 5, 6, 7, 8, };
59862306a36Sopenharmony_cistatic int mt7981_wm_jtag_0_funcs[] = { 2, 2, 2, 2, 2, };
59962306a36Sopenharmony_ci
60062306a36Sopenharmony_cistatic int mt7981_wm_jtag_1_pins[] = { 20, 21, 22, 23, 24, };
60162306a36Sopenharmony_cistatic int mt7981_wm_jtag_1_funcs[] = { 5, 5, 5, 5, 5, };
60262306a36Sopenharmony_ci
60362306a36Sopenharmony_ci/* WO0_JTAG */
60462306a36Sopenharmony_cistatic int mt7981_wo0_jtag_0_pins[] = { 9, 10, 11, 12, 13, };
60562306a36Sopenharmony_cistatic int mt7981_wo0_jtag_0_funcs[] = { 1, 1, 1, 1, 1, };
60662306a36Sopenharmony_ci
60762306a36Sopenharmony_cistatic int mt7981_wo0_jtag_1_pins[] = { 25, 26, 27, 28, 29, };
60862306a36Sopenharmony_cistatic int mt7981_wo0_jtag_1_funcs[] = { 5, 5, 5, 5, 5, };
60962306a36Sopenharmony_ci
61062306a36Sopenharmony_ci/* UART2 */
61162306a36Sopenharmony_cistatic int mt7981_uart2_0_pins[] = { 4, 5, 6, 7, };
61262306a36Sopenharmony_cistatic int mt7981_uart2_0_funcs[] = { 3, 3, 3, 3, };
61362306a36Sopenharmony_ci
61462306a36Sopenharmony_ci/* GBE_LED0 */
61562306a36Sopenharmony_cistatic int mt7981_gbe_led0_pins[] = { 8, };
61662306a36Sopenharmony_cistatic int mt7981_gbe_led0_funcs[] = { 3, };
61762306a36Sopenharmony_ci
61862306a36Sopenharmony_ci/* PTA_EXT */
61962306a36Sopenharmony_cistatic int mt7981_pta_ext_0_pins[] = { 4, 5, 6, };
62062306a36Sopenharmony_cistatic int mt7981_pta_ext_0_funcs[] = { 4, 4, 4, };
62162306a36Sopenharmony_ci
62262306a36Sopenharmony_cistatic int mt7981_pta_ext_1_pins[] = { 22, 23, 24, };
62362306a36Sopenharmony_cistatic int mt7981_pta_ext_1_funcs[] = { 4, 4, 4, };
62462306a36Sopenharmony_ci
62562306a36Sopenharmony_ci/* PWM2 */
62662306a36Sopenharmony_cistatic int mt7981_pwm2_pins[] = { 7, };
62762306a36Sopenharmony_cistatic int mt7981_pwm2_funcs[] = { 4, };
62862306a36Sopenharmony_ci
62962306a36Sopenharmony_ci/* NET_WO0_UART_TXD */
63062306a36Sopenharmony_cistatic int mt7981_net_wo0_uart_txd_0_pins[] = { 8, };
63162306a36Sopenharmony_cistatic int mt7981_net_wo0_uart_txd_0_funcs[] = { 4, };
63262306a36Sopenharmony_ci
63362306a36Sopenharmony_cistatic int mt7981_net_wo0_uart_txd_1_pins[] = { 14, };
63462306a36Sopenharmony_cistatic int mt7981_net_wo0_uart_txd_1_funcs[] = { 3, };
63562306a36Sopenharmony_ci
63662306a36Sopenharmony_cistatic int mt7981_net_wo0_uart_txd_2_pins[] = { 15, };
63762306a36Sopenharmony_cistatic int mt7981_net_wo0_uart_txd_2_funcs[] = { 4, };
63862306a36Sopenharmony_ci
63962306a36Sopenharmony_ci/* SPI1 */
64062306a36Sopenharmony_cistatic int mt7981_spi1_0_pins[] = { 4, 5, 6, 7, };
64162306a36Sopenharmony_cistatic int mt7981_spi1_0_funcs[] = { 5, 5, 5, 5, };
64262306a36Sopenharmony_ci
64362306a36Sopenharmony_ci/* I2C */
64462306a36Sopenharmony_cistatic int mt7981_i2c0_0_pins[] = { 6, 7, };
64562306a36Sopenharmony_cistatic int mt7981_i2c0_0_funcs[] = { 6, 6, };
64662306a36Sopenharmony_ci
64762306a36Sopenharmony_cistatic int mt7981_i2c0_1_pins[] = { 30, 31, };
64862306a36Sopenharmony_cistatic int mt7981_i2c0_1_funcs[] = { 4, 4, };
64962306a36Sopenharmony_ci
65062306a36Sopenharmony_cistatic int mt7981_i2c0_2_pins[] = { 36, 37, };
65162306a36Sopenharmony_cistatic int mt7981_i2c0_2_funcs[] = { 2, 2, };
65262306a36Sopenharmony_ci
65362306a36Sopenharmony_cistatic int mt7981_u2_phy_i2c_pins[] = { 30, 31, };
65462306a36Sopenharmony_cistatic int mt7981_u2_phy_i2c_funcs[] = { 6, 6, };
65562306a36Sopenharmony_ci
65662306a36Sopenharmony_cistatic int mt7981_u3_phy_i2c_pins[] = { 32, 33, };
65762306a36Sopenharmony_cistatic int mt7981_u3_phy_i2c_funcs[] = { 3, 3, };
65862306a36Sopenharmony_ci
65962306a36Sopenharmony_cistatic int mt7981_sgmii1_phy_i2c_pins[] = { 32, 33, };
66062306a36Sopenharmony_cistatic int mt7981_sgmii1_phy_i2c_funcs[] = { 2, 2, };
66162306a36Sopenharmony_ci
66262306a36Sopenharmony_cistatic int mt7981_sgmii0_phy_i2c_pins[] = { 32, 33, };
66362306a36Sopenharmony_cistatic int mt7981_sgmii0_phy_i2c_funcs[] = { 5, 5, };
66462306a36Sopenharmony_ci
66562306a36Sopenharmony_ci/* DFD_NTRST */
66662306a36Sopenharmony_cistatic int mt7981_dfd_ntrst_pins[] = { 8, };
66762306a36Sopenharmony_cistatic int mt7981_dfd_ntrst_funcs[] = { 6, };
66862306a36Sopenharmony_ci
66962306a36Sopenharmony_ci/* PWM0 */
67062306a36Sopenharmony_cistatic int mt7981_pwm0_0_pins[] = { 13, };
67162306a36Sopenharmony_cistatic int mt7981_pwm0_0_funcs[] = { 2, };
67262306a36Sopenharmony_ci
67362306a36Sopenharmony_cistatic int mt7981_pwm0_1_pins[] = { 15, };
67462306a36Sopenharmony_cistatic int mt7981_pwm0_1_funcs[] = { 1, };
67562306a36Sopenharmony_ci
67662306a36Sopenharmony_ci/* PWM1 */
67762306a36Sopenharmony_cistatic int mt7981_pwm1_0_pins[] = { 14, };
67862306a36Sopenharmony_cistatic int mt7981_pwm1_0_funcs[] = { 2, };
67962306a36Sopenharmony_ci
68062306a36Sopenharmony_cistatic int mt7981_pwm1_1_pins[] = { 15, };
68162306a36Sopenharmony_cistatic int mt7981_pwm1_1_funcs[] = { 3, };
68262306a36Sopenharmony_ci
68362306a36Sopenharmony_ci/* GBE_LED1 */
68462306a36Sopenharmony_cistatic int mt7981_gbe_led1_pins[] = { 13, };
68562306a36Sopenharmony_cistatic int mt7981_gbe_led1_funcs[] = { 3, };
68662306a36Sopenharmony_ci
68762306a36Sopenharmony_ci/* PCM */
68862306a36Sopenharmony_cistatic int mt7981_pcm_pins[] = { 9, 10, 11, 12, 13, 25 };
68962306a36Sopenharmony_cistatic int mt7981_pcm_funcs[] = { 4, 4, 4, 4, 4, 4, };
69062306a36Sopenharmony_ci
69162306a36Sopenharmony_ci/* UDI */
69262306a36Sopenharmony_cistatic int mt7981_udi_pins[] = { 9, 10, 11, 12, 13, };
69362306a36Sopenharmony_cistatic int mt7981_udi_funcs[] = { 6, 6, 6, 6, 6, };
69462306a36Sopenharmony_ci
69562306a36Sopenharmony_ci/* DRV_VBUS */
69662306a36Sopenharmony_cistatic int mt7981_drv_vbus_pins[] = { 14, };
69762306a36Sopenharmony_cistatic int mt7981_drv_vbus_funcs[] = { 1, };
69862306a36Sopenharmony_ci
69962306a36Sopenharmony_ci/* EMMC */
70062306a36Sopenharmony_cistatic int mt7981_emmc_45_pins[] = { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, };
70162306a36Sopenharmony_cistatic int mt7981_emmc_45_funcs[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, };
70262306a36Sopenharmony_ci
70362306a36Sopenharmony_ci/* SNFI */
70462306a36Sopenharmony_cistatic int mt7981_snfi_pins[] = { 16, 17, 18, 19, 20, 21, };
70562306a36Sopenharmony_cistatic int mt7981_snfi_funcs[] = { 3, 3, 3, 3, 3, 3, };
70662306a36Sopenharmony_ci
70762306a36Sopenharmony_ci/* SPI0 */
70862306a36Sopenharmony_cistatic int mt7981_spi0_pins[] = { 16, 17, 18, 19, };
70962306a36Sopenharmony_cistatic int mt7981_spi0_funcs[] = { 1, 1, 1, 1, };
71062306a36Sopenharmony_ci
71162306a36Sopenharmony_ci/* SPI0 */
71262306a36Sopenharmony_cistatic int mt7981_spi0_wp_hold_pins[] = { 20, 21, };
71362306a36Sopenharmony_cistatic int mt7981_spi0_wp_hold_funcs[] = { 1, 1, };
71462306a36Sopenharmony_ci
71562306a36Sopenharmony_ci/* SPI1 */
71662306a36Sopenharmony_cistatic int mt7981_spi1_1_pins[] = { 22, 23, 24, 25, };
71762306a36Sopenharmony_cistatic int mt7981_spi1_1_funcs[] = { 1, 1, 1, 1, };
71862306a36Sopenharmony_ci
71962306a36Sopenharmony_ci/* SPI2 */
72062306a36Sopenharmony_cistatic int mt7981_spi2_pins[] = { 26, 27, 28, 29, };
72162306a36Sopenharmony_cistatic int mt7981_spi2_funcs[] = { 1, 1, 1, 1, };
72262306a36Sopenharmony_ci
72362306a36Sopenharmony_ci/* SPI2 */
72462306a36Sopenharmony_cistatic int mt7981_spi2_wp_hold_pins[] = { 30, 31, };
72562306a36Sopenharmony_cistatic int mt7981_spi2_wp_hold_funcs[] = { 1, 1, };
72662306a36Sopenharmony_ci
72762306a36Sopenharmony_ci/* UART1 */
72862306a36Sopenharmony_cistatic int mt7981_uart1_0_pins[] = { 16, 17, 18, 19, };
72962306a36Sopenharmony_cistatic int mt7981_uart1_0_funcs[] = { 4, 4, 4, 4, };
73062306a36Sopenharmony_ci
73162306a36Sopenharmony_cistatic int mt7981_uart1_1_pins[] = { 26, 27, 28, 29, };
73262306a36Sopenharmony_cistatic int mt7981_uart1_1_funcs[] = { 2, 2, 2, 2, };
73362306a36Sopenharmony_ci
73462306a36Sopenharmony_ci/* UART2 */
73562306a36Sopenharmony_cistatic int mt7981_uart2_1_pins[] = { 22, 23, 24, 25, };
73662306a36Sopenharmony_cistatic int mt7981_uart2_1_funcs[] = { 3, 3, 3, 3, };
73762306a36Sopenharmony_ci
73862306a36Sopenharmony_ci/* UART0 */
73962306a36Sopenharmony_cistatic int mt7981_uart0_pins[] = { 32, 33, };
74062306a36Sopenharmony_cistatic int mt7981_uart0_funcs[] = { 1, 1, };
74162306a36Sopenharmony_ci
74262306a36Sopenharmony_ci/* PCIE_CLK_REQ */
74362306a36Sopenharmony_cistatic int mt7981_pcie_clk_pins[] = { 34, };
74462306a36Sopenharmony_cistatic int mt7981_pcie_clk_funcs[] = { 2, };
74562306a36Sopenharmony_ci
74662306a36Sopenharmony_ci/* PCIE_WAKE_N */
74762306a36Sopenharmony_cistatic int mt7981_pcie_wake_pins[] = { 35, };
74862306a36Sopenharmony_cistatic int mt7981_pcie_wake_funcs[] = { 2, };
74962306a36Sopenharmony_ci
75062306a36Sopenharmony_ci/* MDC_MDIO */
75162306a36Sopenharmony_cistatic int mt7981_smi_mdc_mdio_pins[] = { 36, 37, };
75262306a36Sopenharmony_cistatic int mt7981_smi_mdc_mdio_funcs[] = { 1, 1, };
75362306a36Sopenharmony_ci
75462306a36Sopenharmony_cistatic int mt7981_gbe_ext_mdc_mdio_pins[] = { 36, 37, };
75562306a36Sopenharmony_cistatic int mt7981_gbe_ext_mdc_mdio_funcs[] = { 3, 3, };
75662306a36Sopenharmony_ci
75762306a36Sopenharmony_ci/* WF0_MODE1 */
75862306a36Sopenharmony_cistatic int mt7981_wf0_mode1_pins[] = { 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56 };
75962306a36Sopenharmony_cistatic int mt7981_wf0_mode1_funcs[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
76062306a36Sopenharmony_ci
76162306a36Sopenharmony_ci/* WF0_MODE3 */
76262306a36Sopenharmony_cistatic int mt7981_wf0_mode3_pins[] = { 45, 46, 47, 48, 49, 51 };
76362306a36Sopenharmony_cistatic int mt7981_wf0_mode3_funcs[] = { 2, 2, 2, 2, 2, 2 };
76462306a36Sopenharmony_ci
76562306a36Sopenharmony_ci/* WF2G_LED */
76662306a36Sopenharmony_cistatic int mt7981_wf2g_led0_pins[] = { 30, };
76762306a36Sopenharmony_cistatic int mt7981_wf2g_led0_funcs[] = { 2, };
76862306a36Sopenharmony_ci
76962306a36Sopenharmony_cistatic int mt7981_wf2g_led1_pins[] = { 34, };
77062306a36Sopenharmony_cistatic int mt7981_wf2g_led1_funcs[] = { 1, };
77162306a36Sopenharmony_ci
77262306a36Sopenharmony_ci/* WF5G_LED */
77362306a36Sopenharmony_cistatic int mt7981_wf5g_led0_pins[] = { 31, };
77462306a36Sopenharmony_cistatic int mt7981_wf5g_led0_funcs[] = { 2, };
77562306a36Sopenharmony_ci
77662306a36Sopenharmony_cistatic int mt7981_wf5g_led1_pins[] = { 35, };
77762306a36Sopenharmony_cistatic int mt7981_wf5g_led1_funcs[] = { 1, };
77862306a36Sopenharmony_ci
77962306a36Sopenharmony_ci/* MT7531_INT */
78062306a36Sopenharmony_cistatic int mt7981_mt7531_int_pins[] = { 38, };
78162306a36Sopenharmony_cistatic int mt7981_mt7531_int_funcs[] = { 1, };
78262306a36Sopenharmony_ci
78362306a36Sopenharmony_ci/* ANT_SEL */
78462306a36Sopenharmony_cistatic int mt7981_ant_sel_pins[] = { 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 34, 35 };
78562306a36Sopenharmony_cistatic int mt7981_ant_sel_funcs[] = { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 };
78662306a36Sopenharmony_ci
78762306a36Sopenharmony_cistatic const struct group_desc mt7981_groups[] = {
78862306a36Sopenharmony_ci	/* @GPIO(0,1): WA_AICE(2) */
78962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wa_aice1", mt7981_wa_aice1),
79062306a36Sopenharmony_ci	/* @GPIO(0,1): WA_AICE(3) */
79162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wa_aice2", mt7981_wa_aice2),
79262306a36Sopenharmony_ci	/* @GPIO(0,1): WM_UART(5) */
79362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wm_uart_0", mt7981_wm_uart_0),
79462306a36Sopenharmony_ci	/* @GPIO(0,1,4,5): DFD(6) */
79562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("dfd", mt7981_dfd),
79662306a36Sopenharmony_ci	/* @GPIO(2): SYS_WATCHDOG(1) */
79762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("watchdog", mt7981_watchdog),
79862306a36Sopenharmony_ci	/* @GPIO(3): PCIE_PERESET_N(1) */
79962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pcie_pereset", mt7981_pcie_pereset),
80062306a36Sopenharmony_ci	/* @GPIO(4,8) JTAG(1) */
80162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("jtag", mt7981_jtag),
80262306a36Sopenharmony_ci	/* @GPIO(4,8) WM_JTAG(2) */
80362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wm_jtag_0", mt7981_wm_jtag_0),
80462306a36Sopenharmony_ci	/* @GPIO(9,13) WO0_JTAG(1) */
80562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wo0_jtag_0", mt7981_wo0_jtag_0),
80662306a36Sopenharmony_ci	/* @GPIO(4,7) WM_JTAG(3) */
80762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("uart2_0", mt7981_uart2_0),
80862306a36Sopenharmony_ci	/* @GPIO(8) GBE_LED0(3) */
80962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("gbe_led0", mt7981_gbe_led0),
81062306a36Sopenharmony_ci	/* @GPIO(4,6) PTA_EXT(4) */
81162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pta_ext_0", mt7981_pta_ext_0),
81262306a36Sopenharmony_ci	/* @GPIO(7) PWM2(4) */
81362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pwm2", mt7981_pwm2),
81462306a36Sopenharmony_ci	/* @GPIO(8) NET_WO0_UART_TXD(4) */
81562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("net_wo0_uart_txd_0", mt7981_net_wo0_uart_txd_0),
81662306a36Sopenharmony_ci	/* @GPIO(4,7) SPI1(5) */
81762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("spi1_0", mt7981_spi1_0),
81862306a36Sopenharmony_ci	/* @GPIO(6,7) I2C(5) */
81962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("i2c0_0", mt7981_i2c0_0),
82062306a36Sopenharmony_ci	/* @GPIO(0,1,4,5): DFD_NTRST(6) */
82162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("dfd_ntrst", mt7981_dfd_ntrst),
82262306a36Sopenharmony_ci	/* @GPIO(9,10): WM_AICE(2) */
82362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wm_aice1", mt7981_wm_aice1),
82462306a36Sopenharmony_ci	/* @GPIO(13): PWM0(2) */
82562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pwm0_0", mt7981_pwm0_0),
82662306a36Sopenharmony_ci	/* @GPIO(15): PWM0(1) */
82762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pwm0_1", mt7981_pwm0_1),
82862306a36Sopenharmony_ci	/* @GPIO(14): PWM1(2) */
82962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pwm1_0", mt7981_pwm1_0),
83062306a36Sopenharmony_ci	/* @GPIO(15): PWM1(3) */
83162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pwm1_1", mt7981_pwm1_1),
83262306a36Sopenharmony_ci	/* @GPIO(14) NET_WO0_UART_TXD(3) */
83362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("net_wo0_uart_txd_1", mt7981_net_wo0_uart_txd_1),
83462306a36Sopenharmony_ci	/* @GPIO(15) NET_WO0_UART_TXD(4) */
83562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("net_wo0_uart_txd_2", mt7981_net_wo0_uart_txd_2),
83662306a36Sopenharmony_ci	/* @GPIO(13) GBE_LED0(3) */
83762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("gbe_led1", mt7981_gbe_led1),
83862306a36Sopenharmony_ci	/* @GPIO(9,13) PCM(4) */
83962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pcm", mt7981_pcm),
84062306a36Sopenharmony_ci	/* @GPIO(13): SYS_WATCHDOG1(5) */
84162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("watchdog1", mt7981_watchdog1),
84262306a36Sopenharmony_ci	/* @GPIO(9,13) UDI(4) */
84362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("udi", mt7981_udi),
84462306a36Sopenharmony_ci	/* @GPIO(14) DRV_VBUS(1) */
84562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("drv_vbus", mt7981_drv_vbus),
84662306a36Sopenharmony_ci	/* @GPIO(15,25): EMMC(2) */
84762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("emmc_45", mt7981_emmc_45),
84862306a36Sopenharmony_ci	/* @GPIO(16,21): SNFI(3) */
84962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("snfi", mt7981_snfi),
85062306a36Sopenharmony_ci	/* @GPIO(16,19): SPI0(1) */
85162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("spi0", mt7981_spi0),
85262306a36Sopenharmony_ci	/* @GPIO(20,21): SPI0(1) */
85362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("spi0_wp_hold", mt7981_spi0_wp_hold),
85462306a36Sopenharmony_ci	/* @GPIO(22,25) SPI1(1) */
85562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("spi1_1", mt7981_spi1_1),
85662306a36Sopenharmony_ci	/* @GPIO(26,29): SPI2(1) */
85762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("spi2", mt7981_spi2),
85862306a36Sopenharmony_ci	/* @GPIO(30,31): SPI0(1) */
85962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("spi2_wp_hold", mt7981_spi2_wp_hold),
86062306a36Sopenharmony_ci	/* @GPIO(16,19): UART1(4) */
86162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("uart1_0", mt7981_uart1_0),
86262306a36Sopenharmony_ci	/* @GPIO(26,29): UART1(2) */
86362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("uart1_1", mt7981_uart1_1),
86462306a36Sopenharmony_ci	/* @GPIO(22,25): UART1(3) */
86562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("uart2_1", mt7981_uart2_1),
86662306a36Sopenharmony_ci	/* @GPIO(22,24) PTA_EXT(4) */
86762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pta_ext_1", mt7981_pta_ext_1),
86862306a36Sopenharmony_ci	/* @GPIO(20,21): WM_UART(4) */
86962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wm_aurt_1", mt7981_wm_uart_1),
87062306a36Sopenharmony_ci	/* @GPIO(30,31): WM_UART(3) */
87162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wm_aurt_2", mt7981_wm_uart_2),
87262306a36Sopenharmony_ci	/* @GPIO(20,24) WM_JTAG(5) */
87362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wm_jtag_1", mt7981_wm_jtag_1),
87462306a36Sopenharmony_ci	/* @GPIO(25,29) WO0_JTAG(5) */
87562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wo0_jtag_1", mt7981_wo0_jtag_1),
87662306a36Sopenharmony_ci	/* @GPIO(28,29): WA_AICE(3) */
87762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wa_aice3", mt7981_wa_aice3),
87862306a36Sopenharmony_ci	/* @GPIO(30,31): WM_AICE(5) */
87962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wm_aice2", mt7981_wm_aice2),
88062306a36Sopenharmony_ci	/* @GPIO(30,31): I2C(4) */
88162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("i2c0_1", mt7981_i2c0_1),
88262306a36Sopenharmony_ci	/* @GPIO(30,31): I2C(6) */
88362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("u2_phy_i2c", mt7981_u2_phy_i2c),
88462306a36Sopenharmony_ci	/* @GPIO(32,33): I2C(1) */
88562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("uart0", mt7981_uart0),
88662306a36Sopenharmony_ci	/* @GPIO(32,33): I2C(2) */
88762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("sgmii1_phy_i2c", mt7981_sgmii1_phy_i2c),
88862306a36Sopenharmony_ci	/* @GPIO(32,33): I2C(3) */
88962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("u3_phy_i2c", mt7981_u3_phy_i2c),
89062306a36Sopenharmony_ci	/* @GPIO(32,33): I2C(5) */
89162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("sgmii0_phy_i2c", mt7981_sgmii0_phy_i2c),
89262306a36Sopenharmony_ci	/* @GPIO(34): PCIE_CLK_REQ(2) */
89362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pcie_clk", mt7981_pcie_clk),
89462306a36Sopenharmony_ci	/* @GPIO(35): PCIE_WAKE_N(2) */
89562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("pcie_wake", mt7981_pcie_wake),
89662306a36Sopenharmony_ci	/* @GPIO(36,37): I2C(2) */
89762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("i2c0_2", mt7981_i2c0_2),
89862306a36Sopenharmony_ci	/* @GPIO(36,37): MDC_MDIO(1) */
89962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("smi_mdc_mdio", mt7981_smi_mdc_mdio),
90062306a36Sopenharmony_ci	/* @GPIO(36,37): MDC_MDIO(3) */
90162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("gbe_ext_mdc_mdio", mt7981_gbe_ext_mdc_mdio),
90262306a36Sopenharmony_ci	/* @GPIO(69,85): WF0_MODE1(1) */
90362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wf0_mode1", mt7981_wf0_mode1),
90462306a36Sopenharmony_ci	/* @GPIO(74,80): WF0_MODE3(3) */
90562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wf0_mode3", mt7981_wf0_mode3),
90662306a36Sopenharmony_ci	/* @GPIO(30): WF2G_LED(2) */
90762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wf2g_led0", mt7981_wf2g_led0),
90862306a36Sopenharmony_ci	/* @GPIO(34): WF2G_LED(1) */
90962306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wf2g_led1", mt7981_wf2g_led1),
91062306a36Sopenharmony_ci	/* @GPIO(31): WF5G_LED(2) */
91162306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wf5g_led0", mt7981_wf5g_led0),
91262306a36Sopenharmony_ci	/* @GPIO(35): WF5G_LED(1) */
91362306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("wf5g_led1", mt7981_wf5g_led1),
91462306a36Sopenharmony_ci	/* @GPIO(38): MT7531_INT(1) */
91562306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("mt7531_int", mt7981_mt7531_int),
91662306a36Sopenharmony_ci	/* @GPIO(14,15,26,17,18,19,20,21,22,23,24,25,34,35): ANT_SEL(1) */
91762306a36Sopenharmony_ci	PINCTRL_PIN_GROUP("ant_sel", mt7981_ant_sel),
91862306a36Sopenharmony_ci};
91962306a36Sopenharmony_ci
92062306a36Sopenharmony_ci/* Joint those groups owning the same capability in user point of view which
92162306a36Sopenharmony_ci * allows that people tend to use through the device tree.
92262306a36Sopenharmony_ci */
92362306a36Sopenharmony_cistatic const char *mt7981_wa_aice_groups[] = { "wa_aice1", "wa_aice2", "wm_aice1_1",
92462306a36Sopenharmony_ci	"wa_aice3", "wm_aice1_2", };
92562306a36Sopenharmony_cistatic const char *mt7981_uart_groups[] = { "wm_uart_0", "uart2_0",
92662306a36Sopenharmony_ci	"net_wo0_uart_txd_0", "net_wo0_uart_txd_1", "net_wo0_uart_txd_2",
92762306a36Sopenharmony_ci	"uart1_0", "uart1_1", "uart2_1", "wm_aurt_1", "wm_aurt_2", "uart0", };
92862306a36Sopenharmony_cistatic const char *mt7981_dfd_groups[] = { "dfd", "dfd_ntrst", };
92962306a36Sopenharmony_cistatic const char *mt7981_wdt_groups[] = { "watchdog", "watchdog1", };
93062306a36Sopenharmony_cistatic const char *mt7981_pcie_groups[] = { "pcie_pereset", "pcie_clk", "pcie_wake", };
93162306a36Sopenharmony_cistatic const char *mt7981_jtag_groups[] = { "jtag", "wm_jtag_0", "wo0_jtag_0",
93262306a36Sopenharmony_ci	"wo0_jtag_1", "wm_jtag_1", };
93362306a36Sopenharmony_cistatic const char *mt7981_led_groups[] = { "gbe_led0", "gbe_led1", "wf2g_led0",
93462306a36Sopenharmony_ci	"wf2g_led1", "wf5g_led0", "wf5g_led1", };
93562306a36Sopenharmony_cistatic const char *mt7981_pta_groups[] = { "pta_ext_0", "pta_ext_1", };
93662306a36Sopenharmony_cistatic const char *mt7981_pwm_groups[] = { "pwm2", "pwm0_0", "pwm0_1",
93762306a36Sopenharmony_ci	"pwm1_0", "pwm1_1", };
93862306a36Sopenharmony_cistatic const char *mt7981_spi_groups[] = { "spi1_0", "spi0", "spi0_wp_hold", "spi1_1", "spi2",
93962306a36Sopenharmony_ci	"spi2_wp_hold", };
94062306a36Sopenharmony_cistatic const char *mt7981_i2c_groups[] = { "i2c0_0", "i2c0_1", "u2_phy_i2c",
94162306a36Sopenharmony_ci	"sgmii1_phy_i2c", "u3_phy_i2c", "sgmii0_phy_i2c", "i2c0_2", };
94262306a36Sopenharmony_cistatic const char *mt7981_pcm_groups[] = { "pcm", };
94362306a36Sopenharmony_cistatic const char *mt7981_udi_groups[] = { "udi", };
94462306a36Sopenharmony_cistatic const char *mt7981_usb_groups[] = { "drv_vbus", };
94562306a36Sopenharmony_cistatic const char *mt7981_flash_groups[] = { "emmc_45", "snfi", };
94662306a36Sopenharmony_cistatic const char *mt7981_ethernet_groups[] = { "smi_mdc_mdio", "gbe_ext_mdc_mdio",
94762306a36Sopenharmony_ci	"wf0_mode1", "wf0_mode3", "mt7531_int", };
94862306a36Sopenharmony_cistatic const char *mt7981_ant_groups[] = { "ant_sel", };
94962306a36Sopenharmony_ci
95062306a36Sopenharmony_cistatic const struct function_desc mt7981_functions[] = {
95162306a36Sopenharmony_ci	{"wa_aice",	mt7981_wa_aice_groups, ARRAY_SIZE(mt7981_wa_aice_groups)},
95262306a36Sopenharmony_ci	{"dfd",	mt7981_dfd_groups, ARRAY_SIZE(mt7981_dfd_groups)},
95362306a36Sopenharmony_ci	{"jtag", mt7981_jtag_groups, ARRAY_SIZE(mt7981_jtag_groups)},
95462306a36Sopenharmony_ci	{"pta", mt7981_pta_groups, ARRAY_SIZE(mt7981_pta_groups)},
95562306a36Sopenharmony_ci	{"pcm", mt7981_pcm_groups, ARRAY_SIZE(mt7981_pcm_groups)},
95662306a36Sopenharmony_ci	{"udi", mt7981_udi_groups, ARRAY_SIZE(mt7981_udi_groups)},
95762306a36Sopenharmony_ci	{"usb", mt7981_usb_groups, ARRAY_SIZE(mt7981_usb_groups)},
95862306a36Sopenharmony_ci	{"ant", mt7981_ant_groups, ARRAY_SIZE(mt7981_ant_groups)},
95962306a36Sopenharmony_ci	{"eth",	mt7981_ethernet_groups, ARRAY_SIZE(mt7981_ethernet_groups)},
96062306a36Sopenharmony_ci	{"i2c", mt7981_i2c_groups, ARRAY_SIZE(mt7981_i2c_groups)},
96162306a36Sopenharmony_ci	{"led",	mt7981_led_groups, ARRAY_SIZE(mt7981_led_groups)},
96262306a36Sopenharmony_ci	{"pwm",	mt7981_pwm_groups, ARRAY_SIZE(mt7981_pwm_groups)},
96362306a36Sopenharmony_ci	{"spi",	mt7981_spi_groups, ARRAY_SIZE(mt7981_spi_groups)},
96462306a36Sopenharmony_ci	{"uart", mt7981_uart_groups, ARRAY_SIZE(mt7981_uart_groups)},
96562306a36Sopenharmony_ci	{"watchdog", mt7981_wdt_groups, ARRAY_SIZE(mt7981_wdt_groups)},
96662306a36Sopenharmony_ci	{"flash", mt7981_flash_groups, ARRAY_SIZE(mt7981_flash_groups)},
96762306a36Sopenharmony_ci	{"pcie", mt7981_pcie_groups, ARRAY_SIZE(mt7981_pcie_groups)},
96862306a36Sopenharmony_ci};
96962306a36Sopenharmony_ci
97062306a36Sopenharmony_cistatic const struct mtk_eint_hw mt7981_eint_hw = {
97162306a36Sopenharmony_ci	.port_mask = 7,
97262306a36Sopenharmony_ci	.ports     = 7,
97362306a36Sopenharmony_ci	.ap_num    = ARRAY_SIZE(mt7981_pins),
97462306a36Sopenharmony_ci	.db_cnt    = 16,
97562306a36Sopenharmony_ci};
97662306a36Sopenharmony_ci
97762306a36Sopenharmony_cistatic const char * const mt7981_pinctrl_register_base_names[] = {
97862306a36Sopenharmony_ci	"gpio", "iocfg_rt", "iocfg_rm", "iocfg_rb",
97962306a36Sopenharmony_ci	"iocfg_lb", "iocfg_bl", "iocfg_tm", "iocfg_tl",
98062306a36Sopenharmony_ci};
98162306a36Sopenharmony_ci
98262306a36Sopenharmony_cistatic struct mtk_pin_soc mt7981_data = {
98362306a36Sopenharmony_ci	.reg_cal = mt7981_reg_cals,
98462306a36Sopenharmony_ci	.pins = mt7981_pins,
98562306a36Sopenharmony_ci	.npins = ARRAY_SIZE(mt7981_pins),
98662306a36Sopenharmony_ci	.grps = mt7981_groups,
98762306a36Sopenharmony_ci	.ngrps = ARRAY_SIZE(mt7981_groups),
98862306a36Sopenharmony_ci	.funcs = mt7981_functions,
98962306a36Sopenharmony_ci	.nfuncs = ARRAY_SIZE(mt7981_functions),
99062306a36Sopenharmony_ci	.eint_hw = &mt7981_eint_hw,
99162306a36Sopenharmony_ci	.gpio_m = 0,
99262306a36Sopenharmony_ci	.ies_present = false,
99362306a36Sopenharmony_ci	.base_names = mt7981_pinctrl_register_base_names,
99462306a36Sopenharmony_ci	.nbase_names = ARRAY_SIZE(mt7981_pinctrl_register_base_names),
99562306a36Sopenharmony_ci	.bias_disable_set = mtk_pinconf_bias_disable_set,
99662306a36Sopenharmony_ci	.bias_disable_get = mtk_pinconf_bias_disable_get,
99762306a36Sopenharmony_ci	.bias_set = mtk_pinconf_bias_set,
99862306a36Sopenharmony_ci	.bias_get = mtk_pinconf_bias_get,
99962306a36Sopenharmony_ci	.pull_type = mt7981_pull_type,
100062306a36Sopenharmony_ci	.bias_set_combo = mtk_pinconf_bias_set_combo,
100162306a36Sopenharmony_ci	.bias_get_combo = mtk_pinconf_bias_get_combo,
100262306a36Sopenharmony_ci	.drive_set = mtk_pinconf_drive_set_rev1,
100362306a36Sopenharmony_ci	.drive_get = mtk_pinconf_drive_get_rev1,
100462306a36Sopenharmony_ci	.adv_pull_get = mtk_pinconf_adv_pull_get,
100562306a36Sopenharmony_ci	.adv_pull_set = mtk_pinconf_adv_pull_set,
100662306a36Sopenharmony_ci};
100762306a36Sopenharmony_ci
100862306a36Sopenharmony_cistatic const struct of_device_id mt7981_pinctrl_of_match[] = {
100962306a36Sopenharmony_ci	{ .compatible = "mediatek,mt7981-pinctrl", },
101062306a36Sopenharmony_ci	{}
101162306a36Sopenharmony_ci};
101262306a36Sopenharmony_ci
101362306a36Sopenharmony_cistatic int mt7981_pinctrl_probe(struct platform_device *pdev)
101462306a36Sopenharmony_ci{
101562306a36Sopenharmony_ci	return mtk_moore_pinctrl_probe(pdev, &mt7981_data);
101662306a36Sopenharmony_ci}
101762306a36Sopenharmony_ci
101862306a36Sopenharmony_cistatic struct platform_driver mt7981_pinctrl_driver = {
101962306a36Sopenharmony_ci	.driver = {
102062306a36Sopenharmony_ci		.name = "mt7981-pinctrl",
102162306a36Sopenharmony_ci		.of_match_table = mt7981_pinctrl_of_match,
102262306a36Sopenharmony_ci	},
102362306a36Sopenharmony_ci	.probe = mt7981_pinctrl_probe,
102462306a36Sopenharmony_ci};
102562306a36Sopenharmony_ci
102662306a36Sopenharmony_cistatic int __init mt7981_pinctrl_init(void)
102762306a36Sopenharmony_ci{
102862306a36Sopenharmony_ci	return platform_driver_register(&mt7981_pinctrl_driver);
102962306a36Sopenharmony_ci}
103062306a36Sopenharmony_ciarch_initcall(mt7981_pinctrl_init);
1031