| xj | b04a402 | 2021-11-25 15:01:52 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * Copyright (C) 2019 MediaTek Inc. |
| 4 | * Author: Andy Teng <andy.teng@mediatek.com> |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include "pinctrl-mtk-mt6779.h" |
| 9 | #include "pinctrl-paris.h" |
| 10 | |
| 11 | /* MT6779 have multiple bases to program pin configuration listed as the below: |
| 12 | * gpio:0x10005000, iocfg_rm:0x11C20000, iocfg_br:0x11D10000, |
| 13 | * iocfg_lm:0x11E20000, iocfg_lb:0x11E70000, iocfg_rt:0x11EA0000, |
| 14 | * iocfg_lt:0x11F20000, iocfg_tl:0x11F30000 |
| 15 | * _i_based could be used to indicate what base the pin should be mapped into. |
| 16 | */ |
| 17 | |
| 18 | #define PIN_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \ |
| 19 | PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, \ |
| 20 | 32, 0) |
| 21 | |
| 22 | #define PINS_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \ |
| 23 | PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, \ |
| 24 | 32, 1) |
| 25 | |
| 26 | static const struct mtk_pin_field_calc mt6779_pin_mode_range[] = { |
| 27 | PIN_FIELD_BASE(0, 7, 0, 0x0300, 0x10, 0, 4), |
| 28 | PIN_FIELD_BASE(8, 15, 0, 0x0310, 0x10, 0, 4), |
| 29 | PIN_FIELD_BASE(16, 23, 0, 0x0320, 0x10, 0, 4), |
| 30 | PIN_FIELD_BASE(24, 31, 0, 0x0330, 0x10, 0, 4), |
| 31 | PIN_FIELD_BASE(32, 39, 0, 0x0340, 0x10, 0, 4), |
| 32 | PIN_FIELD_BASE(40, 47, 0, 0x0350, 0x10, 0, 4), |
| 33 | PIN_FIELD_BASE(48, 55, 0, 0x0360, 0x10, 0, 4), |
| 34 | PIN_FIELD_BASE(56, 63, 0, 0x0370, 0x10, 0, 4), |
| 35 | PIN_FIELD_BASE(64, 71, 0, 0x0380, 0x10, 0, 4), |
| 36 | PIN_FIELD_BASE(72, 79, 0, 0x0390, 0x10, 0, 4), |
| 37 | PIN_FIELD_BASE(80, 87, 0, 0x03A0, 0x10, 0, 4), |
| 38 | PIN_FIELD_BASE(88, 95, 0, 0x03B0, 0x10, 0, 4), |
| 39 | PIN_FIELD_BASE(96, 103, 0, 0x03C0, 0x10, 0, 4), |
| 40 | PIN_FIELD_BASE(104, 111, 0, 0x03D0, 0x10, 0, 4), |
| 41 | PIN_FIELD_BASE(112, 119, 0, 0x03E0, 0x10, 0, 4), |
| 42 | PIN_FIELD_BASE(120, 127, 0, 0x03F0, 0x10, 0, 4), |
| 43 | PIN_FIELD_BASE(128, 135, 0, 0x0400, 0x10, 0, 4), |
| 44 | PIN_FIELD_BASE(136, 143, 0, 0x0410, 0x10, 0, 4), |
| 45 | PIN_FIELD_BASE(144, 151, 0, 0x0420, 0x10, 0, 4), |
| 46 | PIN_FIELD_BASE(152, 159, 0, 0x0430, 0x10, 0, 4), |
| 47 | PIN_FIELD_BASE(160, 167, 0, 0x0440, 0x10, 0, 4), |
| 48 | PIN_FIELD_BASE(168, 175, 0, 0x0450, 0x10, 0, 4), |
| 49 | PIN_FIELD_BASE(176, 183, 0, 0x0460, 0x10, 0, 4), |
| 50 | PIN_FIELD_BASE(184, 191, 0, 0x0470, 0x10, 0, 4), |
| 51 | PIN_FIELD_BASE(192, 199, 0, 0x0480, 0x10, 0, 4), |
| 52 | PIN_FIELD_BASE(200, 202, 0, 0x0490, 0x10, 0, 4), |
| 53 | }; |
| 54 | |
| 55 | static const struct mtk_pin_field_calc mt6779_pin_dir_range[] = { |
| 56 | PIN_FIELD_BASE(0, 31, 0, 0x0000, 0x10, 0, 1), |
| 57 | PIN_FIELD_BASE(32, 63, 0, 0x0010, 0x10, 0, 1), |
| 58 | PIN_FIELD_BASE(64, 95, 0, 0x0020, 0x10, 0, 1), |
| 59 | PIN_FIELD_BASE(96, 127, 0, 0x0030, 0x10, 0, 1), |
| 60 | PIN_FIELD_BASE(128, 159, 0, 0x0040, 0x10, 0, 1), |
| 61 | PIN_FIELD_BASE(160, 191, 0, 0x0050, 0x10, 0, 1), |
| 62 | PIN_FIELD_BASE(192, 202, 0, 0x0060, 0x10, 0, 1), |
| 63 | }; |
| 64 | |
| 65 | static const struct mtk_pin_field_calc mt6779_pin_di_range[] = { |
| 66 | PIN_FIELD_BASE(0, 31, 0, 0x0200, 0x10, 0, 1), |
| 67 | PIN_FIELD_BASE(32, 63, 0, 0x0210, 0x10, 0, 1), |
| 68 | PIN_FIELD_BASE(64, 95, 0, 0x0220, 0x10, 0, 1), |
| 69 | PIN_FIELD_BASE(96, 127, 0, 0x0230, 0x10, 0, 1), |
| 70 | PIN_FIELD_BASE(128, 159, 0, 0x0240, 0x10, 0, 1), |
| 71 | PIN_FIELD_BASE(160, 191, 0, 0x0250, 0x10, 0, 1), |
| 72 | PIN_FIELD_BASE(192, 202, 0, 0x0260, 0x10, 0, 1), |
| 73 | }; |
| 74 | |
| 75 | static const struct mtk_pin_field_calc mt6779_pin_do_range[] = { |
| 76 | PIN_FIELD_BASE(0, 31, 0, 0x0100, 0x10, 0, 1), |
| 77 | PIN_FIELD_BASE(32, 63, 0, 0x0110, 0x10, 0, 1), |
| 78 | PIN_FIELD_BASE(64, 95, 0, 0x0120, 0x10, 0, 1), |
| 79 | PIN_FIELD_BASE(96, 127, 0, 0x0130, 0x10, 0, 1), |
| 80 | PIN_FIELD_BASE(128, 159, 0, 0x0140, 0x10, 0, 1), |
| 81 | PIN_FIELD_BASE(160, 191, 0, 0x0150, 0x10, 0, 1), |
| 82 | PIN_FIELD_BASE(192, 202, 0, 0x0160, 0x10, 0, 1), |
| 83 | }; |
| 84 | |
| 85 | static const struct mtk_pin_field_calc mt6779_pin_ies_range[] = { |
| 86 | PIN_FIELD_BASE(0, 9, 6, 0x0030, 0x10, 3, 1), |
| 87 | PIN_FIELD_BASE(10, 16, 3, 0x0050, 0x10, 0, 1), |
| 88 | PIN_FIELD_BASE(17, 18, 6, 0x0030, 0x10, 28, 1), |
| 89 | PIN_FIELD_BASE(19, 19, 6, 0x0030, 0x10, 27, 1), |
| 90 | PIN_FIELD_BASE(20, 20, 6, 0x0030, 0x10, 26, 1), |
| 91 | PIN_FIELD_BASE(21, 24, 6, 0x0030, 0x10, 19, 1), |
| 92 | PIN_FIELD_BASE(25, 25, 6, 0x0030, 0x10, 30, 1), |
| 93 | PIN_FIELD_BASE(26, 26, 6, 0x0030, 0x10, 23, 1), |
| 94 | PIN_FIELD_BASE(27, 27, 6, 0x0030, 0x10, 0, 1), |
| 95 | PIN_FIELD_BASE(28, 29, 6, 0x0030, 0x10, 24, 1), |
| 96 | PIN_FIELD_BASE(30, 30, 6, 0x0030, 0x10, 16, 1), |
| 97 | PIN_FIELD_BASE(31, 31, 6, 0x0030, 0x10, 13, 1), |
| 98 | PIN_FIELD_BASE(32, 32, 6, 0x0030, 0x10, 15, 1), |
| 99 | PIN_FIELD_BASE(33, 33, 6, 0x0030, 0x10, 17, 1), |
| 100 | PIN_FIELD_BASE(34, 34, 6, 0x0030, 0x10, 14, 1), |
| 101 | PIN_FIELD_BASE(35, 35, 6, 0x0040, 0x10, 4, 1), |
| 102 | PIN_FIELD_BASE(36, 36, 6, 0x0030, 0x10, 31, 1), |
| 103 | PIN_FIELD_BASE(37, 37, 6, 0x0040, 0x10, 5, 1), |
| 104 | PIN_FIELD_BASE(38, 41, 6, 0x0040, 0x10, 0, 1), |
| 105 | PIN_FIELD_BASE(42, 43, 6, 0x0030, 0x10, 1, 1), |
| 106 | PIN_FIELD_BASE(44, 44, 6, 0x0030, 0x10, 18, 1), |
| 107 | PIN_FIELD_BASE(45, 45, 3, 0x0050, 0x10, 14, 1), |
| 108 | PIN_FIELD_BASE(46, 46, 3, 0x0050, 0x10, 22, 1), |
| 109 | PIN_FIELD_BASE(47, 47, 3, 0x0050, 0x10, 25, 1), |
| 110 | PIN_FIELD_BASE(48, 48, 3, 0x0050, 0x10, 24, 1), |
| 111 | PIN_FIELD_BASE(49, 49, 3, 0x0050, 0x10, 26, 1), |
| 112 | PIN_FIELD_BASE(50, 50, 3, 0x0050, 0x10, 23, 1), |
| 113 | PIN_FIELD_BASE(51, 51, 3, 0x0050, 0x10, 11, 1), |
| 114 | PIN_FIELD_BASE(52, 52, 3, 0x0050, 0x10, 19, 1), |
| 115 | PIN_FIELD_BASE(53, 54, 3, 0x0050, 0x10, 27, 1), |
| 116 | PIN_FIELD_BASE(55, 55, 3, 0x0050, 0x10, 13, 1), |
| 117 | PIN_FIELD_BASE(56, 56, 3, 0x0050, 0x10, 21, 1), |
| 118 | PIN_FIELD_BASE(57, 57, 3, 0x0050, 0x10, 10, 1), |
| 119 | PIN_FIELD_BASE(58, 58, 3, 0x0050, 0x10, 9, 1), |
| 120 | PIN_FIELD_BASE(59, 60, 3, 0x0050, 0x10, 7, 1), |
| 121 | PIN_FIELD_BASE(61, 61, 3, 0x0050, 0x10, 12, 1), |
| 122 | PIN_FIELD_BASE(62, 62, 3, 0x0050, 0x10, 20, 1), |
| 123 | PIN_FIELD_BASE(63, 63, 3, 0x0050, 0x10, 17, 1), |
| 124 | PIN_FIELD_BASE(64, 64, 3, 0x0050, 0x10, 16, 1), |
| 125 | PIN_FIELD_BASE(65, 65, 3, 0x0050, 0x10, 18, 1), |
| 126 | PIN_FIELD_BASE(66, 66, 3, 0x0050, 0x10, 15, 1), |
| 127 | PIN_FIELD_BASE(67, 67, 2, 0x0060, 0x10, 7, 1), |
| 128 | PIN_FIELD_BASE(68, 68, 2, 0x0060, 0x10, 6, 1), |
| 129 | PIN_FIELD_BASE(69, 69, 2, 0x0060, 0x10, 8, 1), |
| 130 | PIN_FIELD_BASE(70, 71, 2, 0x0060, 0x10, 4, 1), |
| 131 | PIN_FIELD_BASE(72, 72, 4, 0x0020, 0x10, 3, 1), |
| 132 | PIN_FIELD_BASE(73, 73, 4, 0x0020, 0x10, 2, 1), |
| 133 | PIN_FIELD_BASE(74, 74, 4, 0x0020, 0x10, 1, 1), |
| 134 | PIN_FIELD_BASE(75, 75, 4, 0x0020, 0x10, 4, 1), |
| 135 | PIN_FIELD_BASE(76, 76, 4, 0x0020, 0x10, 12, 1), |
| 136 | PIN_FIELD_BASE(77, 77, 4, 0x0020, 0x10, 11, 1), |
| 137 | PIN_FIELD_BASE(78, 78, 2, 0x0050, 0x10, 18, 1), |
| 138 | PIN_FIELD_BASE(79, 79, 2, 0x0050, 0x10, 17, 1), |
| 139 | PIN_FIELD_BASE(80, 81, 2, 0x0050, 0x10, 19, 1), |
| 140 | PIN_FIELD_BASE(82, 88, 2, 0x0050, 0x10, 1, 1), |
| 141 | PIN_FIELD_BASE(89, 89, 2, 0x0050, 0x10, 16, 1), |
| 142 | PIN_FIELD_BASE(90, 90, 2, 0x0050, 0x10, 15, 1), |
| 143 | PIN_FIELD_BASE(91, 91, 2, 0x0050, 0x10, 14, 1), |
| 144 | PIN_FIELD_BASE(92, 92, 2, 0x0050, 0x10, 8, 1), |
| 145 | PIN_FIELD_BASE(93, 93, 4, 0x0020, 0x10, 0, 1), |
| 146 | PIN_FIELD_BASE(94, 94, 2, 0x0050, 0x10, 0, 1), |
| 147 | PIN_FIELD_BASE(95, 95, 4, 0x0020, 0x10, 7, 1), |
| 148 | PIN_FIELD_BASE(96, 96, 4, 0x0020, 0x10, 5, 1), |
| 149 | PIN_FIELD_BASE(97, 97, 4, 0x0020, 0x10, 8, 1), |
| 150 | PIN_FIELD_BASE(98, 98, 4, 0x0020, 0x10, 6, 1), |
| 151 | PIN_FIELD_BASE(99, 99, 2, 0x0060, 0x10, 9, 1), |
| 152 | PIN_FIELD_BASE(100, 100, 2, 0x0060, 0x10, 12, 1), |
| 153 | PIN_FIELD_BASE(101, 101, 2, 0x0060, 0x10, 10, 1), |
| 154 | PIN_FIELD_BASE(102, 102, 2, 0x0060, 0x10, 13, 1), |
| 155 | PIN_FIELD_BASE(103, 103, 2, 0x0060, 0x10, 11, 1), |
| 156 | PIN_FIELD_BASE(104, 104, 2, 0x0060, 0x10, 14, 1), |
| 157 | PIN_FIELD_BASE(105, 105, 2, 0x0050, 0x10, 10, 1), |
| 158 | PIN_FIELD_BASE(106, 106, 2, 0x0050, 0x10, 9, 1), |
| 159 | PIN_FIELD_BASE(107, 108, 2, 0x0050, 0x10, 12, 1), |
| 160 | PIN_FIELD_BASE(109, 109, 2, 0x0050, 0x10, 11, 1), |
| 161 | PIN_FIELD_BASE(110, 110, 2, 0x0060, 0x10, 16, 1), |
| 162 | PIN_FIELD_BASE(111, 111, 2, 0x0060, 0x10, 18, 1), |
| 163 | PIN_FIELD_BASE(112, 112, 2, 0x0060, 0x10, 15, 1), |
| 164 | PIN_FIELD_BASE(113, 113, 2, 0x0060, 0x10, 17, 1), |
| 165 | PIN_FIELD_BASE(114, 115, 2, 0x0050, 0x10, 26, 1), |
| 166 | PIN_FIELD_BASE(116, 117, 2, 0x0050, 0x10, 21, 1), |
| 167 | PIN_FIELD_BASE(118, 118, 2, 0x0050, 0x10, 31, 1), |
| 168 | PIN_FIELD_BASE(119, 119, 2, 0x0060, 0x10, 0, 1), |
| 169 | PIN_FIELD_BASE(120, 121, 2, 0x0050, 0x10, 23, 1), |
| 170 | PIN_FIELD_BASE(122, 123, 2, 0x0050, 0x10, 28, 1), |
| 171 | PIN_FIELD_BASE(124, 125, 2, 0x0060, 0x10, 1, 1), |
| 172 | PIN_FIELD_BASE(126, 127, 1, 0x0030, 0x10, 8, 1), |
| 173 | PIN_FIELD_BASE(128, 129, 1, 0x0030, 0x10, 17, 1), |
| 174 | PIN_FIELD_BASE(130, 130, 1, 0x0030, 0x10, 16, 1), |
| 175 | PIN_FIELD_BASE(131, 131, 1, 0x0030, 0x10, 19, 1), |
| 176 | PIN_FIELD_BASE(132, 132, 1, 0x0030, 0x10, 21, 1), |
| 177 | PIN_FIELD_BASE(133, 133, 1, 0x0030, 0x10, 20, 1), |
| 178 | PIN_FIELD_BASE(134, 135, 1, 0x0030, 0x10, 2, 1), |
| 179 | PIN_FIELD_BASE(136, 136, 1, 0x0030, 0x10, 7, 1), |
| 180 | PIN_FIELD_BASE(137, 137, 1, 0x0030, 0x10, 4, 1), |
| 181 | PIN_FIELD_BASE(138, 138, 1, 0x0030, 0x10, 6, 1), |
| 182 | PIN_FIELD_BASE(139, 139, 1, 0x0030, 0x10, 5, 1), |
| 183 | PIN_FIELD_BASE(140, 141, 1, 0x0030, 0x10, 0, 1), |
| 184 | PIN_FIELD_BASE(142, 142, 1, 0x0030, 0x10, 15, 1), |
| 185 | PIN_FIELD_BASE(143, 143, 5, 0x0020, 0x10, 15, 1), |
| 186 | PIN_FIELD_BASE(144, 144, 5, 0x0020, 0x10, 17, 1), |
| 187 | PIN_FIELD_BASE(145, 145, 5, 0x0020, 0x10, 16, 1), |
| 188 | PIN_FIELD_BASE(146, 146, 5, 0x0020, 0x10, 12, 1), |
| 189 | PIN_FIELD_BASE(147, 155, 5, 0x0020, 0x10, 0, 1), |
| 190 | PIN_FIELD_BASE(156, 157, 5, 0x0020, 0x10, 22, 1), |
| 191 | PIN_FIELD_BASE(158, 158, 5, 0x0020, 0x10, 21, 1), |
| 192 | PIN_FIELD_BASE(159, 159, 5, 0x0020, 0x10, 24, 1), |
| 193 | PIN_FIELD_BASE(160, 161, 5, 0x0020, 0x10, 19, 1), |
| 194 | PIN_FIELD_BASE(162, 166, 5, 0x0020, 0x10, 25, 1), |
| 195 | PIN_FIELD_BASE(167, 168, 7, 0x0010, 0x10, 1, 1), |
| 196 | PIN_FIELD_BASE(169, 169, 7, 0x0010, 0x10, 4, 1), |
| 197 | PIN_FIELD_BASE(170, 170, 7, 0x0010, 0x10, 6, 1), |
| 198 | PIN_FIELD_BASE(171, 171, 7, 0x0010, 0x10, 8, 1), |
| 199 | PIN_FIELD_BASE(172, 172, 7, 0x0010, 0x10, 3, 1), |
| 200 | PIN_FIELD_BASE(173, 173, 7, 0x0010, 0x10, 7, 1), |
| 201 | PIN_FIELD_BASE(174, 175, 7, 0x0010, 0x10, 9, 1), |
| 202 | PIN_FIELD_BASE(176, 176, 7, 0x0010, 0x10, 0, 1), |
| 203 | PIN_FIELD_BASE(177, 177, 7, 0x0010, 0x10, 5, 1), |
| 204 | PIN_FIELD_BASE(178, 178, 7, 0x0010, 0x10, 11, 1), |
| 205 | PIN_FIELD_BASE(179, 179, 4, 0x0020, 0x10, 13, 1), |
| 206 | PIN_FIELD_BASE(180, 180, 4, 0x0020, 0x10, 10, 1), |
| 207 | PIN_FIELD_BASE(181, 183, 1, 0x0030, 0x10, 22, 1), |
| 208 | PIN_FIELD_BASE(184, 184, 1, 0x0030, 0x10, 12, 1), |
| 209 | PIN_FIELD_BASE(185, 185, 1, 0x0030, 0x10, 11, 1), |
| 210 | PIN_FIELD_BASE(186, 186, 1, 0x0030, 0x10, 13, 1), |
| 211 | PIN_FIELD_BASE(187, 187, 1, 0x0030, 0x10, 10, 1), |
| 212 | PIN_FIELD_BASE(188, 188, 1, 0x0030, 0x10, 14, 1), |
| 213 | PIN_FIELD_BASE(189, 189, 5, 0x0020, 0x10, 9, 1), |
| 214 | PIN_FIELD_BASE(190, 190, 5, 0x0020, 0x10, 18, 1), |
| 215 | PIN_FIELD_BASE(191, 192, 5, 0x0020, 0x10, 13, 1), |
| 216 | PIN_FIELD_BASE(193, 194, 5, 0x0020, 0x10, 10, 1), |
| 217 | PIN_FIELD_BASE(195, 195, 2, 0x0050, 0x10, 30, 1), |
| 218 | PIN_FIELD_BASE(196, 196, 2, 0x0050, 0x10, 25, 1), |
| 219 | PIN_FIELD_BASE(197, 197, 2, 0x0060, 0x10, 3, 1), |
| 220 | PIN_FIELD_BASE(198, 199, 4, 0x0020, 0x10, 14, 1), |
| 221 | PIN_FIELD_BASE(200, 201, 6, 0x0040, 0x10, 6, 1), |
| 222 | PIN_FIELD_BASE(202, 202, 4, 0x0020, 0x10, 9, 1), |
| 223 | }; |
| 224 | |
| 225 | static const struct mtk_pin_field_calc mt6779_pin_smt_range[] = { |
| 226 | PINS_FIELD_BASE(0, 9, 6, 0x00c0, 0x10, 3, 1), |
| 227 | PIN_FIELD_BASE(10, 11, 3, 0x00e0, 0x10, 0, 1), |
| 228 | PINS_FIELD_BASE(12, 15, 3, 0x00e0, 0x10, 2, 1), |
| 229 | PIN_FIELD_BASE(16, 16, 3, 0x00e0, 0x10, 3, 1), |
| 230 | PINS_FIELD_BASE(17, 20, 6, 0x00c0, 0x10, 11, 1), |
| 231 | PINS_FIELD_BASE(21, 24, 6, 0x00c0, 0x10, 7, 1), |
| 232 | PIN_FIELD_BASE(25, 25, 6, 0x00c0, 0x10, 12, 1), |
| 233 | PIN_FIELD_BASE(26, 26, 6, 0x00c0, 0x10, 8, 1), |
| 234 | PIN_FIELD_BASE(27, 27, 6, 0x00c0, 0x10, 0, 1), |
| 235 | PIN_FIELD_BASE(28, 29, 6, 0x00c0, 0x10, 9, 1), |
| 236 | PINS_FIELD_BASE(30, 32, 6, 0x00c0, 0x10, 4, 1), |
| 237 | PIN_FIELD_BASE(33, 33, 6, 0x00c0, 0x10, 5, 1), |
| 238 | PIN_FIELD_BASE(34, 34, 6, 0x00c0, 0x10, 4, 1), |
| 239 | PINS_FIELD_BASE(35, 41, 6, 0x00c0, 0x10, 13, 1), |
| 240 | PIN_FIELD_BASE(42, 43, 6, 0x00c0, 0x10, 1, 1), |
| 241 | PIN_FIELD_BASE(44, 44, 6, 0x00c0, 0x10, 6, 1), |
| 242 | PIN_FIELD_BASE(45, 45, 3, 0x00e0, 0x10, 8, 1), |
| 243 | PIN_FIELD_BASE(46, 46, 3, 0x00e0, 0x10, 13, 1), |
| 244 | PINS_FIELD_BASE(47, 50, 3, 0x00e0, 0x10, 14, 1), |
| 245 | PIN_FIELD_BASE(51, 51, 3, 0x00e0, 0x10, 5, 1), |
| 246 | PIN_FIELD_BASE(52, 52, 3, 0x00e0, 0x10, 10, 1), |
| 247 | PIN_FIELD_BASE(53, 54, 3, 0x00e0, 0x10, 15, 1), |
| 248 | PIN_FIELD_BASE(55, 55, 3, 0x00e0, 0x10, 7, 1), |
| 249 | PIN_FIELD_BASE(56, 56, 3, 0x00e0, 0x10, 12, 1), |
| 250 | PINS_FIELD_BASE(57, 60, 3, 0x00e0, 0x10, 4, 1), |
| 251 | PIN_FIELD_BASE(61, 61, 3, 0x00e0, 0x10, 6, 1), |
| 252 | PIN_FIELD_BASE(62, 62, 3, 0x00e0, 0x10, 11, 1), |
| 253 | PINS_FIELD_BASE(63, 66, 3, 0x00e0, 0x10, 9, 1), |
| 254 | PINS_FIELD_BASE(67, 69, 2, 0x00e0, 0x10, 11, 1), |
| 255 | PIN_FIELD_BASE(70, 71, 2, 0x00e0, 0x10, 10, 1), |
| 256 | PINS_FIELD_BASE(72, 75, 4, 0x0070, 0x10, 1, 1), |
| 257 | PINS_FIELD_BASE(76, 77, 4, 0x0070, 0x10, 4, 1), |
| 258 | PINS_FIELD_BASE(78, 86, 2, 0x00e0, 0x10, 1, 1), |
| 259 | PINS_FIELD_BASE(87, 92, 2, 0x00e0, 0x10, 2, 1), |
| 260 | PIN_FIELD_BASE(93, 93, 4, 0x0070, 0x10, 0, 1), |
| 261 | PIN_FIELD_BASE(94, 94, 2, 0x00e0, 0x10, 2, 1), |
| 262 | PINS_FIELD_BASE(95, 98, 4, 0x0070, 0x10, 2, 1), |
| 263 | PINS_FIELD_BASE(99, 104, 2, 0x00e0, 0x10, 12, 1), |
| 264 | PINS_FIELD_BASE(105, 109, 2, 0x00e0, 0x10, 0, 1), |
| 265 | PIN_FIELD_BASE(110, 110, 2, 0x00e0, 0x10, 14, 1), |
| 266 | PIN_FIELD_BASE(111, 111, 2, 0x00e0, 0x10, 16, 1), |
| 267 | PIN_FIELD_BASE(112, 112, 2, 0x00e0, 0x10, 13, 1), |
| 268 | PIN_FIELD_BASE(113, 113, 2, 0x00e0, 0x10, 15, 1), |
| 269 | PINS_FIELD_BASE(114, 115, 2, 0x00e0, 0x10, 4, 1), |
| 270 | PIN_FIELD_BASE(116, 117, 2, 0x00e0, 0x10, 5, 1), |
| 271 | PINS_FIELD_BASE(118, 119, 2, 0x00e0, 0x10, 4, 1), |
| 272 | PIN_FIELD_BASE(120, 121, 2, 0x00e0, 0x10, 7, 1), |
| 273 | PINS_FIELD_BASE(122, 125, 2, 0x00e0, 0x10, 3, 1), |
| 274 | PINS_FIELD_BASE(126, 127, 1, 0x00c0, 0x10, 5, 1), |
| 275 | PINS_FIELD_BASE(128, 130, 1, 0x00c0, 0x10, 9, 1), |
| 276 | PINS_FIELD_BASE(131, 133, 1, 0x00c0, 0x10, 10, 1), |
| 277 | PIN_FIELD_BASE(134, 135, 1, 0x00c0, 0x10, 2, 1), |
| 278 | PINS_FIELD_BASE(136, 139, 1, 0x00c0, 0x10, 4, 1), |
| 279 | PIN_FIELD_BASE(140, 141, 1, 0x00c0, 0x10, 0, 1), |
| 280 | PIN_FIELD_BASE(142, 142, 1, 0x00c0, 0x10, 8, 1), |
| 281 | PINS_FIELD_BASE(143, 146, 5, 0x0060, 0x10, 1, 1), |
| 282 | PINS_FIELD_BASE(147, 155, 5, 0x0060, 0x10, 0, 1), |
| 283 | PIN_FIELD_BASE(156, 157, 5, 0x0060, 0x10, 6, 1), |
| 284 | PIN_FIELD_BASE(158, 158, 5, 0x0060, 0x10, 5, 1), |
| 285 | PIN_FIELD_BASE(159, 159, 5, 0x0060, 0x10, 8, 1), |
| 286 | PIN_FIELD_BASE(160, 161, 5, 0x0060, 0x10, 3, 1), |
| 287 | PINS_FIELD_BASE(162, 166, 5, 0x0060, 0x10, 2, 1), |
| 288 | PIN_FIELD_BASE(167, 167, 7, 0x0060, 0x10, 1, 1), |
| 289 | PINS_FIELD_BASE(168, 174, 7, 0x0060, 0x10, 2, 1), |
| 290 | PIN_FIELD_BASE(175, 175, 7, 0x0060, 0x10, 3, 1), |
| 291 | PIN_FIELD_BASE(176, 176, 7, 0x0060, 0x10, 0, 1), |
| 292 | PINS_FIELD_BASE(177, 178, 7, 0x0060, 0x10, 2, 1), |
| 293 | PINS_FIELD_BASE(179, 180, 4, 0x0070, 0x10, 4, 1), |
| 294 | PIN_FIELD_BASE(181, 183, 1, 0x00c0, 0x10, 11, 1), |
| 295 | PINS_FIELD_BASE(184, 187, 1, 0x00c0, 0x10, 6, 1), |
| 296 | PIN_FIELD_BASE(188, 188, 1, 0x00c0, 0x10, 7, 1), |
| 297 | PINS_FIELD_BASE(189, 194, 5, 0x0060, 0x10, 1, 1), |
| 298 | PIN_FIELD_BASE(195, 195, 2, 0x00e0, 0x10, 3, 1), |
| 299 | PIN_FIELD_BASE(196, 196, 2, 0x00e0, 0x10, 9, 1), |
| 300 | PIN_FIELD_BASE(197, 197, 2, 0x00e0, 0x10, 3, 1), |
| 301 | PIN_FIELD_BASE(198, 199, 4, 0x0070, 0x10, 5, 1), |
| 302 | PIN_FIELD_BASE(200, 201, 6, 0x00c0, 0x10, 14, 1), |
| 303 | PIN_FIELD_BASE(202, 202, 4, 0x0070, 0x10, 3, 1), |
| 304 | }; |
| 305 | |
| 306 | static const struct mtk_pin_field_calc mt6779_pin_pu_range[] = { |
| 307 | PIN_FIELD_BASE(0, 9, 6, 0x0070, 0x10, 3, 1), |
| 308 | PIN_FIELD_BASE(16, 16, 3, 0x0080, 0x10, 0, 1), |
| 309 | PIN_FIELD_BASE(17, 18, 6, 0x0070, 0x10, 28, 1), |
| 310 | PIN_FIELD_BASE(19, 19, 6, 0x0070, 0x10, 27, 1), |
| 311 | PIN_FIELD_BASE(20, 20, 6, 0x0070, 0x10, 26, 1), |
| 312 | PIN_FIELD_BASE(21, 24, 6, 0x0070, 0x10, 19, 1), |
| 313 | PIN_FIELD_BASE(25, 25, 6, 0x0070, 0x10, 30, 1), |
| 314 | PIN_FIELD_BASE(26, 26, 6, 0x0070, 0x10, 23, 1), |
| 315 | PIN_FIELD_BASE(27, 27, 6, 0x0070, 0x10, 0, 1), |
| 316 | PIN_FIELD_BASE(28, 29, 6, 0x0070, 0x10, 24, 1), |
| 317 | PIN_FIELD_BASE(30, 30, 6, 0x0070, 0x10, 16, 1), |
| 318 | PIN_FIELD_BASE(31, 31, 6, 0x0070, 0x10, 13, 1), |
| 319 | PIN_FIELD_BASE(32, 32, 6, 0x0070, 0x10, 15, 1), |
| 320 | PIN_FIELD_BASE(33, 33, 6, 0x0070, 0x10, 17, 1), |
| 321 | PIN_FIELD_BASE(34, 34, 6, 0x0070, 0x10, 14, 1), |
| 322 | PIN_FIELD_BASE(35, 35, 6, 0x0080, 0x10, 5, 1), |
| 323 | PIN_FIELD_BASE(36, 36, 6, 0x0080, 0x10, 0, 1), |
| 324 | PIN_FIELD_BASE(37, 37, 6, 0x0080, 0x10, 6, 1), |
| 325 | PIN_FIELD_BASE(38, 41, 6, 0x0080, 0x10, 1, 1), |
| 326 | PIN_FIELD_BASE(42, 43, 6, 0x0070, 0x10, 1, 1), |
| 327 | PIN_FIELD_BASE(44, 44, 6, 0x0070, 0x10, 18, 1), |
| 328 | PIN_FIELD_BASE(45, 45, 3, 0x0080, 0x10, 4, 1), |
| 329 | PIN_FIELD_BASE(46, 46, 3, 0x0080, 0x10, 12, 1), |
| 330 | PIN_FIELD_BASE(47, 47, 3, 0x0080, 0x10, 15, 1), |
| 331 | PIN_FIELD_BASE(48, 48, 3, 0x0080, 0x10, 14, 1), |
| 332 | PIN_FIELD_BASE(49, 49, 3, 0x0080, 0x10, 16, 1), |
| 333 | PIN_FIELD_BASE(50, 50, 3, 0x0080, 0x10, 13, 1), |
| 334 | PIN_FIELD_BASE(51, 51, 3, 0x0080, 0x10, 1, 1), |
| 335 | PIN_FIELD_BASE(52, 52, 3, 0x0080, 0x10, 9, 1), |
| 336 | PIN_FIELD_BASE(53, 54, 3, 0x0080, 0x10, 18, 1), |
| 337 | PIN_FIELD_BASE(55, 55, 3, 0x0080, 0x10, 3, 1), |
| 338 | PIN_FIELD_BASE(56, 56, 3, 0x0080, 0x10, 11, 1), |
| 339 | PIN_FIELD_BASE(61, 61, 3, 0x0080, 0x10, 2, 1), |
| 340 | PIN_FIELD_BASE(62, 62, 3, 0x0080, 0x10, 10, 1), |
| 341 | PIN_FIELD_BASE(63, 63, 3, 0x0080, 0x10, 7, 1), |
| 342 | PIN_FIELD_BASE(64, 64, 3, 0x0080, 0x10, 6, 1), |
| 343 | PIN_FIELD_BASE(65, 65, 3, 0x0080, 0x10, 8, 1), |
| 344 | PIN_FIELD_BASE(66, 66, 3, 0x0080, 0x10, 5, 1), |
| 345 | PIN_FIELD_BASE(67, 67, 2, 0x00a0, 0x10, 7, 1), |
| 346 | PIN_FIELD_BASE(68, 68, 2, 0x00a0, 0x10, 6, 1), |
| 347 | PIN_FIELD_BASE(69, 69, 2, 0x00a0, 0x10, 8, 1), |
| 348 | PIN_FIELD_BASE(70, 71, 2, 0x00a0, 0x10, 4, 1), |
| 349 | PIN_FIELD_BASE(72, 72, 4, 0x0040, 0x10, 3, 1), |
| 350 | PIN_FIELD_BASE(73, 73, 4, 0x0040, 0x10, 2, 1), |
| 351 | PIN_FIELD_BASE(74, 74, 4, 0x0040, 0x10, 1, 1), |
| 352 | PIN_FIELD_BASE(75, 75, 4, 0x0040, 0x10, 4, 1), |
| 353 | PIN_FIELD_BASE(76, 76, 4, 0x0040, 0x10, 12, 1), |
| 354 | PIN_FIELD_BASE(77, 77, 4, 0x0040, 0x10, 11, 1), |
| 355 | PIN_FIELD_BASE(78, 78, 2, 0x0090, 0x10, 18, 1), |
| 356 | PIN_FIELD_BASE(79, 79, 2, 0x0090, 0x10, 17, 1), |
| 357 | PIN_FIELD_BASE(80, 81, 2, 0x0090, 0x10, 19, 1), |
| 358 | PIN_FIELD_BASE(82, 88, 2, 0x0090, 0x10, 1, 1), |
| 359 | PIN_FIELD_BASE(89, 89, 2, 0x0090, 0x10, 16, 1), |
| 360 | PIN_FIELD_BASE(90, 90, 2, 0x0090, 0x10, 15, 1), |
| 361 | PIN_FIELD_BASE(91, 91, 2, 0x0090, 0x10, 14, 1), |
| 362 | PIN_FIELD_BASE(92, 92, 2, 0x0090, 0x10, 8, 1), |
| 363 | PIN_FIELD_BASE(93, 93, 4, 0x0040, 0x10, 0, 1), |
| 364 | PIN_FIELD_BASE(94, 94, 2, 0x0090, 0x10, 0, 1), |
| 365 | PIN_FIELD_BASE(95, 95, 4, 0x0040, 0x10, 7, 1), |
| 366 | PIN_FIELD_BASE(96, 96, 4, 0x0040, 0x10, 5, 1), |
| 367 | PIN_FIELD_BASE(97, 97, 4, 0x0040, 0x10, 8, 1), |
| 368 | PIN_FIELD_BASE(98, 98, 4, 0x0040, 0x10, 6, 1), |
| 369 | PIN_FIELD_BASE(99, 99, 2, 0x00a0, 0x10, 9, 1), |
| 370 | PIN_FIELD_BASE(100, 100, 2, 0x00a0, 0x10, 12, 1), |
| 371 | PIN_FIELD_BASE(101, 101, 2, 0x00a0, 0x10, 10, 1), |
| 372 | PIN_FIELD_BASE(102, 102, 2, 0x00a0, 0x10, 13, 1), |
| 373 | PIN_FIELD_BASE(103, 103, 2, 0x00a0, 0x10, 11, 1), |
| 374 | PIN_FIELD_BASE(104, 104, 2, 0x00a0, 0x10, 14, 1), |
| 375 | PIN_FIELD_BASE(105, 105, 2, 0x0090, 0x10, 10, 1), |
| 376 | PIN_FIELD_BASE(106, 106, 2, 0x0090, 0x10, 9, 1), |
| 377 | PIN_FIELD_BASE(107, 108, 2, 0x0090, 0x10, 12, 1), |
| 378 | PIN_FIELD_BASE(109, 109, 2, 0x0090, 0x10, 11, 1), |
| 379 | PIN_FIELD_BASE(110, 110, 2, 0x00a0, 0x10, 16, 1), |
| 380 | PIN_FIELD_BASE(111, 111, 2, 0x00a0, 0x10, 18, 1), |
| 381 | PIN_FIELD_BASE(112, 112, 2, 0x00a0, 0x10, 15, 1), |
| 382 | PIN_FIELD_BASE(113, 113, 2, 0x00a0, 0x10, 17, 1), |
| 383 | PIN_FIELD_BASE(114, 115, 2, 0x0090, 0x10, 26, 1), |
| 384 | PIN_FIELD_BASE(116, 117, 2, 0x0090, 0x10, 21, 1), |
| 385 | PIN_FIELD_BASE(118, 118, 2, 0x0090, 0x10, 31, 1), |
| 386 | PIN_FIELD_BASE(119, 119, 2, 0x00a0, 0x10, 0, 1), |
| 387 | PIN_FIELD_BASE(120, 121, 2, 0x0090, 0x10, 23, 1), |
| 388 | PIN_FIELD_BASE(122, 123, 2, 0x0090, 0x10, 28, 1), |
| 389 | PIN_FIELD_BASE(124, 125, 2, 0x00a0, 0x10, 1, 1), |
| 390 | PIN_FIELD_BASE(126, 127, 1, 0x0070, 0x10, 2, 1), |
| 391 | PIN_FIELD_BASE(140, 141, 1, 0x0070, 0x10, 0, 1), |
| 392 | PIN_FIELD_BASE(142, 142, 1, 0x0070, 0x10, 9, 1), |
| 393 | PIN_FIELD_BASE(143, 143, 5, 0x0040, 0x10, 15, 1), |
| 394 | PIN_FIELD_BASE(144, 144, 5, 0x0040, 0x10, 17, 1), |
| 395 | PIN_FIELD_BASE(145, 145, 5, 0x0040, 0x10, 16, 1), |
| 396 | PIN_FIELD_BASE(146, 146, 5, 0x0040, 0x10, 12, 1), |
| 397 | PIN_FIELD_BASE(147, 155, 5, 0x0040, 0x10, 0, 1), |
| 398 | PIN_FIELD_BASE(156, 157, 5, 0x0040, 0x10, 22, 1), |
| 399 | PIN_FIELD_BASE(158, 158, 5, 0x0040, 0x10, 21, 1), |
| 400 | PIN_FIELD_BASE(159, 159, 5, 0x0040, 0x10, 24, 1), |
| 401 | PIN_FIELD_BASE(160, 161, 5, 0x0040, 0x10, 19, 1), |
| 402 | PIN_FIELD_BASE(162, 166, 5, 0x0040, 0x10, 25, 1), |
| 403 | PIN_FIELD_BASE(179, 179, 4, 0x0040, 0x10, 13, 1), |
| 404 | PIN_FIELD_BASE(180, 180, 4, 0x0040, 0x10, 10, 1), |
| 405 | PIN_FIELD_BASE(181, 183, 1, 0x0070, 0x10, 10, 1), |
| 406 | PIN_FIELD_BASE(184, 184, 1, 0x0070, 0x10, 6, 1), |
| 407 | PIN_FIELD_BASE(185, 185, 1, 0x0070, 0x10, 5, 1), |
| 408 | PIN_FIELD_BASE(186, 186, 1, 0x0070, 0x10, 7, 1), |
| 409 | PIN_FIELD_BASE(187, 187, 1, 0x0070, 0x10, 4, 1), |
| 410 | PIN_FIELD_BASE(188, 188, 1, 0x0070, 0x10, 8, 1), |
| 411 | PIN_FIELD_BASE(189, 189, 5, 0x0040, 0x10, 9, 1), |
| 412 | PIN_FIELD_BASE(190, 190, 5, 0x0040, 0x10, 18, 1), |
| 413 | PIN_FIELD_BASE(191, 192, 5, 0x0040, 0x10, 13, 1), |
| 414 | PIN_FIELD_BASE(193, 194, 5, 0x0040, 0x10, 10, 1), |
| 415 | PIN_FIELD_BASE(195, 195, 2, 0x0090, 0x10, 30, 1), |
| 416 | PIN_FIELD_BASE(196, 196, 2, 0x0090, 0x10, 25, 1), |
| 417 | PIN_FIELD_BASE(197, 197, 2, 0x00a0, 0x10, 3, 1), |
| 418 | PIN_FIELD_BASE(198, 199, 4, 0x0040, 0x10, 14, 1), |
| 419 | PIN_FIELD_BASE(200, 201, 6, 0x0080, 0x10, 7, 1), |
| 420 | PIN_FIELD_BASE(202, 202, 4, 0x0040, 0x10, 9, 1), |
| 421 | }; |
| 422 | |
| 423 | static const struct mtk_pin_field_calc mt6779_pin_pd_range[] = { |
| 424 | PIN_FIELD_BASE(0, 9, 6, 0x0050, 0x10, 3, 1), |
| 425 | PIN_FIELD_BASE(16, 16, 3, 0x0060, 0x10, 0, 1), |
| 426 | PIN_FIELD_BASE(17, 18, 6, 0x0050, 0x10, 28, 1), |
| 427 | PIN_FIELD_BASE(19, 19, 6, 0x0050, 0x10, 27, 1), |
| 428 | PIN_FIELD_BASE(20, 20, 6, 0x0050, 0x10, 26, 1), |
| 429 | PIN_FIELD_BASE(21, 24, 6, 0x0050, 0x10, 19, 1), |
| 430 | PIN_FIELD_BASE(25, 25, 6, 0x0050, 0x10, 30, 1), |
| 431 | PIN_FIELD_BASE(26, 26, 6, 0x0050, 0x10, 23, 1), |
| 432 | PIN_FIELD_BASE(27, 27, 6, 0x0050, 0x10, 0, 1), |
| 433 | PIN_FIELD_BASE(28, 29, 6, 0x0050, 0x10, 24, 1), |
| 434 | PIN_FIELD_BASE(30, 30, 6, 0x0050, 0x10, 16, 1), |
| 435 | PIN_FIELD_BASE(31, 31, 6, 0x0050, 0x10, 13, 1), |
| 436 | PIN_FIELD_BASE(32, 32, 6, 0x0050, 0x10, 15, 1), |
| 437 | PIN_FIELD_BASE(33, 33, 6, 0x0050, 0x10, 17, 1), |
| 438 | PIN_FIELD_BASE(34, 34, 6, 0x0050, 0x10, 14, 1), |
| 439 | PIN_FIELD_BASE(35, 35, 6, 0x0060, 0x10, 5, 1), |
| 440 | PIN_FIELD_BASE(36, 36, 6, 0x0060, 0x10, 0, 1), |
| 441 | PIN_FIELD_BASE(37, 37, 6, 0x0060, 0x10, 6, 1), |
| 442 | PIN_FIELD_BASE(38, 41, 6, 0x0060, 0x10, 1, 1), |
| 443 | PIN_FIELD_BASE(42, 43, 6, 0x0050, 0x10, 1, 1), |
| 444 | PIN_FIELD_BASE(44, 44, 6, 0x0050, 0x10, 18, 1), |
| 445 | PIN_FIELD_BASE(45, 45, 3, 0x0060, 0x10, 4, 1), |
| 446 | PIN_FIELD_BASE(46, 46, 3, 0x0060, 0x10, 12, 1), |
| 447 | PIN_FIELD_BASE(47, 47, 3, 0x0060, 0x10, 15, 1), |
| 448 | PIN_FIELD_BASE(48, 48, 3, 0x0060, 0x10, 14, 1), |
| 449 | PIN_FIELD_BASE(49, 49, 3, 0x0060, 0x10, 16, 1), |
| 450 | PIN_FIELD_BASE(50, 50, 3, 0x0060, 0x10, 13, 1), |
| 451 | PIN_FIELD_BASE(51, 51, 3, 0x0060, 0x10, 1, 1), |
| 452 | PIN_FIELD_BASE(52, 52, 3, 0x0060, 0x10, 9, 1), |
| 453 | PIN_FIELD_BASE(53, 54, 3, 0x0060, 0x10, 18, 1), |
| 454 | PIN_FIELD_BASE(55, 55, 3, 0x0060, 0x10, 3, 1), |
| 455 | PIN_FIELD_BASE(56, 56, 3, 0x0060, 0x10, 11, 1), |
| 456 | PIN_FIELD_BASE(61, 61, 3, 0x0060, 0x10, 2, 1), |
| 457 | PIN_FIELD_BASE(62, 62, 3, 0x0060, 0x10, 10, 1), |
| 458 | PIN_FIELD_BASE(63, 63, 3, 0x0060, 0x10, 7, 1), |
| 459 | PIN_FIELD_BASE(64, 64, 3, 0x0060, 0x10, 6, 1), |
| 460 | PIN_FIELD_BASE(65, 65, 3, 0x0060, 0x10, 8, 1), |
| 461 | PIN_FIELD_BASE(66, 66, 3, 0x0060, 0x10, 5, 1), |
| 462 | PIN_FIELD_BASE(67, 67, 2, 0x0080, 0x10, 7, 1), |
| 463 | PIN_FIELD_BASE(68, 68, 2, 0x0080, 0x10, 6, 1), |
| 464 | PIN_FIELD_BASE(69, 69, 2, 0x0080, 0x10, 8, 1), |
| 465 | PIN_FIELD_BASE(70, 71, 2, 0x0080, 0x10, 4, 1), |
| 466 | PIN_FIELD_BASE(72, 72, 4, 0x0030, 0x10, 3, 1), |
| 467 | PIN_FIELD_BASE(73, 73, 4, 0x0030, 0x10, 2, 1), |
| 468 | PIN_FIELD_BASE(74, 74, 4, 0x0030, 0x10, 1, 1), |
| 469 | PIN_FIELD_BASE(75, 75, 4, 0x0030, 0x10, 4, 1), |
| 470 | PIN_FIELD_BASE(76, 76, 4, 0x0030, 0x10, 12, 1), |
| 471 | PIN_FIELD_BASE(77, 77, 4, 0x0030, 0x10, 11, 1), |
| 472 | PIN_FIELD_BASE(78, 78, 2, 0x0070, 0x10, 18, 1), |
| 473 | PIN_FIELD_BASE(79, 79, 2, 0x0070, 0x10, 17, 1), |
| 474 | PIN_FIELD_BASE(80, 81, 2, 0x0070, 0x10, 19, 1), |
| 475 | PIN_FIELD_BASE(82, 88, 2, 0x0070, 0x10, 1, 1), |
| 476 | PIN_FIELD_BASE(89, 89, 2, 0x0070, 0x10, 16, 1), |
| 477 | PIN_FIELD_BASE(90, 90, 2, 0x0070, 0x10, 15, 1), |
| 478 | PIN_FIELD_BASE(91, 91, 2, 0x0070, 0x10, 14, 1), |
| 479 | PIN_FIELD_BASE(92, 92, 2, 0x0070, 0x10, 8, 1), |
| 480 | PIN_FIELD_BASE(93, 93, 4, 0x0030, 0x10, 0, 1), |
| 481 | PIN_FIELD_BASE(94, 94, 2, 0x0070, 0x10, 0, 1), |
| 482 | PIN_FIELD_BASE(95, 95, 4, 0x0030, 0x10, 7, 1), |
| 483 | PIN_FIELD_BASE(96, 96, 4, 0x0030, 0x10, 5, 1), |
| 484 | PIN_FIELD_BASE(97, 97, 4, 0x0030, 0x10, 8, 1), |
| 485 | PIN_FIELD_BASE(98, 98, 4, 0x0030, 0x10, 6, 1), |
| 486 | PIN_FIELD_BASE(99, 99, 2, 0x0080, 0x10, 9, 1), |
| 487 | PIN_FIELD_BASE(100, 100, 2, 0x0080, 0x10, 12, 1), |
| 488 | PIN_FIELD_BASE(101, 101, 2, 0x0080, 0x10, 10, 1), |
| 489 | PIN_FIELD_BASE(102, 102, 2, 0x0080, 0x10, 13, 1), |
| 490 | PIN_FIELD_BASE(103, 103, 2, 0x0080, 0x10, 11, 1), |
| 491 | PIN_FIELD_BASE(104, 104, 2, 0x0080, 0x10, 14, 1), |
| 492 | PIN_FIELD_BASE(105, 105, 2, 0x0070, 0x10, 10, 1), |
| 493 | PIN_FIELD_BASE(106, 106, 2, 0x0070, 0x10, 9, 1), |
| 494 | PIN_FIELD_BASE(107, 108, 2, 0x0070, 0x10, 12, 1), |
| 495 | PIN_FIELD_BASE(109, 109, 2, 0x0070, 0x10, 11, 1), |
| 496 | PIN_FIELD_BASE(110, 110, 2, 0x0080, 0x10, 16, 1), |
| 497 | PIN_FIELD_BASE(111, 111, 2, 0x0080, 0x10, 18, 1), |
| 498 | PIN_FIELD_BASE(112, 112, 2, 0x0080, 0x10, 15, 1), |
| 499 | PIN_FIELD_BASE(113, 113, 2, 0x0080, 0x10, 17, 1), |
| 500 | PIN_FIELD_BASE(114, 115, 2, 0x0070, 0x10, 26, 1), |
| 501 | PIN_FIELD_BASE(116, 117, 2, 0x0070, 0x10, 21, 1), |
| 502 | PIN_FIELD_BASE(118, 118, 2, 0x0070, 0x10, 31, 1), |
| 503 | PIN_FIELD_BASE(119, 119, 2, 0x0080, 0x10, 0, 1), |
| 504 | PIN_FIELD_BASE(120, 121, 2, 0x0070, 0x10, 23, 1), |
| 505 | PIN_FIELD_BASE(122, 123, 2, 0x0070, 0x10, 28, 1), |
| 506 | PIN_FIELD_BASE(124, 125, 2, 0x0080, 0x10, 1, 1), |
| 507 | PIN_FIELD_BASE(126, 127, 1, 0x0050, 0x10, 2, 1), |
| 508 | PIN_FIELD_BASE(140, 141, 1, 0x0050, 0x10, 0, 1), |
| 509 | PIN_FIELD_BASE(142, 142, 1, 0x0050, 0x10, 9, 1), |
| 510 | PIN_FIELD_BASE(143, 143, 5, 0x0030, 0x10, 15, 1), |
| 511 | PIN_FIELD_BASE(144, 144, 5, 0x0030, 0x10, 17, 1), |
| 512 | PIN_FIELD_BASE(145, 145, 5, 0x0030, 0x10, 16, 1), |
| 513 | PIN_FIELD_BASE(146, 146, 5, 0x0030, 0x10, 12, 1), |
| 514 | PIN_FIELD_BASE(147, 155, 5, 0x0030, 0x10, 0, 1), |
| 515 | PIN_FIELD_BASE(156, 157, 5, 0x0030, 0x10, 22, 1), |
| 516 | PIN_FIELD_BASE(158, 158, 5, 0x0030, 0x10, 21, 1), |
| 517 | PIN_FIELD_BASE(159, 159, 5, 0x0030, 0x10, 24, 1), |
| 518 | PIN_FIELD_BASE(160, 161, 5, 0x0030, 0x10, 19, 1), |
| 519 | PIN_FIELD_BASE(162, 166, 5, 0x0030, 0x10, 25, 1), |
| 520 | PIN_FIELD_BASE(179, 179, 4, 0x0030, 0x10, 13, 1), |
| 521 | PIN_FIELD_BASE(180, 180, 4, 0x0030, 0x10, 10, 1), |
| 522 | PIN_FIELD_BASE(181, 183, 1, 0x0050, 0x10, 10, 1), |
| 523 | PIN_FIELD_BASE(184, 184, 1, 0x0050, 0x10, 6, 1), |
| 524 | PIN_FIELD_BASE(185, 185, 1, 0x0050, 0x10, 5, 1), |
| 525 | PIN_FIELD_BASE(186, 186, 1, 0x0050, 0x10, 7, 1), |
| 526 | PIN_FIELD_BASE(187, 187, 1, 0x0050, 0x10, 4, 1), |
| 527 | PIN_FIELD_BASE(188, 188, 1, 0x0050, 0x10, 8, 1), |
| 528 | PIN_FIELD_BASE(189, 189, 5, 0x0030, 0x10, 9, 1), |
| 529 | PIN_FIELD_BASE(190, 190, 5, 0x0030, 0x10, 18, 1), |
| 530 | PIN_FIELD_BASE(191, 192, 5, 0x0030, 0x10, 13, 1), |
| 531 | PIN_FIELD_BASE(193, 194, 5, 0x0030, 0x10, 10, 1), |
| 532 | PIN_FIELD_BASE(195, 195, 2, 0x0070, 0x10, 30, 1), |
| 533 | PIN_FIELD_BASE(196, 196, 2, 0x0070, 0x10, 25, 1), |
| 534 | PIN_FIELD_BASE(197, 197, 2, 0x0080, 0x10, 3, 1), |
| 535 | PIN_FIELD_BASE(198, 199, 4, 0x0030, 0x10, 14, 1), |
| 536 | PIN_FIELD_BASE(200, 201, 6, 0x0060, 0x10, 7, 1), |
| 537 | PIN_FIELD_BASE(202, 202, 4, 0x0030, 0x10, 9, 1), |
| 538 | }; |
| 539 | |
| 540 | static const struct mtk_pin_field_calc mt6779_pin_drv_range[] = { |
| 541 | PINS_FIELD_BASE(0, 9, 6, 0x0000, 0x10, 9, 3), |
| 542 | PIN_FIELD_BASE(10, 16, 3, 0x0000, 0x10, 0, 3), |
| 543 | PINS_FIELD_BASE(17, 19, 6, 0x0010, 0x10, 3, 3), |
| 544 | PIN_FIELD_BASE(20, 20, 6, 0x0010, 0x10, 6, 3), |
| 545 | PINS_FIELD_BASE(21, 24, 6, 0x0000, 0x10, 21, 3), |
| 546 | PIN_FIELD_BASE(25, 25, 6, 0x0010, 0x10, 9, 3), |
| 547 | PIN_FIELD_BASE(26, 26, 6, 0x0000, 0x10, 24, 3), |
| 548 | PIN_FIELD_BASE(27, 27, 6, 0x0000, 0x10, 0, 3), |
| 549 | PIN_FIELD_BASE(28, 28, 6, 0x0000, 0x10, 27, 3), |
| 550 | PIN_FIELD_BASE(29, 29, 6, 0x0010, 0x10, 0, 3), |
| 551 | PINS_FIELD_BASE(30, 32, 6, 0x0000, 0x10, 12, 3), |
| 552 | PIN_FIELD_BASE(33, 33, 6, 0x0000, 0x10, 15, 3), |
| 553 | PIN_FIELD_BASE(34, 34, 6, 0x0000, 0x10, 12, 3), |
| 554 | PINS_FIELD_BASE(35, 41, 6, 0x0010, 0x10, 12, 3), |
| 555 | PIN_FIELD_BASE(42, 43, 6, 0x0000, 0x10, 3, 3), |
| 556 | PIN_FIELD_BASE(44, 44, 6, 0x0000, 0x10, 18, 3), |
| 557 | PIN_FIELD_BASE(45, 45, 3, 0x0010, 0x10, 12, 3), |
| 558 | PIN_FIELD_BASE(46, 46, 3, 0x0020, 0x10, 0, 3), |
| 559 | PINS_FIELD_BASE(47, 49, 3, 0x0020, 0x10, 3, 3), |
| 560 | PIN_FIELD_BASE(50, 50, 3, 0x0020, 0x10, 6, 3), |
| 561 | PIN_FIELD_BASE(51, 51, 3, 0x0010, 0x10, 3, 3), |
| 562 | PIN_FIELD_BASE(52, 52, 3, 0x0010, 0x10, 21, 3), |
| 563 | PINS_FIELD_BASE(53, 54, 3, 0x0020, 0x10, 9, 3), |
| 564 | PIN_FIELD_BASE(55, 55, 3, 0x0010, 0x10, 9, 3), |
| 565 | PIN_FIELD_BASE(56, 56, 3, 0x0010, 0x10, 27, 3), |
| 566 | PIN_FIELD_BASE(57, 57, 3, 0x0010, 0x10, 0, 3), |
| 567 | PIN_FIELD_BASE(58, 58, 3, 0x0000, 0x10, 27, 3), |
| 568 | PIN_FIELD_BASE(59, 60, 3, 0x0000, 0x10, 21, 3), |
| 569 | PIN_FIELD_BASE(61, 61, 3, 0x0010, 0x10, 6, 3), |
| 570 | PIN_FIELD_BASE(62, 62, 3, 0x0010, 0x10, 24, 3), |
| 571 | PINS_FIELD_BASE(63, 65, 3, 0x0010, 0x10, 15, 3), |
| 572 | PIN_FIELD_BASE(66, 66, 3, 0x0010, 0x10, 18, 3), |
| 573 | PINS_FIELD_BASE(67, 69, 2, 0x0010, 0x10, 3, 3), |
| 574 | PIN_FIELD_BASE(70, 71, 2, 0x0010, 0x10, 0, 3), |
| 575 | PINS_FIELD_BASE(72, 75, 4, 0x0000, 0x10, 0, 3), |
| 576 | PINS_FIELD_BASE(76, 77, 4, 0x0000, 0x10, 15, 3), |
| 577 | PINS_FIELD_BASE(78, 86, 2, 0x0000, 0x10, 3, 3), |
| 578 | PINS_FIELD_BASE(87, 92, 2, 0x0000, 0x10, 6, 3), |
| 579 | PIN_FIELD_BASE(93, 93, 4, 0x0000, 0x10, 3, 3), |
| 580 | PIN_FIELD_BASE(94, 94, 2, 0x0000, 0x10, 6, 3), |
| 581 | PINS_FIELD_BASE(95, 96, 4, 0x0000, 0x10, 6, 3), |
| 582 | PINS_FIELD_BASE(97, 98, 4, 0x0000, 0x10, 9, 3), |
| 583 | PINS_FIELD_BASE(99, 100, 2, 0x0010, 0x10, 6, 3), |
| 584 | PINS_FIELD_BASE(101, 102, 2, 0x0010, 0x10, 9, 3), |
| 585 | PINS_FIELD_BASE(103, 104, 2, 0x0010, 0x10, 12, 3), |
| 586 | PINS_FIELD_BASE(105, 109, 2, 0x0000, 0x10, 0, 3), |
| 587 | PIN_FIELD_BASE(110, 110, 2, 0x0010, 0x10, 18, 3), |
| 588 | PIN_FIELD_BASE(111, 111, 2, 0x0010, 0x10, 24, 3), |
| 589 | PIN_FIELD_BASE(112, 112, 2, 0x0010, 0x10, 15, 3), |
| 590 | PIN_FIELD_BASE(113, 113, 2, 0x0010, 0x10, 21, 3), |
| 591 | PINS_FIELD_BASE(114, 115, 2, 0x0000, 0x10, 12, 3), |
| 592 | PIN_FIELD_BASE(116, 117, 2, 0x0000, 0x10, 15, 3), |
| 593 | PINS_FIELD_BASE(118, 119, 2, 0x0000, 0x10, 12, 3), |
| 594 | PIN_FIELD_BASE(120, 121, 2, 0x0000, 0x10, 21, 3), |
| 595 | PINS_FIELD_BASE(122, 125, 2, 0x0000, 0x10, 9, 3), |
| 596 | PINS_FIELD_BASE(126, 127, 1, 0x0000, 0x10, 12, 3), |
| 597 | PIN_FIELD_BASE(128, 128, 1, 0x0000, 0x10, 29, 2), |
| 598 | PIN_FIELD_BASE(129, 129, 1, 0x0010, 0x10, 0, 2), |
| 599 | PIN_FIELD_BASE(130, 130, 1, 0x0000, 0x10, 27, 2), |
| 600 | PIN_FIELD_BASE(131, 131, 1, 0x0010, 0x10, 2, 2), |
| 601 | PIN_FIELD_BASE(132, 132, 1, 0x0010, 0x10, 6, 2), |
| 602 | PIN_FIELD_BASE(133, 133, 1, 0x0010, 0x10, 4, 2), |
| 603 | PIN_FIELD_BASE(134, 135, 1, 0x0000, 0x10, 3, 3), |
| 604 | PINS_FIELD_BASE(136, 139, 1, 0x0000, 0x10, 9, 3), |
| 605 | PINS_FIELD_BASE(140, 141, 1, 0x0000, 0x10, 0, 3), |
| 606 | PIN_FIELD_BASE(142, 142, 1, 0x0000, 0x10, 24, 3), |
| 607 | PINS_FIELD_BASE(143, 146, 5, 0x0000, 0x10, 3, 3), |
| 608 | PINS_FIELD_BASE(147, 155, 5, 0x0000, 0x10, 0, 3), |
| 609 | PIN_FIELD_BASE(156, 157, 5, 0x0000, 0x10, 21, 3), |
| 610 | PIN_FIELD_BASE(158, 158, 5, 0x0000, 0x10, 15, 3), |
| 611 | PIN_FIELD_BASE(159, 159, 5, 0x0000, 0x10, 27, 3), |
| 612 | PIN_FIELD_BASE(160, 161, 5, 0x0000, 0x10, 9, 3), |
| 613 | PINS_FIELD_BASE(162, 166, 5, 0x0000, 0x10, 18, 3), |
| 614 | PIN_FIELD_BASE(167, 167, 7, 0x0000, 0x10, 3, 3), |
| 615 | PINS_FIELD_BASE(168, 174, 7, 0x0000, 0x10, 6, 3), |
| 616 | PIN_FIELD_BASE(175, 175, 7, 0x0000, 0x10, 9, 3), |
| 617 | PIN_FIELD_BASE(176, 176, 7, 0x0000, 0x10, 0, 3), |
| 618 | PINS_FIELD_BASE(177, 178, 7, 0x0000, 0x10, 6, 3), |
| 619 | PIN_FIELD_BASE(179, 180, 4, 0x0000, 0x10, 15, 3), |
| 620 | PIN_FIELD_BASE(181, 183, 1, 0x0010, 0x10, 8, 3), |
| 621 | PINS_FIELD_BASE(184, 186, 1, 0x0000, 0x10, 15, 3), |
| 622 | PIN_FIELD_BASE(187, 188, 1, 0x0000, 0x10, 18, 3), |
| 623 | PIN_FIELD_BASE(189, 189, 5, 0x0000, 0x10, 6, 3), |
| 624 | PINS_FIELD_BASE(190, 194, 5, 0x0000, 0x10, 3, 3), |
| 625 | PIN_FIELD_BASE(195, 195, 2, 0x0000, 0x10, 9, 3), |
| 626 | PIN_FIELD_BASE(196, 196, 2, 0x0000, 0x10, 27, 3), |
| 627 | PIN_FIELD_BASE(197, 197, 2, 0x0000, 0x10, 9, 3), |
| 628 | PIN_FIELD_BASE(198, 199, 4, 0x0000, 0x10, 21, 3), |
| 629 | PINS_FIELD_BASE(200, 201, 6, 0x0010, 0x10, 15, 3), |
| 630 | PIN_FIELD_BASE(202, 202, 4, 0x0000, 0x10, 12, 3), |
| 631 | }; |
| 632 | |
| 633 | static const struct mtk_pin_field_calc mt6779_pin_pupd_range[] = { |
| 634 | PIN_FIELD_BASE(10, 15, 3, 0x0070, 0x10, 0, 1), |
| 635 | PIN_FIELD_BASE(57, 57, 3, 0x0070, 0x10, 9, 1), |
| 636 | PIN_FIELD_BASE(58, 58, 3, 0x0070, 0x10, 8, 1), |
| 637 | PIN_FIELD_BASE(59, 60, 3, 0x0070, 0x10, 6, 1), |
| 638 | PIN_FIELD_BASE(128, 129, 1, 0x0060, 0x10, 7, 1), |
| 639 | PIN_FIELD_BASE(130, 130, 1, 0x0060, 0x10, 6, 1), |
| 640 | PIN_FIELD_BASE(131, 131, 1, 0x0060, 0x10, 9, 1), |
| 641 | PIN_FIELD_BASE(132, 132, 1, 0x0060, 0x10, 11, 1), |
| 642 | PIN_FIELD_BASE(133, 133, 1, 0x0060, 0x10, 10, 1), |
| 643 | PIN_FIELD_BASE(134, 135, 1, 0x0060, 0x10, 0, 1), |
| 644 | PIN_FIELD_BASE(136, 136, 1, 0x0060, 0x10, 5, 1), |
| 645 | PIN_FIELD_BASE(137, 137, 1, 0x0060, 0x10, 2, 1), |
| 646 | PIN_FIELD_BASE(138, 138, 1, 0x0060, 0x10, 4, 1), |
| 647 | PIN_FIELD_BASE(139, 139, 1, 0x0060, 0x10, 3, 1), |
| 648 | PIN_FIELD_BASE(167, 168, 7, 0x0020, 0x10, 1, 1), |
| 649 | PIN_FIELD_BASE(169, 169, 7, 0x0020, 0x10, 4, 1), |
| 650 | PIN_FIELD_BASE(170, 170, 7, 0x0020, 0x10, 6, 1), |
| 651 | PIN_FIELD_BASE(171, 171, 7, 0x0020, 0x10, 8, 1), |
| 652 | PIN_FIELD_BASE(172, 172, 7, 0x0020, 0x10, 3, 1), |
| 653 | PIN_FIELD_BASE(173, 173, 7, 0x0020, 0x10, 7, 1), |
| 654 | PIN_FIELD_BASE(174, 175, 7, 0x0020, 0x10, 9, 1), |
| 655 | PIN_FIELD_BASE(176, 176, 7, 0x0020, 0x10, 0, 1), |
| 656 | PIN_FIELD_BASE(177, 177, 7, 0x0020, 0x10, 5, 1), |
| 657 | PIN_FIELD_BASE(178, 178, 7, 0x0020, 0x10, 11, 1), |
| 658 | }; |
| 659 | |
| 660 | static const struct mtk_pin_field_calc mt6779_pin_r0_range[] = { |
| 661 | PIN_FIELD_BASE(10, 15, 3, 0x0090, 0x10, 0, 1), |
| 662 | PIN_FIELD_BASE(57, 57, 3, 0x0090, 0x10, 9, 1), |
| 663 | PIN_FIELD_BASE(58, 58, 3, 0x0090, 0x10, 8, 1), |
| 664 | PIN_FIELD_BASE(59, 60, 3, 0x0090, 0x10, 6, 1), |
| 665 | PIN_FIELD_BASE(128, 129, 1, 0x0080, 0x10, 7, 1), |
| 666 | PIN_FIELD_BASE(130, 130, 1, 0x0080, 0x10, 6, 1), |
| 667 | PIN_FIELD_BASE(131, 131, 1, 0x0080, 0x10, 9, 1), |
| 668 | PIN_FIELD_BASE(132, 132, 1, 0x0080, 0x10, 11, 1), |
| 669 | PIN_FIELD_BASE(133, 133, 1, 0x0080, 0x10, 10, 1), |
| 670 | PIN_FIELD_BASE(134, 135, 1, 0x0080, 0x10, 0, 1), |
| 671 | PIN_FIELD_BASE(136, 136, 1, 0x0080, 0x10, 5, 1), |
| 672 | PIN_FIELD_BASE(137, 137, 1, 0x0080, 0x10, 2, 1), |
| 673 | PIN_FIELD_BASE(138, 138, 1, 0x0080, 0x10, 4, 1), |
| 674 | PIN_FIELD_BASE(139, 139, 1, 0x0080, 0x10, 3, 1), |
| 675 | PIN_FIELD_BASE(167, 168, 7, 0x0030, 0x10, 1, 1), |
| 676 | PIN_FIELD_BASE(169, 169, 7, 0x0030, 0x10, 4, 1), |
| 677 | PIN_FIELD_BASE(170, 170, 7, 0x0030, 0x10, 6, 1), |
| 678 | PIN_FIELD_BASE(171, 171, 7, 0x0030, 0x10, 8, 1), |
| 679 | PIN_FIELD_BASE(172, 172, 7, 0x0030, 0x10, 3, 1), |
| 680 | PIN_FIELD_BASE(173, 173, 7, 0x0030, 0x10, 7, 1), |
| 681 | PIN_FIELD_BASE(174, 175, 7, 0x0030, 0x10, 9, 1), |
| 682 | PIN_FIELD_BASE(176, 176, 7, 0x0030, 0x10, 0, 1), |
| 683 | PIN_FIELD_BASE(177, 177, 7, 0x0030, 0x10, 5, 1), |
| 684 | PIN_FIELD_BASE(178, 178, 7, 0x0030, 0x10, 11, 1), |
| 685 | }; |
| 686 | |
| 687 | static const struct mtk_pin_field_calc mt6779_pin_r1_range[] = { |
| 688 | PIN_FIELD_BASE(10, 15, 3, 0x00a0, 0x10, 0, 1), |
| 689 | PIN_FIELD_BASE(57, 57, 3, 0x00a0, 0x10, 9, 1), |
| 690 | PIN_FIELD_BASE(58, 58, 3, 0x00a0, 0x10, 8, 1), |
| 691 | PIN_FIELD_BASE(59, 60, 3, 0x00a0, 0x10, 6, 1), |
| 692 | PIN_FIELD_BASE(128, 129, 1, 0x0090, 0x10, 7, 1), |
| 693 | PIN_FIELD_BASE(130, 130, 1, 0x0090, 0x10, 6, 1), |
| 694 | PIN_FIELD_BASE(131, 131, 1, 0x0090, 0x10, 9, 1), |
| 695 | PIN_FIELD_BASE(132, 132, 1, 0x0090, 0x10, 11, 1), |
| 696 | PIN_FIELD_BASE(133, 133, 1, 0x0090, 0x10, 10, 1), |
| 697 | PIN_FIELD_BASE(134, 135, 1, 0x0090, 0x10, 0, 1), |
| 698 | PIN_FIELD_BASE(136, 136, 1, 0x0090, 0x10, 5, 1), |
| 699 | PIN_FIELD_BASE(137, 137, 1, 0x0090, 0x10, 2, 1), |
| 700 | PIN_FIELD_BASE(138, 138, 1, 0x0090, 0x10, 4, 1), |
| 701 | PIN_FIELD_BASE(139, 139, 1, 0x0090, 0x10, 3, 1), |
| 702 | PIN_FIELD_BASE(167, 168, 7, 0x0040, 0x10, 1, 1), |
| 703 | PIN_FIELD_BASE(169, 169, 7, 0x0040, 0x10, 4, 1), |
| 704 | PIN_FIELD_BASE(170, 170, 7, 0x0040, 0x10, 6, 1), |
| 705 | PIN_FIELD_BASE(171, 171, 7, 0x0040, 0x10, 8, 1), |
| 706 | PIN_FIELD_BASE(172, 172, 7, 0x0040, 0x10, 3, 1), |
| 707 | PIN_FIELD_BASE(173, 173, 7, 0x0040, 0x10, 7, 1), |
| 708 | PIN_FIELD_BASE(174, 175, 7, 0x0040, 0x10, 9, 1), |
| 709 | PIN_FIELD_BASE(176, 176, 7, 0x0040, 0x10, 0, 1), |
| 710 | PIN_FIELD_BASE(177, 177, 7, 0x0040, 0x10, 5, 1), |
| 711 | PIN_FIELD_BASE(178, 178, 7, 0x0040, 0x10, 11, 1), |
| 712 | }; |
| 713 | |
| 714 | static const struct mtk_pin_reg_calc mt6779_reg_cals[PINCTRL_PIN_REG_MAX] = { |
| 715 | [PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt6779_pin_mode_range), |
| 716 | [PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt6779_pin_dir_range), |
| 717 | [PINCTRL_PIN_REG_DI] = MTK_RANGE(mt6779_pin_di_range), |
| 718 | [PINCTRL_PIN_REG_DO] = MTK_RANGE(mt6779_pin_do_range), |
| 719 | [PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt6779_pin_smt_range), |
| 720 | [PINCTRL_PIN_REG_IES] = MTK_RANGE(mt6779_pin_ies_range), |
| 721 | [PINCTRL_PIN_REG_PU] = MTK_RANGE(mt6779_pin_pu_range), |
| 722 | [PINCTRL_PIN_REG_PD] = MTK_RANGE(mt6779_pin_pd_range), |
| 723 | [PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt6779_pin_drv_range), |
| 724 | [PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt6779_pin_pupd_range), |
| 725 | [PINCTRL_PIN_REG_R0] = MTK_RANGE(mt6779_pin_r0_range), |
| 726 | [PINCTRL_PIN_REG_R1] = MTK_RANGE(mt6779_pin_r1_range), |
| 727 | }; |
| 728 | |
| 729 | static const char * const mt6779_pinctrl_register_base_names[] = { |
| 730 | "gpio", "iocfg_rm", "iocfg_br", "iocfg_lm", "iocfg_lb", |
| 731 | "iocfg_rt", "iocfg_lt", "iocfg_tl", |
| 732 | }; |
| 733 | |
| 734 | static const struct mtk_eint_hw mt6779_eint_hw = { |
| 735 | .port_mask = 7, |
| 736 | .ports = 6, |
| 737 | .ap_num = 209, |
| 738 | .db_cnt = 16, |
| 739 | }; |
| 740 | |
| 741 | static const struct mtk_pin_soc mt6779_data = { |
| 742 | .reg_cal = mt6779_reg_cals, |
| 743 | .pins = mtk_pins_mt6779, |
| 744 | .npins = ARRAY_SIZE(mtk_pins_mt6779), |
| 745 | .ngrps = ARRAY_SIZE(mtk_pins_mt6779), |
| 746 | .eint_hw = &mt6779_eint_hw, |
| 747 | .gpio_m = 0, |
| 748 | .ies_present = true, |
| 749 | .base_names = mt6779_pinctrl_register_base_names, |
| 750 | .nbase_names = ARRAY_SIZE(mt6779_pinctrl_register_base_names), |
| 751 | .bias_disable_set = mtk_pinconf_bias_disable_set, |
| 752 | .bias_disable_get = mtk_pinconf_bias_disable_get, |
| 753 | .bias_set = mtk_pinconf_bias_set, |
| 754 | .bias_get = mtk_pinconf_bias_get, |
| 755 | .drive_set = mtk_pinconf_drive_set_rev1, |
| 756 | .drive_get = mtk_pinconf_drive_get_rev1, |
| 757 | .adv_pull_get = mtk_pinconf_adv_pull_get, |
| 758 | .adv_pull_set = mtk_pinconf_adv_pull_set, |
| 759 | }; |
| 760 | |
| 761 | static const struct of_device_id mt6779_pinctrl_of_match[] = { |
| 762 | { .compatible = "mediatek,mt6779-pinctrl", }, |
| 763 | { } |
| 764 | }; |
| 765 | |
| 766 | static int mt6779_pinctrl_probe(struct platform_device *pdev) |
| 767 | { |
| 768 | return mtk_paris_pinctrl_probe(pdev, &mt6779_data); |
| 769 | } |
| 770 | |
| 771 | static struct platform_driver mt6779_pinctrl_driver = { |
| 772 | .driver = { |
| 773 | .name = "mt6779-pinctrl", |
| 774 | .of_match_table = mt6779_pinctrl_of_match, |
| 775 | .pm = &mtk_eint_pm_ops_v2, |
| 776 | }, |
| 777 | .probe = mt6779_pinctrl_probe, |
| 778 | }; |
| 779 | |
| 780 | static int __init mt6779_pinctrl_init(void) |
| 781 | { |
| 782 | return platform_driver_register(&mt6779_pinctrl_driver); |
| 783 | } |
| 784 | arch_initcall(mt6779_pinctrl_init); |