18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2018 MediaTek Inc.
48c2ecf20Sopenharmony_ci * Author: Zhiyong Tao <zhiyong.tao@mediatek.com>
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include <linux/module.h>
98c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
108c2ecf20Sopenharmony_ci#include <linux/of.h>
118c2ecf20Sopenharmony_ci#include <linux/of_device.h>
128c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
138c2ecf20Sopenharmony_ci#include <linux/regmap.h>
148c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinconf-generic.h>
158c2ecf20Sopenharmony_ci#include <dt-bindings/pinctrl/mt65xx.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#include "pinctrl-mtk-common.h"
188c2ecf20Sopenharmony_ci#include "pinctrl-mtk-mt2712.h"
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cistatic const struct mtk_pin_spec_pupd_set_samereg mt2712_spec_pupd[] = {
218c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(18, 0xe50, 2, 1, 0),
228c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(19, 0xe60, 12, 11, 10),
238c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(20, 0xe50, 5, 4, 3),
248c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(21, 0xe60, 15, 14, 13),
258c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(22, 0xe50, 8, 7, 6),
268c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(23, 0xe70, 2, 1, 0),
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(30, 0xf30, 2, 1, 0),
298c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(31, 0xf30, 6, 5, 4),
308c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(32, 0xf30, 10, 9, 8),
318c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(33, 0xf30, 14, 13, 12),
328c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(34, 0xf40, 2, 1, 0),
338c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(35, 0xf40, 6, 5, 4),
348c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(36, 0xf40, 10, 9, 8),
358c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(37, 0xc40, 2, 1, 0),
368c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(38, 0xc60, 2, 1, 0),
378c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(39, 0xc60, 2, 1, 0),
388c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(40, 0xc60, 2, 1, 0),
398c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(41, 0xc60, 2, 1, 0),
408c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(42, 0xc60, 2, 1, 0),
418c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(43, 0xc60, 2, 1, 0),
428c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(44, 0xc60, 2, 1, 0),
438c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(45, 0xc60, 2, 1, 0),
448c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(46, 0xc50, 2, 1, 0),
458c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(47, 0xda0, 2, 1, 0),
468c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(48, 0xd90, 2, 1, 0),
478c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(49, 0xdf0, 14, 13, 12),
488c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(50, 0xdf0, 10, 9, 8),
498c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(51, 0xdf0, 6, 5, 4),
508c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(52, 0xdf0, 2, 1, 0),
518c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(53, 0xd50, 2, 1, 0),
528c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(54, 0xd80, 2, 1, 0),
538c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(55, 0xe00, 2, 1, 0),
548c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(56, 0xd40, 2, 1, 0),
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(63, 0xc80, 2, 1, 0),
578c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(64, 0xdb0, 14, 13, 12),
588c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(65, 0xdb0, 6, 5, 4),
598c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(66, 0xdb0, 10, 9, 8),
608c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(67, 0xcd0, 2, 1, 0),
618c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(68, 0xdb0, 2, 1, 0),
628c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(69, 0xc90, 2, 1, 0),
638c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(70, 0xcc0, 2, 1, 0),
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(89, 0xce0, 2, 1, 0),
668c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(90, 0xdd0, 14, 13, 12),
678c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(91, 0xdd0, 10, 9, 8),
688c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(92, 0xdd0, 6, 5, 4),
698c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(93, 0xdd0, 2, 1, 0),
708c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(94, 0xd20, 2, 1, 0),
718c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(95, 0xcf0, 2, 1, 0),
728c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(96, 0xd30, 2, 1, 0),
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(135, 0xe50, 11, 10, 9),
758c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(136, 0xe50, 14, 13, 12),
768c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(137, 0xe70, 5, 4, 3),
778c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(138, 0xe70, 8, 7, 6),
788c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(139, 0xe70, 11, 10, 9),
798c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(140, 0xe70, 14, 13, 12),
808c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(141, 0xe60, 2, 1, 0),
818c2ecf20Sopenharmony_ci	MTK_PIN_PUPD_SPEC_SR(142, 0xe60, 5, 4, 3)
828c2ecf20Sopenharmony_ci};
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_cistatic int mt2712_spec_pull_set(struct regmap *regmap,
858c2ecf20Sopenharmony_ci				unsigned int pin,
868c2ecf20Sopenharmony_ci				unsigned char align,
878c2ecf20Sopenharmony_ci				bool isup,
888c2ecf20Sopenharmony_ci				unsigned int r1r0)
898c2ecf20Sopenharmony_ci{
908c2ecf20Sopenharmony_ci	return mtk_pctrl_spec_pull_set_samereg(regmap, mt2712_spec_pupd,
918c2ecf20Sopenharmony_ci		ARRAY_SIZE(mt2712_spec_pupd), pin, align, isup, r1r0);
928c2ecf20Sopenharmony_ci}
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_cistatic const struct mtk_pin_ies_smt_set mt2712_smt_set[] = {
958c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(0, 3, 0x900, 2),
968c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(4, 7, 0x900, 0),
978c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(8, 11, 0x900, 1),
988c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(12, 12, 0x8d0, 6),
998c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(13, 13, 0x8d0, 7),
1008c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(14, 14, 0x8d0, 6),
1018c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(15, 15, 0x8d0, 7),
1028c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(18, 23, 0x8d0, 1),
1038c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(24, 25, 0x8d0, 2),
1048c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(26, 26, 0x8d0, 3),
1058c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(27, 27, 0x8d0, 4),
1068c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(28, 29, 0x8d0, 3),
1078c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(30, 36, 0xf50, 13),
1088c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(37, 37, 0xc40, 13),
1098c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(38, 45, 0xc60, 13),
1108c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(46, 46, 0xc50, 13),
1118c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(47, 47, 0xda0, 13),
1128c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(48, 48, 0xd90, 13),
1138c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(49, 52, 0xd60, 13),
1148c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(53, 53, 0xd50, 13),
1158c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(54, 54, 0xd80, 13),
1168c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(55, 55, 0xe00, 13),
1178c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(56, 56, 0xd40, 13),
1188c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(57, 62, 0x900, 3),
1198c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(63, 63, 0xc80, 13),
1208c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(64, 66, 0xca0, 13),
1218c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(67, 67, 0xc80, 13),
1228c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(68, 68, 0xca0, 13),
1238c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(69, 69, 0xc90, 13),
1248c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(70, 70, 0xc80, 13),
1258c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(71, 74, 0x8d0, 8),
1268c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(75, 77, 0x8d0, 9),
1278c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(78, 81, 0x8d0, 10),
1288c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(82, 88, 0x8d0, 9),
1298c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(89, 89, 0xce0, 13),
1308c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(90, 93, 0xd00, 13),
1318c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(94, 94, 0xce0, 13),
1328c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(95, 96, 0xcf0, 13),
1338c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(97, 100, 0x8d0, 11),
1348c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(101, 104, 0x8d0, 12),
1358c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(105, 105, 0x8d0, 13),
1368c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(106, 106, 0x8d0, 14),
1378c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(107, 107, 0x8d0, 15),
1388c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(108, 108, 0x8e0, 0),
1398c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(109, 109, 0x8e0, 1),
1408c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(110, 110, 0x8e0, 2),
1418c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(111, 111, 0x8d0, 13),
1428c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(112, 112, 0x8d0, 14),
1438c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(113, 113, 0x8d0, 15),
1448c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(114, 114, 0x8e0, 0),
1458c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(115, 115, 0x8e0, 1),
1468c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(116, 116, 0x8e0, 2),
1478c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(117, 117, 0x8e0, 3),
1488c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(118, 118, 0x8e0, 4),
1498c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(119, 119, 0x8e0, 5),
1508c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(120, 120, 0x8e0, 3),
1518c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(121, 121, 0x8e0, 4),
1528c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(122, 122, 0x8e0, 5),
1538c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(123, 126, 0x8e0, 6),
1548c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(127, 130, 0x8e0, 7),
1558c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(131, 134, 0x8e0, 8),
1568c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(135, 142, 0x8d0, 1),
1578c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(143, 147, 0x8e0, 9),
1588c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(148, 152, 0x8e0, 10),
1598c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(153, 156, 0x8e0, 11),
1608c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(157, 160, 0x8e0, 12),
1618c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(161, 164, 0x8e0, 13),
1628c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(165, 168, 0x8e0, 14),
1638c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(169, 170, 0x8e0, 15),
1648c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(171, 172, 0x8f0, 0),
1658c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(173, 173, 0x8f0, 1),
1668c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(174, 175, 0x8f0, 2),
1678c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(176, 176, 0x8f0, 1),
1688c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(177, 177, 0x8f0, 3),
1698c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(178, 178, 0x8f0, 4),
1708c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(179, 179, 0x8f0, 3),
1718c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(180, 180, 0x8f0, 4),
1728c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(181, 181, 0x8f0, 5),
1738c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(182, 182, 0x8f0, 6),
1748c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(183, 183, 0x8f0, 5),
1758c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(184, 184, 0x8f0, 6),
1768c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(185, 186, 0x8f0, 7),
1778c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(187, 187, 0x8f0, 8),
1788c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(188, 188, 0x8f0, 9),
1798c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(189, 189, 0x8f0, 8),
1808c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(190, 190, 0x8f0, 9),
1818c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(191, 191, 0x8f0, 10),
1828c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(192, 192, 0x8f0, 11),
1838c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(193, 194, 0x8f0, 10),
1848c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(195, 195, 0x8f0, 11),
1858c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(196, 199, 0x8f0, 12),
1868c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(200, 203, 0x8f0, 13),
1878c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(204, 206, 0x8f0, 14),
1888c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(207, 209, 0x8f0, 15)
1898c2ecf20Sopenharmony_ci};
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_cistatic const struct mtk_pin_ies_smt_set mt2712_ies_set[] = {
1928c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(0, 3, 0x8c0, 2),
1938c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(4, 7, 0x8c0, 0),
1948c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(8, 9, 0x8c0, 1),
1958c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(10, 11, 0x8c0, 4),
1968c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(12, 12, 0x890, 6),
1978c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(13, 13, 0x890, 7),
1988c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(14, 14, 0x890, 6),
1998c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(15, 15, 0x890, 7),
2008c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(18, 23, 0x890, 1),
2018c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(24, 25, 0x890, 2),
2028c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(26, 26, 0x890, 3),
2038c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(27, 27, 0x890, 4),
2048c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(28, 29, 0x890, 3),
2058c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(30, 36, 0xf50, 14),
2068c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(37, 37, 0xc40, 14),
2078c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(38, 45, 0xc60, 14),
2088c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(46, 46, 0xc50, 14),
2098c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(47, 47, 0xda0, 14),
2108c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(48, 48, 0xd90, 14),
2118c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(49, 52, 0xd60, 14),
2128c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(53, 53, 0xd50, 14),
2138c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(54, 54, 0xd80, 14),
2148c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(55, 55, 0xe00, 14),
2158c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(56, 56, 0xd40, 14),
2168c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(57, 62, 0x8c0, 3),
2178c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(63, 63, 0xc80, 14),
2188c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(64, 66, 0xca0, 14),
2198c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(67, 68, 0xc80, 14),
2208c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(69, 69, 0xc90, 14),
2218c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(70, 70, 0xc80, 14),
2228c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(71, 74, 0x890, 8),
2238c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(75, 77, 0x890, 9),
2248c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(78, 81, 0x890, 10),
2258c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(82, 88, 0x890, 9),
2268c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(89, 89, 0xce0, 14),
2278c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(90, 93, 0xd00, 14),
2288c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(94, 94, 0xce0, 14),
2298c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(95, 96, 0xcf0, 14),
2308c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(97, 100, 0x890, 11),
2318c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(101, 104, 0x890, 12),
2328c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(105, 105, 0x890, 13),
2338c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(106, 106, 0x890, 14),
2348c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(107, 107, 0x890, 15),
2358c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(108, 108, 0x8a0, 0),
2368c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(109, 109, 0x8a0, 1),
2378c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(110, 110, 0x8a0, 2),
2388c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(111, 111, 0x890, 13),
2398c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(112, 112, 0x890, 14),
2408c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(113, 113, 0x890, 15),
2418c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(114, 114, 0x8a0, 0),
2428c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(115, 115, 0x8a0, 1),
2438c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(116, 116, 0x8a0, 2),
2448c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(117, 117, 0x8a0, 3),
2458c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(118, 118, 0x8a0, 4),
2468c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(119, 119, 0x8a0, 5),
2478c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(120, 120, 0x8a0, 3),
2488c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(121, 121, 0x8a0, 4),
2498c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(122, 122, 0x8a0, 5),
2508c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(123, 126, 0x8a0, 6),
2518c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(127, 130, 0x8a0, 7),
2528c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(131, 135, 0x8a0, 8),
2538c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(136, 142, 0x890, 1),
2548c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(143, 147, 0x8a0, 9),
2558c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(148, 152, 0x8a0, 10),
2568c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(153, 156, 0x8a0, 11),
2578c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(157, 160, 0x8a0, 12),
2588c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(161, 164, 0x8a0, 13),
2598c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(165, 168, 0x8a0, 14),
2608c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(169, 170, 0x8a0, 15),
2618c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(171, 172, 0x8b0, 0),
2628c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(173, 173, 0x8b0, 1),
2638c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(174, 175, 0x8b0, 2),
2648c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(176, 176, 0x8b0, 1),
2658c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(177, 177, 0x8b0, 3),
2668c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(178, 178, 0x8b0, 4),
2678c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(179, 179, 0x8b0, 3),
2688c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(180, 180, 0x8b0, 4),
2698c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(181, 181, 0x8b0, 5),
2708c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(182, 182, 0x8b0, 6),
2718c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(183, 183, 0x8b0, 5),
2728c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(184, 184, 0x8b0, 6),
2738c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(185, 186, 0x8b0, 7),
2748c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(187, 187, 0x8b0, 8),
2758c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(188, 188, 0x8b0, 9),
2768c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(189, 189, 0x8b0, 8),
2778c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(190, 190, 0x8b0, 9),
2788c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(191, 191, 0x8b0, 10),
2798c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(192, 192, 0x8b0, 11),
2808c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(193, 194, 0x8b0, 10),
2818c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(195, 195, 0x8b0, 11),
2828c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(196, 199, 0x8b0, 12),
2838c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(200, 203, 0x8b0, 13),
2848c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(204, 206, 0x8b0, 14),
2858c2ecf20Sopenharmony_ci	MTK_PIN_IES_SMT_SPEC(207, 209, 0x8b0, 15)
2868c2ecf20Sopenharmony_ci};
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_cistatic int mt2712_ies_smt_set(struct regmap *regmap, unsigned int pin,
2898c2ecf20Sopenharmony_ci			      unsigned char align,
2908c2ecf20Sopenharmony_ci			      int value, enum pin_config_param arg)
2918c2ecf20Sopenharmony_ci{
2928c2ecf20Sopenharmony_ci	if (arg == PIN_CONFIG_INPUT_ENABLE)
2938c2ecf20Sopenharmony_ci		return mtk_pconf_spec_set_ies_smt_range(regmap, mt2712_ies_set,
2948c2ecf20Sopenharmony_ci			ARRAY_SIZE(mt2712_ies_set), pin, align, value);
2958c2ecf20Sopenharmony_ci	if (arg == PIN_CONFIG_INPUT_SCHMITT_ENABLE)
2968c2ecf20Sopenharmony_ci		return mtk_pconf_spec_set_ies_smt_range(regmap, mt2712_smt_set,
2978c2ecf20Sopenharmony_ci			ARRAY_SIZE(mt2712_smt_set), pin, align, value);
2988c2ecf20Sopenharmony_ci	return -EINVAL;
2998c2ecf20Sopenharmony_ci}
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_cistatic const struct mtk_drv_group_desc mt2712_drv_grp[] =  {
3028c2ecf20Sopenharmony_ci	/* 0E4E8SR 4/8/12/16 */
3038c2ecf20Sopenharmony_ci	MTK_DRV_GRP(4, 16, 1, 2, 4),
3048c2ecf20Sopenharmony_ci	/* 0E2E4SR  2/4/6/8 */
3058c2ecf20Sopenharmony_ci	MTK_DRV_GRP(2, 8, 1, 2, 2),
3068c2ecf20Sopenharmony_ci	/* E8E4E2  2/4/6/8/10/12/14/16 */
3078c2ecf20Sopenharmony_ci	MTK_DRV_GRP(2, 16, 0, 2, 2)
3088c2ecf20Sopenharmony_ci};
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_cistatic const struct mtk_pin_drv_grp mt2712_pin_drv[] = {
3118c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(0, 0xc10, 4, 0),
3128c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(1, 0xc10, 4, 0),
3138c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(2, 0xc10, 4, 0),
3148c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(3, 0xc10, 4, 0),
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(4, 0xc00, 12, 0),
3178c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(5, 0xc00, 12, 0),
3188c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(6, 0xc00, 12, 0),
3198c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(7, 0xc00, 12, 0),
3208c2ecf20Sopenharmony_ci
3218c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(8, 0xc10, 0, 0),
3228c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(9, 0xc10, 0, 0),
3238c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(10, 0xc10, 0, 0),
3248c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(11, 0xc10, 0, 0),
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(12, 0xb60, 0, 0),
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(13, 0xb60, 4, 0),
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(14, 0xb60, 0, 0),
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(15, 0xb60, 4, 0),
3338c2ecf20Sopenharmony_ci
3348c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(18, 0xb40, 0, 1),
3358c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(19, 0xb40, 0, 1),
3368c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(20, 0xb40, 0, 1),
3378c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(21, 0xb40, 0, 1),
3388c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(22, 0xb40, 0, 1),
3398c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(23, 0xb40, 0, 1),
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(24, 0xb40, 4, 0),
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(25, 0xb40, 8, 0),
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(26, 0xb40, 12, 0),
3468c2ecf20Sopenharmony_ci
3478c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(27, 0xb50, 0, 0),
3488c2ecf20Sopenharmony_ci
3498c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(28, 0xb40, 12, 0),
3508c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(29, 0xb40, 12, 0),
3518c2ecf20Sopenharmony_ci
3528c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(30, 0xf50, 8, 2),
3538c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(31, 0xf50, 8, 2),
3548c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(32, 0xf50, 8, 2),
3558c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(33, 0xf50, 8, 2),
3568c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(34, 0xf50, 8, 2),
3578c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(35, 0xf50, 8, 2),
3588c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(36, 0xf50, 8, 2),
3598c2ecf20Sopenharmony_ci
3608c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(37, 0xc40, 8, 2),
3618c2ecf20Sopenharmony_ci
3628c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(38, 0xc60, 8, 2),
3638c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(39, 0xc60, 8, 2),
3648c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(40, 0xc60, 8, 2),
3658c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(41, 0xc60, 8, 2),
3668c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(42, 0xc60, 8, 2),
3678c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(43, 0xc60, 8, 2),
3688c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(44, 0xc60, 8, 2),
3698c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(45, 0xc60, 8, 2),
3708c2ecf20Sopenharmony_ci
3718c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(46, 0xc50, 8, 2),
3728c2ecf20Sopenharmony_ci
3738c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(47, 0xda0, 8, 2),
3748c2ecf20Sopenharmony_ci
3758c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(48, 0xd90, 8, 2),
3768c2ecf20Sopenharmony_ci
3778c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(49, 0xd60, 8, 2),
3788c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(50, 0xd60, 8, 2),
3798c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(51, 0xd60, 8, 2),
3808c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(52, 0xd60, 8, 2),
3818c2ecf20Sopenharmony_ci
3828c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(53, 0xd50, 8, 2),
3838c2ecf20Sopenharmony_ci
3848c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(54, 0xd80, 8, 2),
3858c2ecf20Sopenharmony_ci
3868c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(55, 0xe00, 8, 2),
3878c2ecf20Sopenharmony_ci
3888c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(56, 0xd40, 8, 2),
3898c2ecf20Sopenharmony_ci
3908c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(63, 0xc80, 8, 2),
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(64, 0xca0, 8, 2),
3938c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(65, 0xca0, 8, 2),
3948c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(66, 0xca0, 8, 2),
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(67, 0xcd0, 8, 2),
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(68, 0xca0, 8, 2),
3998c2ecf20Sopenharmony_ci
4008c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(69, 0xc90, 8, 2),
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(70, 0xcc0, 8, 2),
4038c2ecf20Sopenharmony_ci
4048c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(71, 0xb60, 8, 1),
4058c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(72, 0xb60, 8, 1),
4068c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(73, 0xb60, 8, 1),
4078c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(74, 0xb60, 8, 1),
4088c2ecf20Sopenharmony_ci
4098c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(75, 0xb60, 12, 1),
4108c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(76, 0xb60, 12, 1),
4118c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(77, 0xb60, 12, 1),
4128c2ecf20Sopenharmony_ci
4138c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(78, 0xb70, 0, 1),
4148c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(79, 0xb70, 0, 1),
4158c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(80, 0xb70, 0, 1),
4168c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(81, 0xb70, 0, 1),
4178c2ecf20Sopenharmony_ci
4188c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(82, 0xb60, 12, 1),
4198c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(83, 0xb60, 12, 1),
4208c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(84, 0xb60, 12, 1),
4218c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(85, 0xb60, 12, 1),
4228c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(86, 0xb60, 12, 1),
4238c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(87, 0xb60, 12, 1),
4248c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(88, 0xb60, 12, 1),
4258c2ecf20Sopenharmony_ci
4268c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(89, 0xce0, 8, 2),
4278c2ecf20Sopenharmony_ci
4288c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(90, 0xd00, 8, 2),
4298c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(91, 0xd00, 8, 2),
4308c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(92, 0xd00, 8, 2),
4318c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(93, 0xd00, 8, 2),
4328c2ecf20Sopenharmony_ci
4338c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(94, 0xd20, 8, 2),
4348c2ecf20Sopenharmony_ci
4358c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(95, 0xcf0, 8, 2),
4368c2ecf20Sopenharmony_ci
4378c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(96, 0xd30, 8, 2),
4388c2ecf20Sopenharmony_ci
4398c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(97, 0xb70, 4, 0),
4408c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(98, 0xb70, 4, 0),
4418c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(99, 0xb70, 4, 0),
4428c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(100, 0xb70, 4, 0),
4438c2ecf20Sopenharmony_ci
4448c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(101, 0xb70, 8, 0),
4458c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(102, 0xb70, 8, 0),
4468c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(103, 0xb70, 8, 0),
4478c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(104, 0xb70, 8, 0),
4488c2ecf20Sopenharmony_ci
4498c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(135, 0xb40, 0, 1),
4508c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(136, 0xb40, 0, 1),
4518c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(137, 0xb40, 0, 1),
4528c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(138, 0xb40, 0, 1),
4538c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(139, 0xb40, 0, 1),
4548c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(140, 0xb40, 0, 1),
4558c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(141, 0xb40, 0, 1),
4568c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(142, 0xb40, 0, 1),
4578c2ecf20Sopenharmony_ci
4588c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(143, 0xba0, 12, 0),
4598c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(144, 0xba0, 12, 0),
4608c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(145, 0xba0, 12, 0),
4618c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(146, 0xba0, 12, 0),
4628c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(147, 0xba0, 12, 0),
4638c2ecf20Sopenharmony_ci
4648c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(148, 0xbb0, 0, 0),
4658c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(149, 0xbb0, 0, 0),
4668c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(150, 0xbb0, 0, 0),
4678c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(151, 0xbb0, 0, 0),
4688c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(152, 0xbb0, 0, 0),
4698c2ecf20Sopenharmony_ci
4708c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(153, 0xbb0, 4, 0),
4718c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(154, 0xbb0, 4, 0),
4728c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(155, 0xbb0, 4, 0),
4738c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(156, 0xbb0, 4, 0),
4748c2ecf20Sopenharmony_ci
4758c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(157, 0xbb0, 8, 0),
4768c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(158, 0xbb0, 8, 0),
4778c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(159, 0xbb0, 8, 0),
4788c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(160, 0xbb0, 8, 0),
4798c2ecf20Sopenharmony_ci
4808c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(161, 0xbb0, 12, 0),
4818c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(162, 0xbb0, 12, 0),
4828c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(163, 0xbb0, 12, 0),
4838c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(164, 0xbb0, 12, 0),
4848c2ecf20Sopenharmony_ci
4858c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(165, 0xbc0, 0, 0),
4868c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(166, 0xbc0, 0, 0),
4878c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(167, 0xbc0, 0, 0),
4888c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(168, 0xbc0, 0, 0),
4898c2ecf20Sopenharmony_ci
4908c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(169, 0xbc0, 4, 0),
4918c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(170, 0xbc0, 4, 0),
4928c2ecf20Sopenharmony_ci
4938c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(171, 0xbc0, 8, 0),
4948c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(172, 0xbc0, 8, 0),
4958c2ecf20Sopenharmony_ci
4968c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(173, 0xbc0, 12, 0),
4978c2ecf20Sopenharmony_ci
4988c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(174, 0xbd0, 0, 0),
4998c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(175, 0xbd0, 0, 0),
5008c2ecf20Sopenharmony_ci
5018c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(176, 0xbc0, 12, 0),
5028c2ecf20Sopenharmony_ci
5038c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(177, 0xbd0, 4, 0),
5048c2ecf20Sopenharmony_ci
5058c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(178, 0xbd0, 8, 0),
5068c2ecf20Sopenharmony_ci
5078c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(179, 0xbd0, 4, 0),
5088c2ecf20Sopenharmony_ci
5098c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(180, 0xbd0, 8, 0),
5108c2ecf20Sopenharmony_ci
5118c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(181, 0xbd0, 12, 0),
5128c2ecf20Sopenharmony_ci
5138c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(182, 0xbe0, 0, 0),
5148c2ecf20Sopenharmony_ci
5158c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(183, 0xbd0, 12, 0),
5168c2ecf20Sopenharmony_ci
5178c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(184, 0xbe0, 0, 0),
5188c2ecf20Sopenharmony_ci
5198c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(185, 0xbe0, 4, 0),
5208c2ecf20Sopenharmony_ci
5218c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(186, 0xbe0, 8, 0),
5228c2ecf20Sopenharmony_ci
5238c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(187, 0xbe0, 12, 0),
5248c2ecf20Sopenharmony_ci
5258c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(188, 0xbf0, 0, 0),
5268c2ecf20Sopenharmony_ci
5278c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(189, 0xbe0, 12, 0),
5288c2ecf20Sopenharmony_ci
5298c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(190, 0xbf0, 0, 0),
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(191, 0xbf0, 4, 0),
5328c2ecf20Sopenharmony_ci
5338c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(192, 0xbf0, 8, 0),
5348c2ecf20Sopenharmony_ci
5358c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(193, 0xbf0, 4, 0),
5368c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(194, 0xbf0, 4, 0),
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(195, 0xbf0, 8, 0),
5398c2ecf20Sopenharmony_ci
5408c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(196, 0xbf0, 12, 0),
5418c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(197, 0xbf0, 12, 0),
5428c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(198, 0xbf0, 12, 0),
5438c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(199, 0xbf0, 12, 0),
5448c2ecf20Sopenharmony_ci
5458c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(200, 0xc00, 0, 0),
5468c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(201, 0xc00, 0, 0),
5478c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(202, 0xc00, 0, 0),
5488c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(203, 0xc00, 0, 0),
5498c2ecf20Sopenharmony_ci
5508c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(204, 0xc00, 4, 0),
5518c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(205, 0xc00, 4, 0),
5528c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(206, 0xc00, 4, 0),
5538c2ecf20Sopenharmony_ci
5548c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(207, 0xc00, 8, 0),
5558c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(208, 0xc00, 8, 0),
5568c2ecf20Sopenharmony_ci	MTK_PIN_DRV_GRP(209, 0xc00, 8, 0),
5578c2ecf20Sopenharmony_ci};
5588c2ecf20Sopenharmony_ci
5598c2ecf20Sopenharmony_cistatic const struct mtk_pinctrl_devdata mt2712_pinctrl_data = {
5608c2ecf20Sopenharmony_ci	.pins = mtk_pins_mt2712,
5618c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(mtk_pins_mt2712),
5628c2ecf20Sopenharmony_ci	.grp_desc = mt2712_drv_grp,
5638c2ecf20Sopenharmony_ci	.n_grp_cls = ARRAY_SIZE(mt2712_drv_grp),
5648c2ecf20Sopenharmony_ci	.pin_drv_grp = mt2712_pin_drv,
5658c2ecf20Sopenharmony_ci	.n_pin_drv_grps = ARRAY_SIZE(mt2712_pin_drv),
5668c2ecf20Sopenharmony_ci	.spec_pull_set = mt2712_spec_pull_set,
5678c2ecf20Sopenharmony_ci	.spec_ies_smt_set = mt2712_ies_smt_set,
5688c2ecf20Sopenharmony_ci	.dir_offset = 0x0000,
5698c2ecf20Sopenharmony_ci	.pullen_offset = 0x0100,
5708c2ecf20Sopenharmony_ci	.pullsel_offset = 0x0200,
5718c2ecf20Sopenharmony_ci	.dout_offset = 0x0300,
5728c2ecf20Sopenharmony_ci	.din_offset = 0x0400,
5738c2ecf20Sopenharmony_ci	.pinmux_offset = 0x0500,
5748c2ecf20Sopenharmony_ci	.type1_start = 210,
5758c2ecf20Sopenharmony_ci	.type1_end = 210,
5768c2ecf20Sopenharmony_ci	.port_shf = 4,
5778c2ecf20Sopenharmony_ci	.port_mask = 0xf,
5788c2ecf20Sopenharmony_ci	.port_align = 4,
5798c2ecf20Sopenharmony_ci	.eint_hw = {
5808c2ecf20Sopenharmony_ci		.port_mask = 0xf,
5818c2ecf20Sopenharmony_ci		.ports     = 8,
5828c2ecf20Sopenharmony_ci		.ap_num    = 229,
5838c2ecf20Sopenharmony_ci		.db_cnt    = 40,
5848c2ecf20Sopenharmony_ci	},
5858c2ecf20Sopenharmony_ci};
5868c2ecf20Sopenharmony_ci
5878c2ecf20Sopenharmony_cistatic int mt2712_pinctrl_probe(struct platform_device *pdev)
5888c2ecf20Sopenharmony_ci{
5898c2ecf20Sopenharmony_ci	return mtk_pctrl_init(pdev, &mt2712_pinctrl_data, NULL);
5908c2ecf20Sopenharmony_ci}
5918c2ecf20Sopenharmony_ci
5928c2ecf20Sopenharmony_cistatic const struct of_device_id mt2712_pctrl_match[] = {
5938c2ecf20Sopenharmony_ci	{
5948c2ecf20Sopenharmony_ci		.compatible = "mediatek,mt2712-pinctrl",
5958c2ecf20Sopenharmony_ci	},
5968c2ecf20Sopenharmony_ci	{ }
5978c2ecf20Sopenharmony_ci};
5988c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(of, mt2712_pctrl_match);
5998c2ecf20Sopenharmony_ci
6008c2ecf20Sopenharmony_cistatic struct platform_driver mtk_pinctrl_driver = {
6018c2ecf20Sopenharmony_ci	.probe = mt2712_pinctrl_probe,
6028c2ecf20Sopenharmony_ci	.driver = {
6038c2ecf20Sopenharmony_ci		.name = "mediatek-mt2712-pinctrl",
6048c2ecf20Sopenharmony_ci		.of_match_table = mt2712_pctrl_match,
6058c2ecf20Sopenharmony_ci		.pm = &mtk_eint_pm_ops,
6068c2ecf20Sopenharmony_ci	},
6078c2ecf20Sopenharmony_ci};
6088c2ecf20Sopenharmony_ci
6098c2ecf20Sopenharmony_cistatic int __init mtk_pinctrl_init(void)
6108c2ecf20Sopenharmony_ci{
6118c2ecf20Sopenharmony_ci	return platform_driver_register(&mtk_pinctrl_driver);
6128c2ecf20Sopenharmony_ci}
6138c2ecf20Sopenharmony_ci
6148c2ecf20Sopenharmony_ciarch_initcall(mtk_pinctrl_init);
615