1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Realtek DHC 1319D pin controller driver
4 *
5 * Copyright (c) 2023 Realtek Semiconductor Corp.
6 *
7 */
8
9 #include <linux/module.h>
10 #include <linux/of.h>
11 #include <linux/platform_device.h>
12 #include <linux/pinctrl/pinctrl.h>
13
14 #include "pinctrl-rtd.h"
15
16 enum rtd13xxd_iso_pins {
17 RTD1319D_ISO_GPIO_0 = 0,
18 RTD1319D_ISO_GPIO_1,
19 RTD1319D_ISO_GPIO_2,
20 RTD1319D_ISO_GPIO_3,
21 RTD1319D_ISO_GPIO_4,
22 RTD1319D_ISO_GPIO_5,
23 RTD1319D_ISO_GPIO_6,
24 RTD1319D_ISO_GPIO_7,
25 RTD1319D_ISO_GPIO_8,
26 RTD1319D_ISO_GPIO_9,
27 RTD1319D_ISO_GPIO_10,
28 RTD1319D_ISO_GPIO_11,
29 RTD1319D_ISO_GPIO_12,
30 RTD1319D_ISO_GPIO_13,
31 RTD1319D_ISO_GPIO_14,
32 RTD1319D_ISO_GPIO_15,
33 RTD1319D_ISO_GPIO_16,
34 RTD1319D_ISO_GPIO_17,
35 RTD1319D_ISO_GPIO_18,
36 RTD1319D_ISO_GPIO_19,
37 RTD1319D_ISO_GPIO_20,
38 RTD1319D_ISO_GPIO_21,
39 RTD1319D_ISO_GPIO_22,
40 RTD1319D_ISO_GPIO_23,
41 RTD1319D_ISO_USB_CC2,
42 RTD1319D_ISO_GPIO_25,
43 RTD1319D_ISO_GPIO_26,
44 RTD1319D_ISO_GPIO_27,
45 RTD1319D_ISO_GPIO_28,
46 RTD1319D_ISO_GPIO_29,
47 RTD1319D_ISO_GPIO_30,
48 RTD1319D_ISO_GPIO_31,
49 RTD1319D_ISO_GPIO_32,
50 RTD1319D_ISO_GPIO_33,
51 RTD1319D_ISO_GPIO_34,
52 RTD1319D_ISO_GPIO_35,
53 RTD1319D_ISO_HIF_DATA,
54 RTD1319D_ISO_HIF_EN,
55 RTD1319D_ISO_HIF_RDY,
56 RTD1319D_ISO_HIF_CLK,
57 RTD1319D_ISO_GPIO_40,
58 RTD1319D_ISO_GPIO_41,
59 RTD1319D_ISO_GPIO_42,
60 RTD1319D_ISO_GPIO_43,
61 RTD1319D_ISO_GPIO_44,
62 RTD1319D_ISO_GPIO_45,
63 RTD1319D_ISO_GPIO_46,
64 RTD1319D_ISO_GPIO_47,
65 RTD1319D_ISO_GPIO_48,
66 RTD1319D_ISO_GPIO_49,
67 RTD1319D_ISO_GPIO_50,
68 RTD1319D_ISO_USB_CC1,
69 RTD1319D_ISO_GPIO_52,
70 RTD1319D_ISO_GPIO_53,
71 RTD1319D_ISO_IR_RX,
72 RTD1319D_ISO_UR0_RX,
73 RTD1319D_ISO_UR0_TX,
74 RTD1319D_ISO_GPIO_57,
75 RTD1319D_ISO_GPIO_58,
76 RTD1319D_ISO_GPIO_59,
77 RTD1319D_ISO_GPIO_60,
78 RTD1319D_ISO_GPIO_61,
79 RTD1319D_ISO_GPIO_62,
80 RTD1319D_ISO_GPIO_63,
81 RTD1319D_ISO_GPIO_64,
82 RTD1319D_ISO_EMMC_RST_N,
83 RTD1319D_ISO_EMMC_DD_SB,
84 RTD1319D_ISO_EMMC_CLK,
85 RTD1319D_ISO_EMMC_CMD,
86 RTD1319D_ISO_EMMC_DATA_0,
87 RTD1319D_ISO_EMMC_DATA_1,
88 RTD1319D_ISO_EMMC_DATA_2,
89 RTD1319D_ISO_EMMC_DATA_3,
90 RTD1319D_ISO_EMMC_DATA_4,
91 RTD1319D_ISO_EMMC_DATA_5,
92 RTD1319D_ISO_EMMC_DATA_6,
93 RTD1319D_ISO_EMMC_DATA_7,
94 RTD1319D_ISO_GPIO_DUMMY_77,
95 RTD1319D_ISO_GPIO_78,
96 RTD1319D_ISO_GPIO_79,
97 RTD1319D_ISO_GPIO_80,
98 RTD1319D_ISO_GPIO_81,
99 RTD1319D_ISO_UR2_LOC,
100 RTD1319D_ISO_GSPI_LOC,
101 RTD1319D_ISO_HI_WIDTH,
102 RTD1319D_ISO_SF_EN,
103 RTD1319D_ISO_ARM_TRACE_DBG_EN,
104 RTD1319D_ISO_EJTAG_AUCPU_LOC,
105 RTD1319D_ISO_EJTAG_ACPU_LOC,
106 RTD1319D_ISO_EJTAG_VCPU_LOC,
107 RTD1319D_ISO_EJTAG_SCPU_LOC,
108 RTD1319D_ISO_DMIC_LOC,
109 RTD1319D_ISO_EJTAG_SECPU_LOC,
110 RTD1319D_ISO_VTC_DMIC_LOC,
111 RTD1319D_ISO_VTC_TDM_LOC,
112 RTD1319D_ISO_VTC_I2SI_LOC,
113 RTD1319D_ISO_TDM_AI_LOC,
114 RTD1319D_ISO_AI_LOC,
115 RTD1319D_ISO_SPDIF_LOC,
116 RTD1319D_ISO_HIF_EN_LOC,
117 RTD1319D_ISO_SC0_LOC,
118 RTD1319D_ISO_SC1_LOC,
119 RTD1319D_ISO_SCAN_SWITCH,
120 RTD1319D_ISO_WD_RSET,
121 RTD1319D_ISO_BOOT_SEL,
122 RTD1319D_ISO_RESET_N,
123 RTD1319D_ISO_TESTMODE,
124 };
125
126 static const struct pinctrl_pin_desc rtd1319d_iso_pins[] = {
127 PINCTRL_PIN(RTD1319D_ISO_GPIO_0, "gpio_0"),
128 PINCTRL_PIN(RTD1319D_ISO_GPIO_1, "gpio_1"),
129 PINCTRL_PIN(RTD1319D_ISO_GPIO_2, "gpio_2"),
130 PINCTRL_PIN(RTD1319D_ISO_GPIO_3, "gpio_3"),
131 PINCTRL_PIN(RTD1319D_ISO_GPIO_4, "gpio_4"),
132 PINCTRL_PIN(RTD1319D_ISO_GPIO_5, "gpio_5"),
133 PINCTRL_PIN(RTD1319D_ISO_GPIO_6, "gpio_6"),
134 PINCTRL_PIN(RTD1319D_ISO_GPIO_7, "gpio_7"),
135 PINCTRL_PIN(RTD1319D_ISO_GPIO_8, "gpio_8"),
136 PINCTRL_PIN(RTD1319D_ISO_GPIO_9, "gpio_9"),
137 PINCTRL_PIN(RTD1319D_ISO_GPIO_10, "gpio_10"),
138 PINCTRL_PIN(RTD1319D_ISO_GPIO_11, "gpio_11"),
139 PINCTRL_PIN(RTD1319D_ISO_GPIO_12, "gpio_12"),
140 PINCTRL_PIN(RTD1319D_ISO_GPIO_13, "gpio_13"),
141 PINCTRL_PIN(RTD1319D_ISO_GPIO_14, "gpio_14"),
142 PINCTRL_PIN(RTD1319D_ISO_GPIO_15, "gpio_15"),
143 PINCTRL_PIN(RTD1319D_ISO_GPIO_16, "gpio_16"),
144 PINCTRL_PIN(RTD1319D_ISO_GPIO_17, "gpio_17"),
145 PINCTRL_PIN(RTD1319D_ISO_GPIO_18, "gpio_18"),
146 PINCTRL_PIN(RTD1319D_ISO_GPIO_19, "gpio_19"),
147 PINCTRL_PIN(RTD1319D_ISO_GPIO_20, "gpio_20"),
148 PINCTRL_PIN(RTD1319D_ISO_GPIO_21, "gpio_21"),
149 PINCTRL_PIN(RTD1319D_ISO_GPIO_22, "gpio_22"),
150 PINCTRL_PIN(RTD1319D_ISO_GPIO_23, "gpio_23"),
151 PINCTRL_PIN(RTD1319D_ISO_USB_CC2, "usb_cc2"),
152 PINCTRL_PIN(RTD1319D_ISO_GPIO_25, "gpio_25"),
153 PINCTRL_PIN(RTD1319D_ISO_GPIO_26, "gpio_26"),
154 PINCTRL_PIN(RTD1319D_ISO_GPIO_27, "gpio_27"),
155 PINCTRL_PIN(RTD1319D_ISO_GPIO_28, "gpio_28"),
156 PINCTRL_PIN(RTD1319D_ISO_GPIO_29, "gpio_29"),
157 PINCTRL_PIN(RTD1319D_ISO_GPIO_30, "gpio_30"),
158 PINCTRL_PIN(RTD1319D_ISO_GPIO_31, "gpio_31"),
159 PINCTRL_PIN(RTD1319D_ISO_GPIO_32, "gpio_32"),
160 PINCTRL_PIN(RTD1319D_ISO_GPIO_33, "gpio_33"),
161 PINCTRL_PIN(RTD1319D_ISO_GPIO_34, "gpio_34"),
162 PINCTRL_PIN(RTD1319D_ISO_GPIO_35, "gpio_35"),
163 PINCTRL_PIN(RTD1319D_ISO_HIF_DATA, "hif_data"),
164 PINCTRL_PIN(RTD1319D_ISO_HIF_EN, "hif_en"),
165 PINCTRL_PIN(RTD1319D_ISO_HIF_RDY, "hif_rdy"),
166 PINCTRL_PIN(RTD1319D_ISO_HIF_CLK, "hif_clk"),
167 PINCTRL_PIN(RTD1319D_ISO_GPIO_40, "gpio_40"),
168 PINCTRL_PIN(RTD1319D_ISO_GPIO_41, "gpio_41"),
169 PINCTRL_PIN(RTD1319D_ISO_GPIO_42, "gpio_42"),
170 PINCTRL_PIN(RTD1319D_ISO_GPIO_43, "gpio_43"),
171 PINCTRL_PIN(RTD1319D_ISO_GPIO_44, "gpio_44"),
172 PINCTRL_PIN(RTD1319D_ISO_GPIO_45, "gpio_45"),
173 PINCTRL_PIN(RTD1319D_ISO_GPIO_46, "gpio_46"),
174 PINCTRL_PIN(RTD1319D_ISO_GPIO_47, "gpio_47"),
175 PINCTRL_PIN(RTD1319D_ISO_GPIO_48, "gpio_48"),
176 PINCTRL_PIN(RTD1319D_ISO_GPIO_49, "gpio_49"),
177 PINCTRL_PIN(RTD1319D_ISO_GPIO_50, "gpio_50"),
178 PINCTRL_PIN(RTD1319D_ISO_USB_CC1, "usb_cc1"),
179 PINCTRL_PIN(RTD1319D_ISO_GPIO_52, "gpio_52"),
180 PINCTRL_PIN(RTD1319D_ISO_GPIO_53, "gpio_53"),
181 PINCTRL_PIN(RTD1319D_ISO_IR_RX, "ir_rx"),
182 PINCTRL_PIN(RTD1319D_ISO_UR0_RX, "ur0_rx"),
183 PINCTRL_PIN(RTD1319D_ISO_UR0_TX, "ur0_tx"),
184 PINCTRL_PIN(RTD1319D_ISO_GPIO_57, "gpio_57"),
185 PINCTRL_PIN(RTD1319D_ISO_GPIO_58, "gpio_58"),
186 PINCTRL_PIN(RTD1319D_ISO_GPIO_59, "gpio_59"),
187 PINCTRL_PIN(RTD1319D_ISO_GPIO_60, "gpio_60"),
188 PINCTRL_PIN(RTD1319D_ISO_GPIO_61, "gpio_61"),
189 PINCTRL_PIN(RTD1319D_ISO_GPIO_62, "gpio_62"),
190 PINCTRL_PIN(RTD1319D_ISO_GPIO_63, "gpio_63"),
191 PINCTRL_PIN(RTD1319D_ISO_GPIO_64, "gpio_64"),
192 PINCTRL_PIN(RTD1319D_ISO_EMMC_RST_N, "emmc_rst_n"),
193 PINCTRL_PIN(RTD1319D_ISO_EMMC_DD_SB, "emmc_dd_sb"),
194 PINCTRL_PIN(RTD1319D_ISO_EMMC_CLK, "emmc_clk"),
195 PINCTRL_PIN(RTD1319D_ISO_EMMC_CMD, "emmc_cmd"),
196 PINCTRL_PIN(RTD1319D_ISO_EMMC_DATA_0, "emmc_data_0"),
197 PINCTRL_PIN(RTD1319D_ISO_EMMC_DATA_1, "emmc_data_1"),
198 PINCTRL_PIN(RTD1319D_ISO_EMMC_DATA_2, "emmc_data_2"),
199 PINCTRL_PIN(RTD1319D_ISO_EMMC_DATA_3, "emmc_data_3"),
200 PINCTRL_PIN(RTD1319D_ISO_EMMC_DATA_4, "emmc_data_4"),
201 PINCTRL_PIN(RTD1319D_ISO_EMMC_DATA_5, "emmc_data_5"),
202 PINCTRL_PIN(RTD1319D_ISO_EMMC_DATA_6, "emmc_data_6"),
203 PINCTRL_PIN(RTD1319D_ISO_EMMC_DATA_7, "emmc_data_7"),
204 PINCTRL_PIN(RTD1319D_ISO_GPIO_DUMMY_77, "dummy"),
205 PINCTRL_PIN(RTD1319D_ISO_GPIO_78, "gpio_78"),
206 PINCTRL_PIN(RTD1319D_ISO_GPIO_79, "gpio_79"),
207 PINCTRL_PIN(RTD1319D_ISO_GPIO_80, "gpio_80"),
208 PINCTRL_PIN(RTD1319D_ISO_GPIO_81, "gpio_81"),
209 PINCTRL_PIN(RTD1319D_ISO_UR2_LOC, "ur2_loc"),
210 PINCTRL_PIN(RTD1319D_ISO_GSPI_LOC, "gspi_loc"),
211 PINCTRL_PIN(RTD1319D_ISO_HI_WIDTH, "hi_width"),
212 PINCTRL_PIN(RTD1319D_ISO_SF_EN, "sf_en"),
213 PINCTRL_PIN(RTD1319D_ISO_ARM_TRACE_DBG_EN, "arm_trace_dbg_en"),
214 PINCTRL_PIN(RTD1319D_ISO_EJTAG_AUCPU_LOC, "ejtag_aucpu_loc"),
215 PINCTRL_PIN(RTD1319D_ISO_EJTAG_ACPU_LOC, "ejtag_acpu_loc"),
216 PINCTRL_PIN(RTD1319D_ISO_EJTAG_VCPU_LOC, "ejtag_vcpu_loc"),
217 PINCTRL_PIN(RTD1319D_ISO_EJTAG_SCPU_LOC, "ejtag_scpu_loc"),
218 PINCTRL_PIN(RTD1319D_ISO_DMIC_LOC, "dmic_loc"),
219 PINCTRL_PIN(RTD1319D_ISO_EJTAG_SECPU_LOC, "ejtag_secpu_loc"),
220 PINCTRL_PIN(RTD1319D_ISO_VTC_DMIC_LOC, "vtc_dmic_loc"),
221 PINCTRL_PIN(RTD1319D_ISO_VTC_TDM_LOC, "vtc_tdm_loc"),
222 PINCTRL_PIN(RTD1319D_ISO_VTC_I2SI_LOC, "vtc_i2si_loc"),
223 PINCTRL_PIN(RTD1319D_ISO_TDM_AI_LOC, "tdm_ai_loc"),
224 PINCTRL_PIN(RTD1319D_ISO_AI_LOC, "ai_loc"),
225 PINCTRL_PIN(RTD1319D_ISO_SPDIF_LOC, "spdif_loc"),
226 PINCTRL_PIN(RTD1319D_ISO_HIF_EN_LOC, "hif_en_loc"),
227 PINCTRL_PIN(RTD1319D_ISO_SC0_LOC, "sc0_loc"),
228 PINCTRL_PIN(RTD1319D_ISO_SC1_LOC, "sc1_loc"),
229 PINCTRL_PIN(RTD1319D_ISO_SCAN_SWITCH, "scan_switch"),
230 PINCTRL_PIN(RTD1319D_ISO_WD_RSET, "wd_rset"),
231 PINCTRL_PIN(RTD1319D_ISO_BOOT_SEL, "boot_sel"),
232 PINCTRL_PIN(RTD1319D_ISO_RESET_N, "reset_n"),
233 PINCTRL_PIN(RTD1319D_ISO_TESTMODE, "testmode"),
234 };
235
236 /* Tagged as __maybe_unused since there are pins we may use in the future */
237 #define DECLARE_RTD1319D_PIN(_pin, _name) \
238 static const unsigned int rtd1319d_## _name ##_pins[] __maybe_unused = { _pin }
239
240 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_0, gpio_0);
241 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_1, gpio_1);
242 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_2, gpio_2);
243 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_3, gpio_3);
244 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_4, gpio_4);
245 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_5, gpio_5);
246 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_6, gpio_6);
247 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_7, gpio_7);
248 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_8, gpio_8);
249 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_9, gpio_9);
250 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_10, gpio_10);
251 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_11, gpio_11);
252 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_12, gpio_12);
253 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_13, gpio_13);
254 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_14, gpio_14);
255 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_15, gpio_15);
256 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_16, gpio_16);
257 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_17, gpio_17);
258 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_18, gpio_18);
259 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_19, gpio_19);
260 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_20, gpio_20);
261 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_21, gpio_21);
262 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_22, gpio_22);
263 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_23, gpio_23);
264 DECLARE_RTD1319D_PIN(RTD1319D_ISO_USB_CC2, usb_cc2);
265 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_25, gpio_25);
266 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_26, gpio_26);
267 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_27, gpio_27);
268 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_28, gpio_28);
269 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_29, gpio_29);
270 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_30, gpio_30);
271 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_31, gpio_31);
272 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_32, gpio_32);
273 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_33, gpio_33);
274 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_34, gpio_34);
275 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_35, gpio_35);
276 DECLARE_RTD1319D_PIN(RTD1319D_ISO_HIF_DATA, hif_data);
277 DECLARE_RTD1319D_PIN(RTD1319D_ISO_HIF_EN, hif_en);
278 DECLARE_RTD1319D_PIN(RTD1319D_ISO_HIF_RDY, hif_rdy);
279 DECLARE_RTD1319D_PIN(RTD1319D_ISO_HIF_CLK, hif_clk);
280 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_40, gpio_40);
281 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_41, gpio_41);
282 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_42, gpio_42);
283 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_43, gpio_43);
284 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_44, gpio_44);
285 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_45, gpio_45);
286 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_46, gpio_46);
287 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_47, gpio_47);
288 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_48, gpio_48);
289 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_49, gpio_49);
290 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_50, gpio_50);
291 DECLARE_RTD1319D_PIN(RTD1319D_ISO_USB_CC1, usb_cc1);
292 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_52, gpio_52);
293 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_53, gpio_53);
294 DECLARE_RTD1319D_PIN(RTD1319D_ISO_IR_RX, ir_rx);
295 DECLARE_RTD1319D_PIN(RTD1319D_ISO_UR0_RX, ur0_rx);
296 DECLARE_RTD1319D_PIN(RTD1319D_ISO_UR0_TX, ur0_tx);
297 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_57, gpio_57);
298 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_58, gpio_58);
299 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_59, gpio_59);
300 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_60, gpio_60);
301 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_61, gpio_61);
302 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_62, gpio_62);
303 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_63, gpio_63);
304 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_64, gpio_64);
305 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_RST_N, emmc_rst_n);
306 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_DD_SB, emmc_dd_sb);
307 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_CLK, emmc_clk);
308 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_CMD, emmc_cmd);
309 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_DATA_0, emmc_data_0);
310 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_DATA_1, emmc_data_1);
311 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_DATA_2, emmc_data_2);
312 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_DATA_3, emmc_data_3);
313 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_DATA_4, emmc_data_4);
314 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_DATA_5, emmc_data_5);
315 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_DATA_6, emmc_data_6);
316 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EMMC_DATA_7, emmc_data_7);
317 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_78, gpio_78);
318 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_79, gpio_79);
319 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_80, gpio_80);
320 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_81, gpio_81);
321 DECLARE_RTD1319D_PIN(RTD1319D_ISO_UR2_LOC, ur2_loc);
322 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GSPI_LOC, gspi_loc);
323 DECLARE_RTD1319D_PIN(RTD1319D_ISO_HI_WIDTH, hi_width);
324 DECLARE_RTD1319D_PIN(RTD1319D_ISO_SF_EN, sf_en);
325 DECLARE_RTD1319D_PIN(RTD1319D_ISO_ARM_TRACE_DBG_EN, arm_trace_dbg_en);
326 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EJTAG_AUCPU_LOC, ejtag_aucpu_loc);
327 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EJTAG_ACPU_LOC, ejtag_acpu_loc);
328 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EJTAG_VCPU_LOC, ejtag_vcpu_loc);
329 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EJTAG_SCPU_LOC, ejtag_scpu_loc);
330 DECLARE_RTD1319D_PIN(RTD1319D_ISO_DMIC_LOC, dmic_loc);
331 DECLARE_RTD1319D_PIN(RTD1319D_ISO_EJTAG_SECPU_LOC, ejtag_secpu_loc);
332 DECLARE_RTD1319D_PIN(RTD1319D_ISO_VTC_DMIC_LOC, vtc_dmic_loc);
333 DECLARE_RTD1319D_PIN(RTD1319D_ISO_VTC_TDM_LOC, vtc_tdm_loc);
334 DECLARE_RTD1319D_PIN(RTD1319D_ISO_VTC_I2SI_LOC, vtc_i2si_loc);
335 DECLARE_RTD1319D_PIN(RTD1319D_ISO_TDM_AI_LOC, tdm_ai_loc);
336 DECLARE_RTD1319D_PIN(RTD1319D_ISO_AI_LOC, ai_loc);
337 DECLARE_RTD1319D_PIN(RTD1319D_ISO_SPDIF_LOC, spdif_loc);
338 DECLARE_RTD1319D_PIN(RTD1319D_ISO_HIF_EN_LOC, hif_en_loc);
339 DECLARE_RTD1319D_PIN(RTD1319D_ISO_SC0_LOC, sc0_loc);
340 DECLARE_RTD1319D_PIN(RTD1319D_ISO_SC1_LOC, sc1_loc);
341 DECLARE_RTD1319D_PIN(RTD1319D_ISO_SCAN_SWITCH, scan_switch);
342 DECLARE_RTD1319D_PIN(RTD1319D_ISO_WD_RSET, wd_rset);
343 DECLARE_RTD1319D_PIN(RTD1319D_ISO_BOOT_SEL, boot_sel);
344 DECLARE_RTD1319D_PIN(RTD1319D_ISO_RESET_N, reset_n);
345 DECLARE_RTD1319D_PIN(RTD1319D_ISO_TESTMODE, testmode);
346
347 #define RTD1319D_GROUP(_name) \
348 { \
349 .name = # _name, \
350 .pins = rtd1319d_ ## _name ## _pins, \
351 .num_pins = ARRAY_SIZE(rtd1319d_ ## _name ## _pins), \
352 }
353
354 static const struct rtd_pin_group_desc rtd1319d_pin_groups[] = {
355 RTD1319D_GROUP(gpio_0),
356 RTD1319D_GROUP(gpio_1),
357 RTD1319D_GROUP(gpio_2),
358 RTD1319D_GROUP(gpio_3),
359 RTD1319D_GROUP(gpio_4),
360 RTD1319D_GROUP(gpio_5),
361 RTD1319D_GROUP(gpio_6),
362 RTD1319D_GROUP(gpio_7),
363 RTD1319D_GROUP(gpio_8),
364 RTD1319D_GROUP(gpio_9),
365 RTD1319D_GROUP(gpio_10),
366 RTD1319D_GROUP(gpio_11),
367 RTD1319D_GROUP(gpio_12),
368 RTD1319D_GROUP(gpio_13),
369 RTD1319D_GROUP(gpio_14),
370 RTD1319D_GROUP(gpio_15),
371 RTD1319D_GROUP(gpio_16),
372 RTD1319D_GROUP(gpio_17),
373 RTD1319D_GROUP(gpio_18),
374 RTD1319D_GROUP(gpio_19),
375 RTD1319D_GROUP(gpio_20),
376 RTD1319D_GROUP(gpio_21),
377 RTD1319D_GROUP(gpio_22),
378 RTD1319D_GROUP(gpio_23),
379 RTD1319D_GROUP(usb_cc2),
380 RTD1319D_GROUP(gpio_25),
381 RTD1319D_GROUP(gpio_26),
382 RTD1319D_GROUP(gpio_27),
383 RTD1319D_GROUP(gpio_28),
384 RTD1319D_GROUP(gpio_29),
385 RTD1319D_GROUP(gpio_30),
386 RTD1319D_GROUP(gpio_31),
387 RTD1319D_GROUP(gpio_32),
388 RTD1319D_GROUP(gpio_33),
389 RTD1319D_GROUP(gpio_34),
390 RTD1319D_GROUP(gpio_35),
391 RTD1319D_GROUP(hif_data),
392 RTD1319D_GROUP(hif_en),
393 RTD1319D_GROUP(hif_rdy),
394 RTD1319D_GROUP(hif_clk),
395 RTD1319D_GROUP(gpio_40),
396 RTD1319D_GROUP(gpio_41),
397 RTD1319D_GROUP(gpio_42),
398 RTD1319D_GROUP(gpio_43),
399 RTD1319D_GROUP(gpio_44),
400 RTD1319D_GROUP(gpio_45),
401 RTD1319D_GROUP(gpio_46),
402 RTD1319D_GROUP(gpio_47),
403 RTD1319D_GROUP(gpio_48),
404 RTD1319D_GROUP(gpio_49),
405 RTD1319D_GROUP(gpio_50),
406 RTD1319D_GROUP(usb_cc1),
407 RTD1319D_GROUP(gpio_52),
408 RTD1319D_GROUP(gpio_53),
409 RTD1319D_GROUP(ir_rx),
410 RTD1319D_GROUP(ur0_rx),
411 RTD1319D_GROUP(ur0_tx),
412 RTD1319D_GROUP(gpio_57),
413 RTD1319D_GROUP(gpio_58),
414 RTD1319D_GROUP(gpio_59),
415 RTD1319D_GROUP(gpio_60),
416 RTD1319D_GROUP(gpio_61),
417 RTD1319D_GROUP(gpio_62),
418 RTD1319D_GROUP(gpio_63),
419 RTD1319D_GROUP(gpio_64),
420 RTD1319D_GROUP(emmc_rst_n),
421 RTD1319D_GROUP(emmc_dd_sb),
422 RTD1319D_GROUP(emmc_clk),
423 RTD1319D_GROUP(emmc_cmd),
424 RTD1319D_GROUP(emmc_data_0),
425 RTD1319D_GROUP(emmc_data_1),
426 RTD1319D_GROUP(emmc_data_2),
427 RTD1319D_GROUP(emmc_data_3),
428 RTD1319D_GROUP(emmc_data_4),
429 RTD1319D_GROUP(emmc_data_5),
430 RTD1319D_GROUP(emmc_data_6),
431 RTD1319D_GROUP(emmc_data_7),
432 RTD1319D_GROUP(gpio_78),
433 RTD1319D_GROUP(gpio_79),
434 RTD1319D_GROUP(gpio_80),
435 RTD1319D_GROUP(gpio_81),
436 RTD1319D_GROUP(ur2_loc),
437 RTD1319D_GROUP(gspi_loc),
438 RTD1319D_GROUP(hi_width),
439 RTD1319D_GROUP(sf_en),
440 RTD1319D_GROUP(arm_trace_dbg_en),
441 RTD1319D_GROUP(ejtag_aucpu_loc),
442 RTD1319D_GROUP(ejtag_acpu_loc),
443 RTD1319D_GROUP(ejtag_vcpu_loc),
444 RTD1319D_GROUP(ejtag_scpu_loc),
445 RTD1319D_GROUP(dmic_loc),
446 RTD1319D_GROUP(ejtag_secpu_loc),
447 RTD1319D_GROUP(vtc_dmic_loc),
448 RTD1319D_GROUP(vtc_tdm_loc),
449 RTD1319D_GROUP(vtc_i2si_loc),
450 RTD1319D_GROUP(tdm_ai_loc),
451 RTD1319D_GROUP(ai_loc),
452 RTD1319D_GROUP(spdif_loc),
453 RTD1319D_GROUP(hif_en_loc),
454 RTD1319D_GROUP(sc0_loc),
455 RTD1319D_GROUP(sc1_loc),
456 };
457
458 static const char * const rtd1319d_gpio_groups[] = {
459 "gpio_0", "gpio_1", "gpio_2", "gpio_3", "gpio_4",
460 "gpio_5", "gpio_6", "gpio_7", "gpio_8", "gpio_9",
461 "gpio_10", "gpio_11", "gpio_12", "gpio_13", "gpio_14",
462 "gpio_15", "gpio_16", "gpio_17", "gpio_18", "gpio_19",
463 "gpio_20", "gpio_21", "gpio_22", "gpio_23", "usb_cc2",
464 "gpio_25", "gpio_26", "gpio_27", "gpio_28", "gpio_29",
465 "gpio_30", "gpio_31", "gpio_32", "gpio_33", "gpio_34",
466 "gpio_35", "hif_data", "hif_en", "hif_rdy", "hif_clk",
467 "gpio_40", "gpio_41", "gpio_42", "gpio_43", "gpio_44",
468 "gpio_45", "gpio_46", "gpio_47", "gpio_48", "gpio_49",
469 "gpio_50", "usb_cc1", "gpio_52", "gpio_53", "ir_rx",
470 "ur0_rx", "ur0_tx", "gpio_57", "gpio_58", "gpio_59",
471 "gpio_60", "gpio_61", "gpio_62", "gpio_63", "gpio_64",
472 "emmc_rst_n", "emmc_dd_sb", "emmc_clk", "emmc_cmd",
473 "emmc_data_0", "emmc_data_1", "emmc_data_2", "emmc_data_3",
474 "emmc_data_4", "emmc_data_5", "emmc_data_6", "emmc_data_7",
475 "gpio_78", "gpio_79", "gpio_80", "gpio_81" };
476 static const char * const rtd1319d_nf_groups[] = {
477 "emmc_rst_n", "emmc_clk", "emmc_cmd", "emmc_data_0",
478 "emmc_data_1", "emmc_data_2", "emmc_data_3", "emmc_data_4",
479 "emmc_data_5", "emmc_data_6", "emmc_data_7",
480 "gpio_78", "gpio_79", "gpio_80", "gpio_81" };
481 static const char * const rtd1319d_emmc_groups[] = {
482 "emmc_rst_n", "emmc_dd_sb", "emmc_clk", "emmc_cmd",
483 "emmc_data_0", "emmc_data_1", "emmc_data_2", "emmc_data_3",
484 "emmc_data_4", "emmc_data_5", "emmc_data_6", "emmc_data_7" };
485 static const char * const rtd1319d_tp0_groups[] = {
486 "gpio_2", "gpio_3", "gpio_4", "gpio_57", "gpio_58",
487 "gpio_59", "gpio_60", "gpio_61", "gpio_62", "gpio_63",
488 "gpio_64" };
489 static const char * const rtd1319d_tp1_groups[] = {
490 "gpio_61", "gpio_62", "gpio_63", "gpio_64" };
491 static const char * const rtd1319d_sc0_groups[] = {
492 "gpio_18", "gpio_19", "gpio_31" };
493 static const char * const rtd1319d_sc0_data0_groups[] = { "gpio_20", "sc0_loc" };
494 static const char * const rtd1319d_sc0_data1_groups[] = { "gpio_30", "sc0_loc" };
495 static const char * const rtd1319d_sc0_data2_groups[] = { "gpio_47", "sc0_loc" };
496 static const char * const rtd1319d_sc1_groups[] = {
497 "gpio_2", "gpio_3", "gpio_5" };
498 static const char * const rtd1319d_sc1_data0_groups[] = { "gpio_52", "sc1_loc" };
499 static const char * const rtd1319d_sc1_data1_groups[] = { "gpio_34", "sc1_loc" };
500 static const char * const rtd1319d_sc1_data2_groups[] = { "gpio_35", "sc1_loc" };
501 static const char * const rtd1319d_ao_groups[] = {
502 "gpio_2", "gpio_3", "gpio_4", "gpio_61", "gpio_62",
503 "gpio_63", "gpio_64" };
504 static const char * const rtd1319d_gspi_loc0_groups[] = {
505 "gpio_18", "gpio_19", "gpio_20", "gpio_31", "gspi_loc" };
506 static const char * const rtd1319d_gspi_loc1_groups[] = {
507 "gpio_8", "gpio_9", "gpio_10", "gpio_11", "gspi_loc" };
508 static const char * const rtd1319d_uart0_groups[] = { "ur0_rx", "ur0_tx"};
509 static const char * const rtd1319d_uart1_groups[] = {
510 "gpio_8", "gpio_9", "gpio_10", "gpio_11" };
511 static const char * const rtd1319d_uart2_loc0_groups[] = {
512 "gpio_18", "gpio_19", "gpio_20", "gpio_31", "ur2_loc" };
513 static const char * const rtd1319d_uart2_loc1_groups[] = {
514 "gpio_25", "gpio_26", "gpio_27", "gpio_28", "ur2_loc" };
515 static const char * const rtd1319d_i2c0_groups[] = { "gpio_12", "gpio_13" };
516 static const char * const rtd1319d_i2c1_groups[] = { "gpio_16", "gpio_17" };
517 static const char * const rtd1319d_i2c3_groups[] = { "gpio_26", "gpio_27" };
518 static const char * const rtd1319d_i2c4_groups[] = { "gpio_34", "gpio_35" };
519 static const char * const rtd1319d_i2c5_groups[] = { "gpio_29", "gpio_46" };
520 static const char * const rtd1319d_pcie1_groups[] = { "gpio_22" };
521 static const char * const rtd1319d_sdio_groups[] = {
522 "gpio_40", "gpio_41", "gpio_42", "gpio_43", "gpio_44",
523 "gpio_45" };
524 static const char * const rtd1319d_etn_led_groups[] = { "gpio_14", "gpio_15" };
525 static const char * const rtd1319d_etn_phy_groups[] = { "gpio_14", "gpio_15" };
526 static const char * const rtd1319d_spi_groups[] = {
527 "gpio_18", "gpio_19", "gpio_20", "gpio_31" };
528 static const char * const rtd1319d_pwm0_loc0_groups[] = { "gpio_26" };
529 static const char * const rtd1319d_pwm0_loc1_groups[] = { "gpio_20" };
530 static const char * const rtd1319d_pwm1_loc0_groups[] = { "gpio_27" };
531 static const char * const rtd1319d_pwm1_loc1_groups[] = { "gpio_21" };
532
533 static const char * const rtd1319d_pwm2_loc0_groups[] = { "gpio_28" };
534 static const char * const rtd1319d_pwm2_loc1_groups[] = { "gpio_22" };
535 static const char * const rtd1319d_pwm3_loc0_groups[] = { "gpio_47" };
536 static const char * const rtd1319d_pwm3_loc1_groups[] = { "gpio_23" };
537 static const char * const rtd1319d_qam_agc_if0_groups[] = { "gpio_21" };
538 static const char * const rtd1319d_qam_agc_if1_groups[] = { "gpio_23" };
539 static const char * const rtd1319d_spdif_optical_loc0_groups[] = { "gpio_21", "spdif_loc" };
540 static const char * const rtd1319d_spdif_optical_loc1_groups[] = { "gpio_6", "spdif_loc" };
541 static const char * const rtd1319d_usb_cc1_groups[] = { "usb_cc1" };
542 static const char * const rtd1319d_usb_cc2_groups[] = { "usb_cc2" };
543 static const char * const rtd1319d_vfd_groups[] = {
544 "gpio_26", "gpio_27", "gpio_28" };
545 static const char * const rtd1319d_sd_groups[] = {
546 "gpio_32", "gpio_33", "gpio_34", "gpio_35",
547 "hif_data", "hif_en", "hif_rdy", "hif_clk" };
548 static const char * const rtd1319d_dmic_loc0_groups[] = {
549 "gpio_57", "gpio_58", "gpio_59", "gpio_60", "gpio_61",
550 "gpio_62", "gpio_63", "gpio_64", "dmic_loc" };
551 static const char * const rtd1319d_dmic_loc1_groups[] = {
552 "gpio_32", "gpio_33", "gpio_34", "gpio_35",
553 "hif_data", "hif_en", "hif_rdy", "hif_clk",
554 "dmic_loc" };
555 static const char * const rtd1319d_ai_loc0_groups[] = {
556 "gpio_57", "gpio_58", "gpio_59", "gpio_60", "gpio_61",
557 "gpio_62", "gpio_63", "ai_loc" };
558 static const char * const rtd1319d_ai_loc1_groups[] = {
559 "gpio_32", "gpio_33", "gpio_34", "hif_data",
560 "hif_en", "hif_rdy", "hif_clk", "ai_loc" };
561 static const char * const rtd1319d_tdm_ai_loc0_groups[] = {
562 "gpio_57", "gpio_58", "gpio_59",
563 "gpio_60", "tdm_ai_loc" };
564 static const char * const rtd1319d_tdm_ai_loc1_groups[] = {
565 "hif_data", "hif_en", "hif_rdy", "hif_clk", "tdm_ai_loc" };
566 static const char * const rtd1319d_hi_loc0_groups[] = {
567 "hif_data", "hif_en", "hif_rdy", "hif_clk" };
568 static const char * const rtd1319d_hi_m_groups[] = {
569 "hif_data", "hif_en", "hif_rdy", "hif_clk" };
570 static const char * const rtd1319d_vtc_i2so_groups[] = {
571 "gpio_2", "gpio_3", "gpio_4", "gpio_64"};
572 static const char * const rtd1319d_vtc_i2si_loc0_groups[] = {
573 "gpio_57", "gpio_58", "gpio_59", "gpio_60", "gpio_61",
574 "vtc_i2si_loc" };
575 static const char * const rtd1319d_vtc_i2si_loc1_groups[] = {
576 "gpio_32", "hif_data", "hif_en", "hif_rdy", "hif_clk",
577 "vtc_i2si_loc" };
578 static const char * const rtd1319d_vtc_dmic_loc0_groups[] = {
579 "gpio_57", "gpio_58", "gpio_59", "gpio_60",
580 "vtc_dmic_loc" };
581 static const char * const rtd1319d_vtc_dmic_loc1_groups[] = {
582 "hif_data", "hif_en", "hif_rdy", "hif_clk",
583 "vtc_dmic_loc" };
584 static const char * const rtd1319d_vtc_tdm_loc0_groups[] = {
585 "gpio_57", "gpio_58", "gpio_59", "gpio_60",
586 "vtc_tdm_loc" };
587 static const char * const rtd1319d_vtc_tdm_loc1_groups[] = {
588 "hif_data", "hif_en", "hif_rdy", "hif_clk",
589 "vtc_tdm_loc" };
590 static const char * const rtd1319d_dc_fan_groups[] = { "gpio_47" };
591 static const char * const rtd1319d_pll_test_loc0_groups[] = { "gpio_52", "gpio_53" };
592 static const char * const rtd1319d_pll_test_loc1_groups[] = { "gpio_48", "gpio_49" };
593 static const char * const rtd1319d_spdif_groups[] = { "gpio_50" };
594 static const char * const rtd1319d_ir_rx_groups[] = { "ir_rx" };
595 static const char * const rtd1319d_uart2_disable_groups[] = { "ur2_loc" };
596 static const char * const rtd1319d_gspi_disable_groups[] = { "gspi_loc" };
597 static const char * const rtd1319d_hi_width_disable_groups[] = { "hi_width" };
598 static const char * const rtd1319d_hi_width_1bit_groups[] = { "hi_width" };
599 static const char * const rtd1319d_sf_disable_groups[] = { "sf_en" };
600 static const char * const rtd1319d_sf_enable_groups[] = { "sf_en" };
601 static const char * const rtd1319d_scpu_ejtag_loc0_groups[] = {
602 "gpio_2", "gpio_3", "gpio_4", "gpio_5", "gpio_6",
603 "ejtag_scpu_loc" };
604 static const char * const rtd1319d_scpu_ejtag_loc1_groups[] = {
605 "gpio_32", "gpio_33", "hif_data", "hif_en", "hif_clk",
606 "ejtag_scpu_loc" };
607 static const char * const rtd1319d_scpu_ejtag_loc2_groups[] = {
608 "gpio_57", "gpio_58", "gpio_59", "gpio_60", "gpio_61",
609 "ejtag_scpu_loc" };
610 static const char * const rtd1319d_acpu_ejtag_loc0_groups[] = {
611 "gpio_2", "gpio_3", "gpio_4", "gpio_5", "gpio_6",
612 "ejtag_acpu_loc" };
613 static const char * const rtd1319d_acpu_ejtag_loc1_groups[] = {
614 "gpio_32", "gpio_33", "hif_data", "hif_en", "hif_clk",
615 "ejtag_acpu_loc" };
616 static const char * const rtd1319d_acpu_ejtag_loc2_groups[] = {
617 "gpio_57", "gpio_58", "gpio_59", "gpio_60", "gpio_61",
618 "ejtag_acpu_loc" };
619 static const char * const rtd1319d_vcpu_ejtag_loc0_groups[] = {
620 "gpio_2", "gpio_3", "gpio_4", "gpio_5", "gpio_6",
621 "ejtag_vcpu_loc" };
622 static const char * const rtd1319d_vcpu_ejtag_loc1_groups[] = {
623 "gpio_32", "gpio_33", "hif_data", "hif_en", "hif_clk",
624 "ejtag_vcpu_loc" };
625 static const char * const rtd1319d_vcpu_ejtag_loc2_groups[] = {
626 "gpio_57", "gpio_58", "gpio_59", "gpio_60", "gpio_61",
627 "ejtag_vcpu_loc" };
628 static const char * const rtd1319d_secpu_ejtag_loc0_groups[] = {
629 "gpio_2", "gpio_3", "gpio_4", "gpio_5", "gpio_6",
630 "ejtag_secpu_loc" };
631 static const char * const rtd1319d_secpu_ejtag_loc1_groups[] = {
632 "gpio_32", "gpio_33", "hif_data", "hif_en", "hif_clk",
633 "ejtag_secpu_loc" };
634 static const char * const rtd1319d_secpu_ejtag_loc2_groups[] = {
635 "gpio_57", "gpio_58", "gpio_59", "gpio_60", "gpio_61",
636 "ejtag_secpu_loc" };
637 static const char * const rtd1319d_aucpu_ejtag_loc0_groups[] = {
638 "gpio_2", "gpio_3", "gpio_4", "gpio_5", "gpio_6",
639 "ejtag_aucpu_loc" };
640 static const char * const rtd1319d_aucpu_ejtag_loc1_groups[] = {
641 "gpio_32", "gpio_33", "hif_data", "hif_en", "hif_clk",
642 "ejtag_aucpu_loc" };
643 static const char * const rtd1319d_aucpu_ejtag_loc2_groups[] = {
644 "gpio_57", "gpio_58", "gpio_59", "gpio_60", "gpio_61",
645 "ejtag_aucpu_loc" };
646 static const char * const rtd1319d_iso_tristate_groups[] = {
647 "emmc_rst_n", "emmc_dd_sb", "emmc_clk", "emmc_cmd",
648 "emmc_data_0", "emmc_data_1", "emmc_data_2", "emmc_data_3",
649 "emmc_data_4", "emmc_data_5", "emmc_data_6", "emmc_data_7",
650 "gpio_78", "gpio_79", "gpio_80", "gpio_81", "gpio_1",
651 "gpio_8", "gpio_9", "gpio_10", "gpio_11", "gpio_22",
652 "gpio_23", "usb_cc2", "gpio_25", "gpio_28", "gpio_29",
653 "gpio_30", "gpio_32", "gpio_33", "hif_data", "hif_en",
654 "hif_rdy", "hif_clk", "gpio_40", "gpio_41", "gpio_42",
655 "gpio_43", "gpio_44", "gpio_45", "gpio_46", "usb_cc1",
656 "ir_rx", "ur0_rx", "ur0_tx", "gpio_62", "gpio_63", "gpio_64" };
657 static const char * const rtd1319d_dbg_out0_groups[] = {
658 "gpio_12", "gpio_13", "gpio_16", "gpio_17", "gpio_26", "gpio_27",
659 "gpio_34", "gpio_35", "gpio_48", "gpio_49", "gpio_57", "gpio_58",
660 "gpio_59", "gpio_60", "gpio_61" };
661 static const char * const rtd1319d_dbg_out1_groups[] = {
662 "gpio_0", "gpio_2", "gpio_3", "gpio_4", "gpio_5", "gpio_6",
663 "gpio_7", "gpio_14", "gpio_15", "gpio_18", "gpio_19", "gpio_20",
664 "gpio_21", "gpio_31", "gpio_47", "gpio_50", "gpio_52", "gpio_53" };
665 static const char * const rtd1319d_standby_dbg_groups[] = {
666 "gpio_2", "gpio_3", "ir_rx" };
667 static const char * const rtd1319d_arm_trace_debug_disable_groups[] = { "arm_trace_dbg_en" };
668 static const char * const rtd1319d_arm_trace_debug_enable_groups[] = { "arm_trace_dbg_en" };
669 static const char * const rtd1319d_aucpu_ejtag_disable_groups[] = { "ejtag_aucpu_loc" };
670 static const char * const rtd1319d_acpu_ejtag_disable_groups[] = { "ejtag_acpu_loc" };
671 static const char * const rtd1319d_vcpu_ejtag_disable_groups[] = { "ejtag_vcpu_loc" };
672 static const char * const rtd1319d_scpu_ejtag_disable_groups[] = { "ejtag_scpu_loc" };
673 static const char * const rtd1319d_secpu_ejtag_disable_groups[] = { "ejtag_secpu_loc" };
674 static const char * const rtd1319d_vtc_dmic_loc_disable_groups[] = { "vtc_dmic_loc" };
675 static const char * const rtd1319d_vtc_tdm_disable_groups[] = { "vtc_tdm_loc" };
676 static const char * const rtd1319d_vtc_i2si_disable_groups[] = { "vtc_i2si_loc" };
677 static const char * const rtd1319d_tdm_ai_disable_groups[] = { "tdm_ai_loc" };
678 static const char * const rtd1319d_ai_disable_groups[] = { "ai_loc" };
679 static const char * const rtd1319d_spdif_disable_groups[] = { "spdif_loc" };
680 static const char * const rtd1319d_hif_disable_groups[] = { "hif_en_loc" };
681 static const char * const rtd1319d_hif_enable_groups[] = { "hif_en_loc" };
682 static const char * const rtd1319d_test_loop_groups[] = { "gpio_27" };
683 static const char * const rtd1319d_pmic_pwrup_groups[] = { "gpio_78" };
684
685 #define RTD1319D_FUNC(_name) \
686 { \
687 .name = # _name, \
688 .groups = rtd1319d_ ## _name ## _groups, \
689 .num_groups = ARRAY_SIZE(rtd1319d_ ## _name ## _groups), \
690 }
691
692 static const struct rtd_pin_func_desc rtd1319d_pin_functions[] = {
693 RTD1319D_FUNC(gpio),
694 RTD1319D_FUNC(nf),
695 RTD1319D_FUNC(emmc),
696 RTD1319D_FUNC(tp0),
697 RTD1319D_FUNC(tp1),
698 RTD1319D_FUNC(sc0),
699 RTD1319D_FUNC(sc0_data0),
700 RTD1319D_FUNC(sc0_data1),
701 RTD1319D_FUNC(sc0_data2),
702 RTD1319D_FUNC(sc1),
703 RTD1319D_FUNC(sc1_data0),
704 RTD1319D_FUNC(sc1_data1),
705 RTD1319D_FUNC(sc1_data2),
706 RTD1319D_FUNC(ao),
707 RTD1319D_FUNC(gspi_loc0),
708 RTD1319D_FUNC(gspi_loc1),
709 RTD1319D_FUNC(uart0),
710 RTD1319D_FUNC(uart1),
711 RTD1319D_FUNC(uart2_loc0),
712 RTD1319D_FUNC(uart2_loc1),
713 RTD1319D_FUNC(i2c0),
714 RTD1319D_FUNC(i2c1),
715 RTD1319D_FUNC(i2c3),
716 RTD1319D_FUNC(i2c4),
717 RTD1319D_FUNC(i2c5),
718 RTD1319D_FUNC(pcie1),
719 RTD1319D_FUNC(sdio),
720 RTD1319D_FUNC(etn_led),
721 RTD1319D_FUNC(etn_phy),
722 RTD1319D_FUNC(spi),
723 RTD1319D_FUNC(pwm0_loc0),
724 RTD1319D_FUNC(pwm0_loc1),
725 RTD1319D_FUNC(pwm1_loc0),
726 RTD1319D_FUNC(pwm1_loc1),
727 RTD1319D_FUNC(pwm2_loc0),
728 RTD1319D_FUNC(pwm2_loc1),
729 RTD1319D_FUNC(pwm3_loc0),
730 RTD1319D_FUNC(pwm3_loc1),
731 RTD1319D_FUNC(qam_agc_if0),
732 RTD1319D_FUNC(qam_agc_if1),
733 RTD1319D_FUNC(spdif_optical_loc0),
734 RTD1319D_FUNC(spdif_optical_loc1),
735 RTD1319D_FUNC(usb_cc1),
736 RTD1319D_FUNC(usb_cc2),
737 RTD1319D_FUNC(vfd),
738 RTD1319D_FUNC(sd),
739 RTD1319D_FUNC(dmic_loc0),
740 RTD1319D_FUNC(dmic_loc1),
741 RTD1319D_FUNC(ai_loc0),
742 RTD1319D_FUNC(ai_loc1),
743 RTD1319D_FUNC(tdm_ai_loc0),
744 RTD1319D_FUNC(tdm_ai_loc1),
745 RTD1319D_FUNC(hi_loc0),
746 RTD1319D_FUNC(hi_m),
747 RTD1319D_FUNC(vtc_i2so),
748 RTD1319D_FUNC(vtc_i2si_loc0),
749 RTD1319D_FUNC(vtc_i2si_loc1),
750 RTD1319D_FUNC(vtc_dmic_loc0),
751 RTD1319D_FUNC(vtc_dmic_loc1),
752 RTD1319D_FUNC(vtc_tdm_loc0),
753 RTD1319D_FUNC(vtc_tdm_loc1),
754 RTD1319D_FUNC(dc_fan),
755 RTD1319D_FUNC(pll_test_loc0),
756 RTD1319D_FUNC(pll_test_loc1),
757 RTD1319D_FUNC(ir_rx),
758 RTD1319D_FUNC(uart2_disable),
759 RTD1319D_FUNC(gspi_disable),
760 RTD1319D_FUNC(hi_width_disable),
761 RTD1319D_FUNC(hi_width_1bit),
762 RTD1319D_FUNC(sf_disable),
763 RTD1319D_FUNC(sf_enable),
764 RTD1319D_FUNC(scpu_ejtag_loc0),
765 RTD1319D_FUNC(scpu_ejtag_loc1),
766 RTD1319D_FUNC(scpu_ejtag_loc2),
767 RTD1319D_FUNC(acpu_ejtag_loc0),
768 RTD1319D_FUNC(acpu_ejtag_loc1),
769 RTD1319D_FUNC(acpu_ejtag_loc2),
770 RTD1319D_FUNC(vcpu_ejtag_loc0),
771 RTD1319D_FUNC(vcpu_ejtag_loc1),
772 RTD1319D_FUNC(vcpu_ejtag_loc2),
773 RTD1319D_FUNC(secpu_ejtag_loc0),
774 RTD1319D_FUNC(secpu_ejtag_loc1),
775 RTD1319D_FUNC(secpu_ejtag_loc2),
776 RTD1319D_FUNC(aucpu_ejtag_loc0),
777 RTD1319D_FUNC(aucpu_ejtag_loc1),
778 RTD1319D_FUNC(aucpu_ejtag_loc2),
779 RTD1319D_FUNC(iso_tristate),
780 RTD1319D_FUNC(dbg_out0),
781 RTD1319D_FUNC(dbg_out1),
782 RTD1319D_FUNC(standby_dbg),
783 RTD1319D_FUNC(spdif),
784 RTD1319D_FUNC(arm_trace_debug_disable),
785 RTD1319D_FUNC(arm_trace_debug_enable),
786 RTD1319D_FUNC(aucpu_ejtag_disable),
787 RTD1319D_FUNC(acpu_ejtag_disable),
788 RTD1319D_FUNC(vcpu_ejtag_disable),
789 RTD1319D_FUNC(scpu_ejtag_disable),
790 RTD1319D_FUNC(secpu_ejtag_disable),
791 RTD1319D_FUNC(vtc_dmic_loc_disable),
792 RTD1319D_FUNC(vtc_tdm_disable),
793 RTD1319D_FUNC(vtc_i2si_disable),
794 RTD1319D_FUNC(tdm_ai_disable),
795 RTD1319D_FUNC(ai_disable),
796 RTD1319D_FUNC(spdif_disable),
797 RTD1319D_FUNC(hif_disable),
798 RTD1319D_FUNC(hif_enable),
799 RTD1319D_FUNC(test_loop),
800 RTD1319D_FUNC(pmic_pwrup),
801 };
802
803 #undef RTD1319D_FUNC
804
805 static const struct rtd_pin_desc rtd1319d_iso_muxes[] = {
806 [RTD1319D_ISO_EMMC_RST_N] = RTK_PIN_MUX(emmc_rst_n, 0x0, GENMASK(3, 0),
807 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
808 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 0), "nf"),
809 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 0), "emmc"),
810 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "iso_tristate")),
811 [RTD1319D_ISO_EMMC_DD_SB] = RTK_PIN_MUX(emmc_dd_sb, 0x0, GENMASK(7, 4),
812 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "gpio"),
813 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 4), "emmc"),
814 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 4), "iso_tristate")),
815 [RTD1319D_ISO_EMMC_CLK] = RTK_PIN_MUX(emmc_clk, 0x0, GENMASK(11, 8),
816 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "gpio"),
817 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "nf"),
818 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 8), "emmc"),
819 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 8), "iso_tristate")),
820 [RTD1319D_ISO_EMMC_CMD] = RTK_PIN_MUX(emmc_cmd, 0x0, GENMASK(15, 12),
821 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "gpio"),
822 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 12), "nf"),
823 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 12), "emmc"),
824 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 12), "iso_tristate")),
825 [RTD1319D_ISO_EMMC_DATA_0] = RTK_PIN_MUX(emmc_data_0, 0x0, GENMASK(19, 16),
826 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 16), "gpio"),
827 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 16), "nf"),
828 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 16), "emmc"),
829 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 16), "iso_tristate")),
830 [RTD1319D_ISO_EMMC_DATA_1] = RTK_PIN_MUX(emmc_data_1, 0x0, GENMASK(23, 20),
831 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "gpio"),
832 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 20), "nf"),
833 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 20), "emmc"),
834 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 20), "iso_tristate")),
835 [RTD1319D_ISO_EMMC_DATA_2] = RTK_PIN_MUX(emmc_data_2, 0x0, GENMASK(27, 24),
836 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 24), "gpio"),
837 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 24), "nf"),
838 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 24), "emmc"),
839 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 24), "iso_tristate")),
840 [RTD1319D_ISO_EMMC_DATA_3] = RTK_PIN_MUX(emmc_data_3, 0x0, GENMASK(31, 28),
841 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 28), "gpio"),
842 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 28), "nf"),
843 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 28), "emmc"),
844 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 28), "iso_tristate")),
845
846 [RTD1319D_ISO_EMMC_DATA_4] = RTK_PIN_MUX(emmc_data_4, 0x4, GENMASK(3, 0),
847 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
848 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 0), "nf"),
849 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 0), "emmc"),
850 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "iso_tristate")),
851 [RTD1319D_ISO_EMMC_DATA_5] = RTK_PIN_MUX(emmc_data_5, 0x4, GENMASK(7, 4),
852 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "gpio"),
853 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 4), "nf"),
854 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 4), "emmc"),
855 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 4), "iso_tristate")),
856 [RTD1319D_ISO_EMMC_DATA_6] = RTK_PIN_MUX(emmc_data_6, 0x4, GENMASK(11, 8),
857 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "gpio"),
858 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "nf"),
859 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 8), "emmc"),
860 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 8), "iso_tristate")),
861 [RTD1319D_ISO_EMMC_DATA_7] = RTK_PIN_MUX(emmc_data_7, 0x4, GENMASK(15, 12),
862 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "gpio"),
863 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 12), "nf"),
864 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 12), "emmc"),
865 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 12), "iso_tristate")),
866 [RTD1319D_ISO_GPIO_78] = RTK_PIN_MUX(gpio_78, 0x4, GENMASK(19, 16),
867 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 16), "gpio"),
868 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 16), "nf"),
869 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 16), "pmic_pwrup"),
870 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 16), "iso_tristate")),
871 [RTD1319D_ISO_GPIO_79] = RTK_PIN_MUX(gpio_79, 0x4, GENMASK(23, 20),
872 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "gpio"),
873 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 20), "nf"),
874 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 20), "iso_tristate")),
875 [RTD1319D_ISO_GPIO_80] = RTK_PIN_MUX(gpio_80, 0x4, GENMASK(27, 24),
876 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 24), "gpio"),
877 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 24), "nf"),
878 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 24), "iso_tristate")),
879 [RTD1319D_ISO_GPIO_81] = RTK_PIN_MUX(gpio_81, 0x4, GENMASK(31, 28),
880 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 28), "gpio"),
881 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 28), "nf"),
882 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 28), "iso_tristate")),
883
884 [RTD1319D_ISO_GPIO_0] = RTK_PIN_MUX(gpio_0, 0x8, GENMASK(3, 0),
885 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
886 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "dbg_out1")),
887 [RTD1319D_ISO_GPIO_1] = RTK_PIN_MUX(gpio_1, 0x8, GENMASK(7, 4),
888 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "gpio"),
889 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 4), "iso_tristate")),
890 [RTD1319D_ISO_GPIO_2] = RTK_PIN_MUX(gpio_2, 0x8, GENMASK(11, 8),
891 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "gpio"),
892 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "standby_dbg"),
893 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 8), "tp0"),
894 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 8), "aucpu_ejtag_loc0"),
895 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 8), "sc1"),
896 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 8), "scpu_ejtag_loc0"),
897 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 8), "acpu_ejtag_loc0"),
898 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 8), "vcpu_ejtag_loc0"),
899 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 8), "secpu_ejtag_loc0"),
900 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 8), "vtc_i2so"),
901 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 8), "ao"),
902 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 8), "dbg_out1")),
903 [RTD1319D_ISO_GPIO_3] = RTK_PIN_MUX(gpio_3, 0x8, GENMASK(15, 12),
904 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "gpio"),
905 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 12), "standby_dbg"),
906 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 12), "tp0"),
907 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 12), "aucpu_ejtag_loc0"),
908 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 12), "sc1"),
909 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 12), "scpu_ejtag_loc0"),
910 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 12), "acpu_ejtag_loc0"),
911 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 12), "vcpu_ejtag_loc0"),
912 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 12), "secpu_ejtag_loc0"),
913 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 12), "vtc_i2so"),
914 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 12), "ao"),
915 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 12), "dbg_out1")),
916 [RTD1319D_ISO_GPIO_4] = RTK_PIN_MUX(gpio_4, 0x8, GENMASK(19, 16),
917 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 16), "gpio"),
918 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 16), "tp0"),
919 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 16), "aucpu_ejtag_loc0"),
920 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 16), "scpu_ejtag_loc0"),
921 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 16), "acpu_ejtag_loc0"),
922 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 16), "vcpu_ejtag_loc0"),
923 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 16), "secpu_ejtag_loc0"),
924 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 16), "vtc_i2so"),
925 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 16), "ao"),
926 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 16), "dbg_out1")),
927 [RTD1319D_ISO_GPIO_5] = RTK_PIN_MUX(gpio_5, 0x8, GENMASK(23, 20),
928 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "gpio"),
929 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 20), "aucpu_ejtag_loc0"),
930 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 20), "sc1"),
931 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 20), "scpu_ejtag_loc0"),
932 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 20), "acpu_ejtag_loc0"),
933 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 20), "vcpu_ejtag_loc0"),
934 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 20), "secpu_ejtag_loc0"),
935 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 20), "dbg_out1")),
936 [RTD1319D_ISO_GPIO_6] = RTK_PIN_MUX(gpio_6, 0x8, GENMASK(27, 24),
937 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 24), "gpio"),
938 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 24), "aucpu_ejtag_loc0"),
939 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 24), "spdif_optical_loc1"),
940 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 24), "scpu_ejtag_loc0"),
941 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 24), "acpu_ejtag_loc0"),
942 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 24), "vcpu_ejtag_loc0"),
943 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 24), "secpu_ejtag_loc0"),
944 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 24), "dbg_out1")),
945 [RTD1319D_ISO_GPIO_7] = RTK_PIN_MUX(gpio_7, 0x8, GENMASK(31, 28),
946 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 28), "gpio"),
947 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 28), "dbg_out1")),
948
949 [RTD1319D_ISO_GPIO_8] = RTK_PIN_MUX(gpio_8, 0xc, GENMASK(3, 0),
950 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
951 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 0), "uart1"),
952 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 0), "gspi_loc1"),
953 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "iso_tristate")),
954 [RTD1319D_ISO_GPIO_9] = RTK_PIN_MUX(gpio_9, 0xc, GENMASK(7, 4),
955 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "gpio"),
956 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 4), "uart1"),
957 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 4), "gspi_loc1"),
958 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 4), "iso_tristate")),
959 [RTD1319D_ISO_GPIO_10] = RTK_PIN_MUX(gpio_10, 0xc, GENMASK(11, 8),
960 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "gpio"),
961 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "uart1"),
962 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 8), "gspi_loc1"),
963 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 8), "iso_tristate")),
964 [RTD1319D_ISO_GPIO_11] = RTK_PIN_MUX(gpio_11, 0xc, GENMASK(15, 12),
965 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "gpio"),
966 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 12), "uart1"),
967 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 12), "gspi_loc1"),
968 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 12), "iso_tristate")),
969 [RTD1319D_ISO_GPIO_12] = RTK_PIN_MUX(gpio_12, 0xc, GENMASK(19, 16),
970 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 16), "gpio"),
971 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 16), "i2c0"),
972 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 16), "dbg_out0")),
973 [RTD1319D_ISO_GPIO_13] = RTK_PIN_MUX(gpio_13, 0xc, GENMASK(23, 20),
974 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "gpio"),
975 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 20), "i2c0"),
976 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 20), "dbg_out0")),
977 [RTD1319D_ISO_GPIO_14] = RTK_PIN_MUX(gpio_14, 0xc, GENMASK(27, 24),
978 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 24), "gpio"),
979 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 24), "etn_led"),
980 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 24), "etn_phy"),
981 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 24), "dbg_out1")),
982 [RTD1319D_ISO_GPIO_15] = RTK_PIN_MUX(gpio_15, 0xc, GENMASK(31, 28),
983 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 28), "gpio"),
984 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 28), "etn_led"),
985 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 28), "etn_phy"),
986 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 28), "dbg_out1")),
987
988 [RTD1319D_ISO_GPIO_16] = RTK_PIN_MUX(gpio_16, 0x10, GENMASK(3, 0),
989 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
990 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 0), "i2c1"),
991 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "dbg_out0")),
992 [RTD1319D_ISO_GPIO_17] = RTK_PIN_MUX(gpio_17, 0x10, GENMASK(7, 4),
993 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "gpio"),
994 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 4), "i2c1"),
995 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 4), "dbg_out0")),
996 [RTD1319D_ISO_GPIO_18] = RTK_PIN_MUX(gpio_18, 0x10, GENMASK(11, 8),
997 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "gpio"),
998 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "uart2_loc0"),
999 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 8), "sc0"),
1000 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 8), "gspi_loc0"),
1001 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 8), "spi"),
1002 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 8), "dbg_out1")),
1003 [RTD1319D_ISO_GPIO_19] = RTK_PIN_MUX(gpio_19, 0x10, GENMASK(15, 12),
1004 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "gpio"),
1005 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 12), "uart2_loc0"),
1006 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 12), "sc0"),
1007 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 12), "gspi_loc0"),
1008 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 12), "spi"),
1009 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 12), "dbg_out1")),
1010 [RTD1319D_ISO_GPIO_20] = RTK_PIN_MUX(gpio_20, 0x10, GENMASK(19, 16),
1011 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 16), "gpio"),
1012 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 16), "uart2_loc0"),
1013 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 16), "pwm0_loc1"),
1014 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 16), "gspi_loc0"),
1015 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 16), "sc0_data0"),
1016 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 16), "spi"),
1017 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 16), "dbg_out1")),
1018 [RTD1319D_ISO_GPIO_21] = RTK_PIN_MUX(gpio_21, 0x10, GENMASK(23, 20),
1019 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "gpio"),
1020 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 20), "pwm1_loc1"),
1021 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 20), "qam_agc_if0"),
1022 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 20), "spdif_optical_loc0"),
1023 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 20), "dbg_out1")),
1024 [RTD1319D_ISO_GPIO_22] = RTK_PIN_MUX(gpio_22, 0x10, GENMASK(27, 24),
1025 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 24), "gpio"),
1026 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 24), "pwm2_loc1"),
1027 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 24), "pcie1"),
1028 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 24), "iso_tristate")),
1029 [RTD1319D_ISO_GPIO_23] = RTK_PIN_MUX(gpio_23, 0x10, GENMASK(31, 28),
1030 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 28), "gpio"),
1031 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 28), "pwm3_loc1"),
1032 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 28), "qam_agc_if1"),
1033 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 28), "iso_tristate")),
1034
1035 [RTD1319D_ISO_USB_CC2] = RTK_PIN_MUX(usb_cc2, 0x14, GENMASK(3, 0),
1036 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
1037 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 0), "usb_cc2"),
1038 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "iso_tristate")),
1039 [RTD1319D_ISO_GPIO_25] = RTK_PIN_MUX(gpio_25, 0x14, GENMASK(7, 4),
1040 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "gpio"),
1041 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 4), "uart2_loc1"),
1042 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 4), "iso_tristate")),
1043 [RTD1319D_ISO_GPIO_26] = RTK_PIN_MUX(gpio_26, 0x14, GENMASK(11, 8),
1044 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "gpio"),
1045 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "uart2_loc1"),
1046 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 8), "vfd"),
1047 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 8), "pwm0_loc0"),
1048 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 8), "i2c3"),
1049 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 8), "dbg_out0")),
1050 [RTD1319D_ISO_GPIO_27] = RTK_PIN_MUX(gpio_27, 0x14, GENMASK(15, 12),
1051 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "gpio"),
1052 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 12), "uart2_loc1"),
1053 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 12), "vfd"),
1054 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 12), "pwm1_loc0"),
1055 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 12), "i2c3"),
1056 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 12), "test_loop"),
1057 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 12), "dbg_out0")),
1058 [RTD1319D_ISO_GPIO_28] = RTK_PIN_MUX(gpio_28, 0x14, GENMASK(19, 16),
1059 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 16), "gpio"),
1060 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 16), "uart2_loc1"),
1061 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 16), "vfd"),
1062 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 16), "pwm2_loc0"),
1063 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 16), "iso_tristate")),
1064 [RTD1319D_ISO_GPIO_29] = RTK_PIN_MUX(gpio_29, 0x14, GENMASK(23, 20),
1065 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "gpio"),
1066 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 20), "i2c5"),
1067 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 20), "iso_tristate")),
1068 [RTD1319D_ISO_GPIO_30] = RTK_PIN_MUX(gpio_30, 0x14, GENMASK(27, 24),
1069 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 24), "gpio"),
1070 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 24), "sc0_data1"),
1071 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 24), "iso_tristate")),
1072 [RTD1319D_ISO_GPIO_31] = RTK_PIN_MUX(gpio_31, 0x14, GENMASK(31, 28),
1073 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 28), "gpio"),
1074 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 28), "uart2_loc0"),
1075 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 28), "sc0"),
1076 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 28), "gspi_loc0"),
1077 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 28), "spi"),
1078 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 28), "dbg_out1")),
1079
1080 [RTD1319D_ISO_GPIO_32] = RTK_PIN_MUX(gpio_32, 0x18, GENMASK(3, 0),
1081 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
1082 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 0), "sd"),
1083 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 0), "aucpu_ejtag_loc1"),
1084 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 0), "dmic_loc1"),
1085 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 0), "ai_loc1"),
1086 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 0), "scpu_ejtag_loc1"),
1087 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 0), "acpu_ejtag_loc1"),
1088 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 0), "vcpu_ejtag_loc1"),
1089 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 0), "vtc_i2si_loc1"),
1090 RTK_PIN_FUNC(SHIFT_LEFT(0xe, 0), "secpu_ejtag_loc1"),
1091 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "iso_tristate")),
1092 [RTD1319D_ISO_GPIO_33] = RTK_PIN_MUX(gpio_33, 0x18, GENMASK(7, 4),
1093 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "gpio"),
1094 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 4), "sd"),
1095 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 4), "aucpu_ejtag_loc1"),
1096 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 4), "dmic_loc1"),
1097 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 4), "ai_loc1"),
1098 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 4), "scpu_ejtag_loc1"),
1099 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 4), "acpu_ejtag_loc1"),
1100 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 4), "vcpu_ejtag_loc1"),
1101 RTK_PIN_FUNC(SHIFT_LEFT(0xe, 4), "secpu_ejtag_loc1"),
1102 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 4), "iso_tristate")),
1103 [RTD1319D_ISO_GPIO_34] = RTK_PIN_MUX(gpio_34, 0x18, GENMASK(11, 8),
1104 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "gpio"),
1105 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "sd"),
1106 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 8), "dmic_loc1"),
1107 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 8), "ai_loc1"),
1108 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 8), "i2c4"),
1109 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 8), "sc1_data1"),
1110 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 8), "dbg_out0")),
1111 [RTD1319D_ISO_GPIO_35] = RTK_PIN_MUX(gpio_35, 0x18, GENMASK(15, 12),
1112 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "gpio"),
1113 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 12), "sd"),
1114 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 12), "dmic_loc1"),
1115 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 12), "i2c4"),
1116 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 12), "sc1_data2"),
1117 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 12), "dbg_out0")),
1118 [RTD1319D_ISO_HIF_DATA] = RTK_PIN_MUX(hif_data, 0x18, GENMASK(19, 16),
1119 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 16), "gpio"),
1120 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 16), "sd"),
1121 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 16), "aucpu_ejtag_loc1"),
1122 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 16), "dmic_loc1"),
1123 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 16), "tdm_ai_loc1"),
1124 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 16), "scpu_ejtag_loc1"),
1125 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 16), "acpu_ejtag_loc1"),
1126 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 16), "vcpu_ejtag_loc1"),
1127 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 16), "ai_loc1"),
1128 RTK_PIN_FUNC(SHIFT_LEFT(0x9, 16), "hi_loc0"),
1129 RTK_PIN_FUNC(SHIFT_LEFT(0xa, 16), "hi_m"),
1130 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 16), "vtc_i2si_loc1"),
1131 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 16), "vtc_tdm_loc1"),
1132 RTK_PIN_FUNC(SHIFT_LEFT(0xd, 16), "vtc_dmic_loc1"),
1133 RTK_PIN_FUNC(SHIFT_LEFT(0xe, 16), "secpu_ejtag_loc1"),
1134 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 16), "iso_tristate")),
1135 [RTD1319D_ISO_HIF_EN] = RTK_PIN_MUX(hif_en, 0x18, GENMASK(23, 20),
1136 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "gpio"),
1137 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 20), "sd"),
1138 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 20), "aucpu_ejtag_loc1"),
1139 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 20), "dmic_loc1"),
1140 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 20), "tdm_ai_loc1"),
1141 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 20), "scpu_ejtag_loc1"),
1142 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 20), "acpu_ejtag_loc1"),
1143 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 20), "vcpu_ejtag_loc1"),
1144 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 20), "ai_loc1"),
1145 RTK_PIN_FUNC(SHIFT_LEFT(0x9, 20), "hi_loc0"),
1146 RTK_PIN_FUNC(SHIFT_LEFT(0xa, 20), "hi_m"),
1147 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 20), "vtc_i2si_loc1"),
1148 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 20), "vtc_tdm_loc1"),
1149 RTK_PIN_FUNC(SHIFT_LEFT(0xd, 20), "vtc_dmic_loc1"),
1150 RTK_PIN_FUNC(SHIFT_LEFT(0xe, 20), "secpu_ejtag_loc1"),
1151 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 20), "iso_tristate")),
1152 [RTD1319D_ISO_HIF_RDY] = RTK_PIN_MUX(hif_rdy, 0x18, GENMASK(27, 24),
1153 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 24), "gpio"),
1154 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 24), "sd"),
1155 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 24), "dmic_loc1"),
1156 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 24), "tdm_ai_loc1"),
1157 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 24), "ai_loc1"),
1158 RTK_PIN_FUNC(SHIFT_LEFT(0x9, 24), "hi_loc0"),
1159 RTK_PIN_FUNC(SHIFT_LEFT(0xa, 24), "hi_m"),
1160 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 24), "vtc_i2si_loc1"),
1161 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 24), "vtc_tdm_loc1"),
1162 RTK_PIN_FUNC(SHIFT_LEFT(0xd, 24), "vtc_dmic_loc1"),
1163 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 24), "iso_tristate")),
1164 [RTD1319D_ISO_HIF_CLK] = RTK_PIN_MUX(hif_clk, 0x18, GENMASK(31, 28),
1165 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 28), "gpio"),
1166 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 28), "sd"),
1167 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 28), "aucpu_ejtag_loc1"),
1168 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 28), "dmic_loc1"),
1169 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 28), "tdm_ai_loc1"),
1170 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 28), "scpu_ejtag_loc1"),
1171 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 28), "acpu_ejtag_loc1"),
1172 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 28), "vcpu_ejtag_loc1"),
1173 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 28), "ai_loc1"),
1174 RTK_PIN_FUNC(SHIFT_LEFT(0x9, 28), "hi_loc0"),
1175 RTK_PIN_FUNC(SHIFT_LEFT(0xa, 28), "hi_m"),
1176 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 28), "vtc_i2si_loc1"),
1177 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 28), "vtc_tdm_loc1"),
1178 RTK_PIN_FUNC(SHIFT_LEFT(0xd, 28), "vtc_dmic_loc1"),
1179 RTK_PIN_FUNC(SHIFT_LEFT(0xe, 28), "secpu_ejtag_loc1"),
1180 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 28), "iso_tristate")),
1181
1182 [RTD1319D_ISO_GPIO_40] = RTK_PIN_MUX(gpio_40, 0x1c, GENMASK(3, 0),
1183 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
1184 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 0), "sdio"),
1185 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "iso_tristate")),
1186 [RTD1319D_ISO_GPIO_41] = RTK_PIN_MUX(gpio_41, 0x1c, GENMASK(7, 4),
1187 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "gpio"),
1188 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 4), "sdio"),
1189 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 4), "iso_tristate")),
1190 [RTD1319D_ISO_GPIO_42] = RTK_PIN_MUX(gpio_42, 0x1c, GENMASK(11, 8),
1191 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "gpio"),
1192 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 8), "sdio"),
1193 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 8), "iso_tristate")),
1194 [RTD1319D_ISO_GPIO_43] = RTK_PIN_MUX(gpio_43, 0x1c, GENMASK(15, 12),
1195 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "gpio"),
1196 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 12), "sdio"),
1197 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 12), "iso_tristate")),
1198 [RTD1319D_ISO_GPIO_44] = RTK_PIN_MUX(gpio_44, 0x1c, GENMASK(19, 16),
1199 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 16), "gpio"),
1200 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 16), "sdio"),
1201 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 16), "iso_tristate")),
1202 [RTD1319D_ISO_GPIO_45] = RTK_PIN_MUX(gpio_45, 0x1c, GENMASK(23, 20),
1203 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "gpio"),
1204 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 20), "sdio"),
1205 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 20), "iso_tristate")),
1206 [RTD1319D_ISO_GPIO_46] = RTK_PIN_MUX(gpio_46, 0x1c, GENMASK(27, 24),
1207 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 24), "gpio"),
1208 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 24), "i2c5"),
1209 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 24), "iso_tristate")),
1210 [RTD1319D_ISO_GPIO_47] = RTK_PIN_MUX(gpio_47, 0x1c, GENMASK(31, 28),
1211 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 28), "gpio"),
1212 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 28), "dc_fan"),
1213 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 28), "pwm3_loc0"),
1214 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 28), "sc0_data2"),
1215 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 28), "dbg_out1")),
1216
1217 [RTD1319D_ISO_GPIO_48] = RTK_PIN_MUX(gpio_48, 0x20, GENMASK(3, 0),
1218 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
1219 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 0), "pll_test_loc1"),
1220 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "dbg_out0")),
1221 [RTD1319D_ISO_GPIO_49] = RTK_PIN_MUX(gpio_49, 0x20, GENMASK(7, 4),
1222 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "gpio"),
1223 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 4), "pll_test_loc1"),
1224 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 4), "dbg_out0")),
1225 [RTD1319D_ISO_GPIO_50] = RTK_PIN_MUX(gpio_50, 0x20, GENMASK(11, 8),
1226 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "gpio"),
1227 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "spdif"),
1228 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 8), "dbg_out1")),
1229 [RTD1319D_ISO_USB_CC1] = RTK_PIN_MUX(usb_cc1, 0x20, GENMASK(15, 12),
1230 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "gpio"),
1231 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 12), "usb_cc1"),
1232 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 12), "iso_tristate")),
1233 [RTD1319D_ISO_GPIO_52] = RTK_PIN_MUX(gpio_52, 0x20, GENMASK(19, 16),
1234 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 16), "gpio"),
1235 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 16), "pll_test_loc0"),
1236 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 16), "sc1_data0"),
1237 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 16), "dbg_out1")),
1238 [RTD1319D_ISO_GPIO_53] = RTK_PIN_MUX(gpio_53, 0x20, GENMASK(23, 20),
1239 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "gpio"),
1240 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 20), "pll_test_loc0"),
1241 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 20), "dbg_out1")),
1242 [RTD1319D_ISO_IR_RX] = RTK_PIN_MUX(ir_rx, 0x20, GENMASK(27, 24),
1243 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 24), "gpio"),
1244 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 24), "ir_rx"),
1245 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 24), "standby_dbg"),
1246 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 24), "iso_tristate")),
1247 [RTD1319D_ISO_UR0_RX] = RTK_PIN_MUX(ur0_rx, 0x20, GENMASK(31, 28),
1248 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 28), "gpio"),
1249 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 28), "uart0"),
1250 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 28), "iso_tristate")),
1251
1252 [RTD1319D_ISO_UR0_TX] = RTK_PIN_MUX(ur0_tx, 0x24, GENMASK(3, 0),
1253 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
1254 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 0), "uart0"),
1255 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "iso_tristate")),
1256 [RTD1319D_ISO_GPIO_57] = RTK_PIN_MUX(gpio_57, 0x24, GENMASK(7, 4),
1257 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "gpio"),
1258 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 4), "tdm_ai_loc0"),
1259 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 4), "ai_loc0"),
1260 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 4), "dmic_loc0"),
1261 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 4), "tp0"),
1262 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 4), "acpu_ejtag_loc2"),
1263 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 4), "vcpu_ejtag_loc2"),
1264 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 4), "secpu_ejtag_loc2"),
1265 RTK_PIN_FUNC(SHIFT_LEFT(0x9, 4), "aucpu_ejtag_loc2"),
1266 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 4), "vtc_i2si_loc0"),
1267 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 4), "vtc_tdm_loc0"),
1268 RTK_PIN_FUNC(SHIFT_LEFT(0xd, 4), "vtc_dmic_loc0"),
1269 RTK_PIN_FUNC(SHIFT_LEFT(0xe, 4), "scpu_ejtag_loc2"),
1270 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 4), "dbg_out0")),
1271 [RTD1319D_ISO_GPIO_58] = RTK_PIN_MUX(gpio_58, 0x24, GENMASK(11, 8),
1272 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "gpio"),
1273 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "tdm_ai_loc0"),
1274 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 8), "ai_loc0"),
1275 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 8), "dmic_loc0"),
1276 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 8), "tp0"),
1277 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 8), "acpu_ejtag_loc2"),
1278 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 8), "vcpu_ejtag_loc2"),
1279 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 8), "secpu_ejtag_loc2"),
1280 RTK_PIN_FUNC(SHIFT_LEFT(0x9, 8), "aucpu_ejtag_loc2"),
1281 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 8), "vtc_i2si_loc0"),
1282 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 8), "vtc_tdm_loc0"),
1283 RTK_PIN_FUNC(SHIFT_LEFT(0xd, 8), "vtc_dmic_loc0"),
1284 RTK_PIN_FUNC(SHIFT_LEFT(0xe, 8), "scpu_ejtag_loc2"),
1285 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 8), "dbg_out0")),
1286 [RTD1319D_ISO_GPIO_59] = RTK_PIN_MUX(gpio_59, 0x24, GENMASK(15, 12),
1287 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "gpio"),
1288 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 12), "tdm_ai_loc0"),
1289 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 12), "ai_loc0"),
1290 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 12), "dmic_loc0"),
1291 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 12), "tp0"),
1292 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 12), "acpu_ejtag_loc2"),
1293 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 12), "vcpu_ejtag_loc2"),
1294 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 12), "secpu_ejtag_loc2"),
1295 RTK_PIN_FUNC(SHIFT_LEFT(0x9, 12), "aucpu_ejtag_loc2"),
1296 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 12), "vtc_i2si_loc0"),
1297 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 12), "vtc_tdm_loc0"),
1298 RTK_PIN_FUNC(SHIFT_LEFT(0xd, 12), "vtc_dmic_loc0"),
1299 RTK_PIN_FUNC(SHIFT_LEFT(0xe, 12), "scpu_ejtag_loc2"),
1300 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 12), "dbg_out0")),
1301 [RTD1319D_ISO_GPIO_60] = RTK_PIN_MUX(gpio_60, 0x24, GENMASK(19, 16),
1302 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 16), "gpio"),
1303 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 16), "tdm_ai_loc0"),
1304 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 16), "ai_loc0"),
1305 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 16), "dmic_loc0"),
1306 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 16), "tp0"),
1307 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 16), "acpu_ejtag_loc2"),
1308 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 16), "vcpu_ejtag_loc2"),
1309 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 16), "secpu_ejtag_loc2"),
1310 RTK_PIN_FUNC(SHIFT_LEFT(0x9, 16), "aucpu_ejtag_loc2"),
1311 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 16), "vtc_i2si_loc0"),
1312 RTK_PIN_FUNC(SHIFT_LEFT(0xc, 16), "vtc_tdm_loc0"),
1313 RTK_PIN_FUNC(SHIFT_LEFT(0xd, 16), "vtc_dmic_loc0"),
1314 RTK_PIN_FUNC(SHIFT_LEFT(0xe, 16), "scpu_ejtag_loc2"),
1315 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 16), "dbg_out0")),
1316 [RTD1319D_ISO_GPIO_61] = RTK_PIN_MUX(gpio_61, 0x24, GENMASK(23, 20),
1317 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "gpio"),
1318 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 20), "ai_loc0"),
1319 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 20), "ao"),
1320 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 20), "dmic_loc0"),
1321 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 20), "tp0"),
1322 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 20), "tp1"),
1323 RTK_PIN_FUNC(SHIFT_LEFT(0x6, 20), "acpu_ejtag_loc2"),
1324 RTK_PIN_FUNC(SHIFT_LEFT(0x7, 20), "vcpu_ejtag_loc2"),
1325 RTK_PIN_FUNC(SHIFT_LEFT(0x8, 20), "secpu_ejtag_loc2"),
1326 RTK_PIN_FUNC(SHIFT_LEFT(0x9, 20), "aucpu_ejtag_loc2"),
1327 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 20), "vtc_i2si_loc0"),
1328 RTK_PIN_FUNC(SHIFT_LEFT(0xe, 20), "scpu_ejtag_loc2"),
1329 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 20), "dbg_out0")),
1330 [RTD1319D_ISO_GPIO_62] = RTK_PIN_MUX(gpio_62, 0x24, GENMASK(27, 24),
1331 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 24), "gpio"),
1332 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 24), "ai_loc0"),
1333 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 24), "ao"),
1334 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 24), "dmic_loc0"),
1335 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 24), "tp0"),
1336 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 24), "tp1"),
1337 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 24), "iso_tristate")),
1338 [RTD1319D_ISO_GPIO_63] = RTK_PIN_MUX(gpio_63, 0x24, GENMASK(31, 28),
1339 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 28), "gpio"),
1340 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 28), "ai_loc0"),
1341 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 28), "ao"),
1342 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 28), "dmic_loc0"),
1343 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 28), "tp0"),
1344 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 28), "tp1"),
1345 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 28), "iso_tristate")),
1346
1347 [RTD1319D_ISO_GPIO_64] = RTK_PIN_MUX(gpio_64, 0x28, GENMASK(3, 0),
1348 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "gpio"),
1349 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 0), "ao"),
1350 RTK_PIN_FUNC(SHIFT_LEFT(0x3, 0), "dmic_loc0"),
1351 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 0), "tp0"),
1352 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 0), "tp1"),
1353 RTK_PIN_FUNC(SHIFT_LEFT(0xb, 0), "vtc_i2so"),
1354 RTK_PIN_FUNC(SHIFT_LEFT(0xf, 0), "iso_tristate")),
1355
1356 [RTD1319D_ISO_UR2_LOC] = RTK_PIN_MUX(ur2_loc, 0x120, GENMASK(1, 0),
1357 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "uart2_disable"),
1358 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 0), "uart2_loc0"),
1359 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 0), "uart2_loc1")),
1360 [RTD1319D_ISO_GSPI_LOC] = RTK_PIN_MUX(gspi_loc, 0x120, GENMASK(3, 2),
1361 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 2), "gspi_disable"),
1362 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 2), "gspi_loc0"),
1363 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 2), "gspi_loc1")),
1364 [RTD1319D_ISO_HI_WIDTH] = RTK_PIN_MUX(hi_width, 0x120, GENMASK(9, 8),
1365 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "hi_width_disable"),
1366 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "hi_width_1bit")),
1367 [RTD1319D_ISO_SF_EN] = RTK_PIN_MUX(sf_en, 0x120, GENMASK(11, 11),
1368 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 11), "sf_disable"),
1369 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 11), "sf_enable")),
1370 [RTD1319D_ISO_ARM_TRACE_DBG_EN] = RTK_PIN_MUX(arm_trace_dbg_en, 0x120, GENMASK(12, 12),
1371 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 12), "arm_trace_debug_disable"),
1372 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 12), "arm_trace_debug_enable")),
1373 [RTD1319D_ISO_EJTAG_AUCPU_LOC] = RTK_PIN_MUX(ejtag_aucpu_loc, 0x120, GENMASK(16, 14),
1374 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 14), "aucpu_ejtag_disable"),
1375 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 14), "aucpu_ejtag_loc0"),
1376 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 14), "aucpu_ejtag_loc1"),
1377 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 14), "aucpu_ejtag_loc2")),
1378 [RTD1319D_ISO_EJTAG_ACPU_LOC] = RTK_PIN_MUX(ejtag_acpu_loc, 0x120, GENMASK(19, 17),
1379 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 17), "acpu_ejtag_disable"),
1380 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 17), "acpu_ejtag_loc0"),
1381 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 17), "acpu_ejtag_loc1"),
1382 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 17), "acpu_ejtag_loc2")),
1383 [RTD1319D_ISO_EJTAG_VCPU_LOC] = RTK_PIN_MUX(ejtag_vcpu_loc, 0x120, GENMASK(22, 20),
1384 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 20), "vcpu_ejtag_disable"),
1385 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 20), "vcpu_ejtag_loc0"),
1386 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 20), "vcpu_ejtag_loc1"),
1387 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 20), "vcpu_ejtag_loc2")),
1388 [RTD1319D_ISO_EJTAG_SCPU_LOC] = RTK_PIN_MUX(ejtag_scpu_loc, 0x120, GENMASK(25, 23),
1389 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 23), "scpu_ejtag_disable"),
1390 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 23), "scpu_ejtag_loc0"),
1391 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 23), "scpu_ejtag_loc1"),
1392 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 23), "scpu_ejtag_loc2")),
1393 [RTD1319D_ISO_DMIC_LOC] = RTK_PIN_MUX(dmic_loc, 0x120, GENMASK(27, 26),
1394 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 26), "dmic_loc0"),
1395 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 26), "dmic_loc1")),
1396
1397 [RTD1319D_ISO_EJTAG_SECPU_LOC] = RTK_PIN_MUX(ejtag_secpu_loc, 0x124, GENMASK(20, 18),
1398 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 18), "secpu_ejtag_disable"),
1399 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 18), "secpu_ejtag_loc0"),
1400 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 18), "secpu_ejtag_loc1"),
1401 RTK_PIN_FUNC(SHIFT_LEFT(0x4, 18), "secpu_ejtag_loc2")),
1402
1403 [RTD1319D_ISO_VTC_DMIC_LOC] = RTK_PIN_MUX(vtc_dmic_loc, 0x128, GENMASK(1, 0),
1404 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 0), "vtc_dmic_loc_disable"),
1405 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 0), "vtc_dmic_loc0"),
1406 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 0), "vtc_dmic_loc1")),
1407 [RTD1319D_ISO_VTC_TDM_LOC] = RTK_PIN_MUX(vtc_tdm_loc, 0x128, GENMASK(3, 2),
1408 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 2), "vtc_tdm_disable"),
1409 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 2), "vtc_tdm_loc0"),
1410 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 2), "vtc_tdm_loc1")),
1411 [RTD1319D_ISO_VTC_I2SI_LOC] = RTK_PIN_MUX(vtc_i2si_loc, 0x128, GENMASK(5, 4),
1412 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 4), "vtc_i2si_disable"),
1413 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 4), "vtc_i2si_loc0"),
1414 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 4), "vtc_i2si_loc1")),
1415 [RTD1319D_ISO_TDM_AI_LOC] = RTK_PIN_MUX(tdm_ai_loc, 0x128, GENMASK(7, 6),
1416 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 6), "tdm_ai_disable"),
1417 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 6), "tdm_ai_loc0"),
1418 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 6), "tdm_ai_loc1")),
1419 [RTD1319D_ISO_AI_LOC] = RTK_PIN_MUX(ai_loc, 0x128, GENMASK(9, 8),
1420 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "ai_disable"),
1421 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "ai_loc0"),
1422 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 8), "ai_loc1")),
1423 [RTD1319D_ISO_SPDIF_LOC] = RTK_PIN_MUX(spdif_loc, 0x128, GENMASK(11, 10),
1424 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 10), "spdif_disable"),
1425 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 10), "spdif_optical_loc0"),
1426 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 10), "spdif_optical_loc1")),
1427
1428 [RTD1319D_ISO_HIF_EN_LOC] = RTK_PIN_MUX(hif_en_loc, 0x12c, GENMASK(2, 0),
1429 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 0), "hif_disable"),
1430 RTK_PIN_FUNC(SHIFT_LEFT(0x5, 0), "hif_enable")),
1431 [RTD1319D_ISO_SC0_LOC] = RTK_PIN_MUX(sc0_loc, 0x188, GENMASK(9, 8),
1432 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 8), "sc0_data0"),
1433 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 8), "sc0_data1"),
1434 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 8), "sc0_data2")),
1435 [RTD1319D_ISO_SC1_LOC] = RTK_PIN_MUX(sc1_loc, 0x188, GENMASK(11, 10),
1436 RTK_PIN_FUNC(SHIFT_LEFT(0x0, 10), "sc1_data0"),
1437 RTK_PIN_FUNC(SHIFT_LEFT(0x1, 10), "sc1_data1"),
1438 RTK_PIN_FUNC(SHIFT_LEFT(0x2, 10), "sc1_data2")),
1439
1440 [RTD1319D_ISO_TESTMODE] = {0},
1441 };
1442
1443 static const struct rtd_pin_config_desc rtd1319d_iso_configs[] = {
1444 [RTD1319D_ISO_SCAN_SWITCH] = RTK_PIN_CONFIG(scan_switch, 0x2c, 0, NA, NA, 0, 1, 2, PADDRI_4_8),
1445 [RTD1319D_ISO_GPIO_18] = RTK_PIN_CONFIG(gpio_18, 0x2c, 3, 1, 2, 0, 3, 4, PADDRI_4_8),
1446 [RTD1319D_ISO_GPIO_19] = RTK_PIN_CONFIG(gpio_19, 0x2c, 8, 1, 2, 0, 3, 4, PADDRI_4_8),
1447 [RTD1319D_ISO_GPIO_20] = RTK_PIN_CONFIG(gpio_20, 0x2c, 13, 1, 2, 0, 3, 4, PADDRI_4_8),
1448 [RTD1319D_ISO_GPIO_31] = RTK_PIN_CONFIG(gpio_31, 0x2c, 18, 1, 2, 0, 3, 4, PADDRI_4_8),
1449 [RTD1319D_ISO_GPIO_8] = RTK_PIN_CONFIG(gpio_8, 0x2c, 23, 1, 2, 0, 3, 4, PADDRI_4_8),
1450 [RTD1319D_ISO_GPIO_9] = RTK_PIN_CONFIG(gpio_9, 0x30, 0, 1, 2, 0, 3, 4, PADDRI_4_8),
1451 [RTD1319D_ISO_GPIO_10] = RTK_PIN_CONFIG(gpio_10, 0x30, 5, 1, 2, 0, 3, 4, PADDRI_4_8),
1452 [RTD1319D_ISO_GPIO_11] = RTK_PIN_CONFIG(gpio_11, 0x30, 10, 1, 2, 0, 3, 4, PADDRI_4_8),
1453 [RTD1319D_ISO_GPIO_0] = RTK_PIN_CONFIG(gpio_0, 0x30, 15, 1, 2, 0, 3, 4, PADDRI_4_8),
1454 [RTD1319D_ISO_GPIO_1] = RTK_PIN_CONFIG(gpio_1, 0x30, 20, 1, 2, 0, 3, 4, PADDRI_4_8),
1455 [RTD1319D_ISO_GPIO_5] = RTK_PIN_CONFIG(gpio_5, 0x30, 25, 1, 2, 0, 3, 4, PADDRI_4_8),
1456 [RTD1319D_ISO_GPIO_6] = RTK_PIN_CONFIG(gpio_6, 0x34, 0, 1, 2, 0, 3, 4, PADDRI_4_8),
1457 [RTD1319D_ISO_GPIO_12] = RTK_PIN_CONFIG(gpio_12, 0x34, 5, 1, 2, 0, 3, 4, PADDRI_4_8),
1458 [RTD1319D_ISO_GPIO_13] = RTK_PIN_CONFIG(gpio_13, 0x34, 10, 1, 2, 0, 3, 4, PADDRI_4_8),
1459 [RTD1319D_ISO_GPIO_22] = RTK_PIN_CONFIG(gpio_22, 0x34, 15, 1, 2, 0, 3, 4, PADDRI_4_8),
1460 [RTD1319D_ISO_USB_CC2] = RTK_PIN_CONFIG(usb_cc2, 0x34, 20, NA, NA, 0, 1, 2, PADDRI_4_8),
1461 [RTD1319D_ISO_GPIO_29] = RTK_PIN_CONFIG(gpio_29, 0x34, 23, 1, 2, 0, 3, 4, PADDRI_4_8),
1462 [RTD1319D_ISO_GPIO_46] = RTK_PIN_CONFIG(gpio_46, 0x38, 0, 1, 2, 0, 3, 4, PADDRI_4_8),
1463 [RTD1319D_ISO_GPIO_47] = RTK_PIN_CONFIG(gpio_47, 0x38, 5, 1, 2, 0, 3, 4, PADDRI_4_8),
1464 [RTD1319D_ISO_USB_CC1] = RTK_PIN_CONFIG(usb_cc1, 0x38, 10, NA, NA, 0, 1, 2, PADDRI_4_8),
1465 [RTD1319D_ISO_WD_RSET] = RTK_PIN_CONFIG(wd_rset, 0x38, 13, 1, 2, 0, 3, 4, PADDRI_4_8),
1466 [RTD1319D_ISO_IR_RX] = RTK_PIN_CONFIG(ir_rx, 0x38, 18, 1, 2, 0, 3, 4, PADDRI_4_8),
1467 [RTD1319D_ISO_BOOT_SEL] = RTK_PIN_CONFIG(boot_sel, 0x38, 23, 0, 1, NA, 2, 3, PADDRI_4_8),
1468 [RTD1319D_ISO_RESET_N] = RTK_PIN_CONFIG(reset_n, 0x38, 27, 0, 1, NA, 2, 3, PADDRI_4_8),
1469 [RTD1319D_ISO_TESTMODE] = RTK_PIN_CONFIG(testmode, 0x3c, 0, 0, 1, NA, 2, 3, PADDRI_4_8),
1470 [RTD1319D_ISO_GPIO_40] = RTK_PIN_CONFIG(gpio_40, 0x3c, 4, 0, 1, NA, 2, 12, NA),
1471 [RTD1319D_ISO_GPIO_41] = RTK_PIN_CONFIG(gpio_41, 0x3c, 17, 0, 1, NA, 2, 12, NA),
1472 [RTD1319D_ISO_GPIO_42] = RTK_PIN_CONFIG(gpio_42, 0x40, 0, 0, 1, NA, 2, 12, NA),
1473 [RTD1319D_ISO_GPIO_43] = RTK_PIN_CONFIG(gpio_43, 0x40, 13, 0, 1, NA, 2, 12, NA),
1474 [RTD1319D_ISO_GPIO_44] = RTK_PIN_CONFIG(gpio_44, 0x44, 0, 0, 1, NA, 2, 12, NA),
1475 [RTD1319D_ISO_GPIO_45] = RTK_PIN_CONFIG(gpio_45, 0x44, 13, 0, 1, NA, 2, 12, NA),
1476 [RTD1319D_ISO_EMMC_DATA_0] = RTK_PIN_CONFIG(emmc_data_0, 0x48, 0, 0, 1, NA, 2, 12, NA),
1477 [RTD1319D_ISO_EMMC_DATA_1] = RTK_PIN_CONFIG(emmc_data_1, 0x48, 13, 0, 1, NA, 2, 12, NA),
1478 [RTD1319D_ISO_EMMC_DATA_2] = RTK_PIN_CONFIG(emmc_data_2, 0x4c, 0, 0, 1, NA, 2, 12, NA),
1479 [RTD1319D_ISO_EMMC_DATA_3] = RTK_PIN_CONFIG(emmc_data_3, 0x4c, 13, 0, 1, NA, 2, 12, NA),
1480 [RTD1319D_ISO_EMMC_DATA_4] = RTK_PIN_CONFIG(emmc_data_4, 0x50, 0, 0, 1, NA, 2, 12, NA),
1481 [RTD1319D_ISO_EMMC_DATA_5] = RTK_PIN_CONFIG(emmc_data_5, 0x50, 13, 0, 1, NA, 2, 12, NA),
1482 [RTD1319D_ISO_EMMC_DATA_6] = RTK_PIN_CONFIG(emmc_data_6, 0x54, 0, 0, 1, NA, 2, 12, NA),
1483 [RTD1319D_ISO_EMMC_DATA_7] = RTK_PIN_CONFIG(emmc_data_7, 0x54, 13, 0, 1, NA, 2, 12, NA),
1484 [RTD1319D_ISO_EMMC_DD_SB] = RTK_PIN_CONFIG(emmc_dd_sb, 0x58, 0, 0, 1, NA, 2, 12, NA),
1485 [RTD1319D_ISO_EMMC_RST_N] = RTK_PIN_CONFIG(emmc_rst_n, 0x58, 13, 0, 1, NA, 2, 12, NA),
1486 [RTD1319D_ISO_EMMC_CMD] = RTK_PIN_CONFIG(emmc_cmd, 0x5c, 0, 0, 1, NA, 2, 13, NA),
1487 [RTD1319D_ISO_EMMC_CLK] = RTK_PIN_CONFIG(emmc_clk, 0x5c, 14, 0, 1, NA, 2, 12, NA),
1488 [RTD1319D_ISO_GPIO_80] = RTK_PIN_CONFIG(gpio_80, 0x60, 0, 0, 1, NA, 2, 12, NA),
1489 [RTD1319D_ISO_GPIO_78] = RTK_PIN_CONFIG(gpio_78, 0x60, 13, 0, 1, NA, 2, 12, NA),
1490 [RTD1319D_ISO_GPIO_79] = RTK_PIN_CONFIG(gpio_79, 0x64, 0, 0, 1, NA, 2, 12, NA),
1491 [RTD1319D_ISO_GPIO_81] = RTK_PIN_CONFIG(gpio_81, 0x64, 13, 0, 1, NA, 2, 12, NA),
1492 [RTD1319D_ISO_GPIO_2] = RTK_PIN_CONFIG(gpio_2, 0x64, 26, 1, 2, 0, 3, 4, PADDRI_4_8),
1493 [RTD1319D_ISO_GPIO_3] = RTK_PIN_CONFIG(gpio_3, 0x68, 0, 1, 2, 0, 3, 4, PADDRI_4_8),
1494 [RTD1319D_ISO_GPIO_4] = RTK_PIN_CONFIG(gpio_4, 0x68, 5, 1, 2, 0, 3, 4, PADDRI_4_8),
1495 [RTD1319D_ISO_GPIO_57] = RTK_PIN_CONFIG(gpio_57, 0x68, 10, 1, 2, 0, 3, 4, PADDRI_4_8),
1496 [RTD1319D_ISO_GPIO_58] = RTK_PIN_CONFIG(gpio_58, 0x68, 15, 1, 2, 0, 3, 4, PADDRI_4_8),
1497 [RTD1319D_ISO_GPIO_59] = RTK_PIN_CONFIG(gpio_59, 0x68, 20, 1, 2, 0, 3, 4, PADDRI_4_8),
1498 [RTD1319D_ISO_GPIO_60] = RTK_PIN_CONFIG(gpio_60, 0x68, 25, 1, 2, 0, 3, 4, PADDRI_4_8),
1499 [RTD1319D_ISO_GPIO_61] = RTK_PIN_CONFIG(gpio_61, 0x6c, 0, 1, 2, 0, 3, 4, PADDRI_4_8),
1500 [RTD1319D_ISO_GPIO_62] = RTK_PIN_CONFIG(gpio_62, 0x6c, 5, 1, 2, 0, 3, 4, PADDRI_4_8),
1501 [RTD1319D_ISO_GPIO_63] = RTK_PIN_CONFIG(gpio_63, 0x6c, 10, 1, 2, 0, 3, 4, PADDRI_4_8),
1502 [RTD1319D_ISO_GPIO_64] = RTK_PIN_CONFIG(gpio_64, 0x6c, 15, 1, 2, 0, 3, 4, PADDRI_4_8),
1503 [RTD1319D_ISO_GPIO_7] = RTK_PIN_CONFIG(gpio_7, 0x6c, 20, 1, 2, 0, 3, 4, PADDRI_4_8),
1504 [RTD1319D_ISO_GPIO_16] = RTK_PIN_CONFIG(gpio_16, 0x6c, 25, 1, 2, 0, 3, 4, PADDRI_4_8),
1505 [RTD1319D_ISO_GPIO_17] = RTK_PIN_CONFIG(gpio_17, 0x70, 0, 1, 2, 0, 3, 4, PADDRI_4_8),
1506 [RTD1319D_ISO_GPIO_21] = RTK_PIN_CONFIG(gpio_21, 0x70, 5, 1, 2, 0, 3, 4, PADDRI_4_8),
1507 [RTD1319D_ISO_GPIO_23] = RTK_PIN_CONFIG(gpio_23, 0x70, 10, 1, 2, 0, 3, 4, PADDRI_4_8),
1508 [RTD1319D_ISO_GPIO_50] = RTK_PIN_CONFIG(gpio_50, 0x70, 15, 1, 2, 0, 3, 4, PADDRI_4_8),
1509 [RTD1319D_ISO_HIF_EN] = RTK_PIN_CONFIG(hif_en, 0x74, 0, 0, 1, NA, 2, 12, NA),
1510 [RTD1319D_ISO_HIF_DATA] = RTK_PIN_CONFIG(hif_data, 0x74, 13, 0, 1, NA, 2, 12, NA),
1511 [RTD1319D_ISO_GPIO_33] = RTK_PIN_CONFIG(gpio_33, 0x78, 0, 0, 1, NA, 2, 12, NA),
1512 [RTD1319D_ISO_GPIO_32] = RTK_PIN_CONFIG(gpio_32, 0x78, 13, 0, 1, NA, 2, 12, NA),
1513 [RTD1319D_ISO_HIF_CLK] = RTK_PIN_CONFIG(hif_clk, 0x7c, 0, 0, 1, NA, 2, 12, NA),
1514 [RTD1319D_ISO_HIF_RDY] = RTK_PIN_CONFIG(hif_rdy, 0x7c, 13, 0, 1, NA, 2, 12, NA),
1515 [RTD1319D_ISO_GPIO_14] = RTK_PIN_CONFIG(gpio_14, 0x7c, 26, 1, 2, 0, 3, 4, PADDRI_4_8),
1516 [RTD1319D_ISO_GPIO_15] = RTK_PIN_CONFIG(gpio_15, 0x80, 0, 1, 2, 0, 3, 4, PADDRI_4_8),
1517 [RTD1319D_ISO_GPIO_25] = RTK_PIN_CONFIG(gpio_25, 0x80, 5, 1, 2, 0, 3, 4, PADDRI_4_8),
1518 [RTD1319D_ISO_GPIO_26] = RTK_PIN_CONFIG(gpio_26, 0x80, 10, 1, 2, 0, 3, 4, PADDRI_4_8),
1519 [RTD1319D_ISO_GPIO_27] = RTK_PIN_CONFIG(gpio_27, 0x80, 16, 1, 2, 0, 3, 4, PADDRI_4_8),
1520 [RTD1319D_ISO_GPIO_28] = RTK_PIN_CONFIG(gpio_28, 0x80, 22, 1, 2, 0, 3, 4, PADDRI_4_8),
1521 [RTD1319D_ISO_GPIO_30] = RTK_PIN_CONFIG(gpio_30, 0x84, 0, 1, 2, 0, 3, 4, PADDRI_4_8),
1522 [RTD1319D_ISO_GPIO_34] = RTK_PIN_CONFIG(gpio_34, 0x84, 5, 1, 2, 0, 3, 4, PADDRI_4_8),
1523 [RTD1319D_ISO_GPIO_35] = RTK_PIN_CONFIG(gpio_35, 0x84, 10, 1, 2, 0, 3, 4, PADDRI_4_8),
1524 [RTD1319D_ISO_UR0_TX] = RTK_PIN_CONFIG(ur0_tx, 0x84, 15, 1, 2, 0, 3, 4, PADDRI_4_8),
1525 [RTD1319D_ISO_UR0_RX] = RTK_PIN_CONFIG(ur0_rx, 0x84, 20, 1, 2, 0, 3, 4, PADDRI_4_8),
1526 [RTD1319D_ISO_GPIO_48] = RTK_PIN_CONFIG(gpio_48, 0x84, 25, 1, 2, 0, 3, 4, PADDRI_4_8),
1527 [RTD1319D_ISO_GPIO_49] = RTK_PIN_CONFIG(gpio_49, 0x88, 0, 1, 2, 0, 3, 4, PADDRI_4_8),
1528 [RTD1319D_ISO_GPIO_52] = RTK_PIN_CONFIG(gpio_52, 0x88, 5, 1, 2, 0, 3, 4, PADDRI_4_8),
1529 [RTD1319D_ISO_GPIO_53] = RTK_PIN_CONFIG(gpio_53, 0x88, 10, 1, 2, 0, 3, 4, PADDRI_4_8),
1530 };
1531
1532 static const struct rtd_pin_sconfig_desc rtd1319d_iso_sconfigs[] = {
1533 RTK_PIN_SCONFIG(gpio_40, 0x3c, 7, 3, 10, 3, 13, 3),
1534 RTK_PIN_SCONFIG(gpio_41, 0x3c, 20, 3, 23, 3, 26, 3),
1535 RTK_PIN_SCONFIG(gpio_42, 0x40, 3, 3, 6, 3, 9, 3),
1536 RTK_PIN_SCONFIG(gpio_43, 0x40, 16, 3, 19, 3, 22, 3),
1537 RTK_PIN_SCONFIG(gpio_44, 0x44, 3, 3, 6, 3, 9, 3),
1538 RTK_PIN_SCONFIG(gpio_45, 0x44, 16, 3, 19, 3, 22, 3),
1539 RTK_PIN_SCONFIG(emmc_data_0, 0x48, 3, 3, 6, 3, 9, 3),
1540 RTK_PIN_SCONFIG(emmc_data_1, 0x48, 16, 3, 19, 3, 22, 3),
1541 RTK_PIN_SCONFIG(emmc_data_2, 0x4c, 3, 3, 6, 3, 9, 3),
1542 RTK_PIN_SCONFIG(emmc_data_3, 0x4c, 16, 3, 19, 3, 22, 3),
1543 RTK_PIN_SCONFIG(emmc_data_4, 0x50, 3, 3, 6, 3, 9, 3),
1544 RTK_PIN_SCONFIG(emmc_data_5, 0x50, 16, 3, 19, 3, 22, 3),
1545 RTK_PIN_SCONFIG(emmc_data_6, 0x54, 3, 3, 6, 3, 9, 3),
1546 RTK_PIN_SCONFIG(emmc_data_7, 0x54, 16, 3, 19, 3, 22, 3),
1547 RTK_PIN_SCONFIG(emmc_dd_sb, 0x58, 3, 3, 6, 3, 9, 3),
1548 RTK_PIN_SCONFIG(emmc_rst_n, 0x58, 16, 3, 19, 3, 22, 3),
1549 RTK_PIN_SCONFIG(emmc_cmd, 0x5c, 3, 3, 6, 3, 9, 3),
1550 RTK_PIN_SCONFIG(emmc_clk, 0x5c, 17, 3, 20, 3, 23, 3),
1551 RTK_PIN_SCONFIG(gpio_80, 0x60, 3, 3, 6, 3, 9, 3),
1552 RTK_PIN_SCONFIG(gpio_78, 0x60, 16, 3, 19, 3, 22, 3),
1553 RTK_PIN_SCONFIG(gpio_79, 0x64, 3, 3, 6, 3, 9, 3),
1554 RTK_PIN_SCONFIG(gpio_81, 0x64, 16, 3, 19, 3, 22, 3),
1555 RTK_PIN_SCONFIG(hif_en, 0x74, 3, 3, 6, 3, 9, 3),
1556 RTK_PIN_SCONFIG(hif_data, 0x74, 16, 3, 19, 3, 22, 3),
1557 RTK_PIN_SCONFIG(gpio_33, 0x78, 3, 3, 6, 3, 9, 3),
1558 RTK_PIN_SCONFIG(gpio_32, 0x78, 16, 3, 19, 3, 22, 3),
1559 RTK_PIN_SCONFIG(hif_clk, 0x7c, 3, 3, 6, 3, 9, 3),
1560 RTK_PIN_SCONFIG(hif_rdy, 0x7c, 16, 3, 19, 3, 22, 3),
1561 };
1562
1563 static const struct rtd_pinctrl_desc rtd1319d_iso_pinctrl_desc = {
1564 .pins = rtd1319d_iso_pins,
1565 .num_pins = ARRAY_SIZE(rtd1319d_iso_pins),
1566 .groups = rtd1319d_pin_groups,
1567 .num_groups = ARRAY_SIZE(rtd1319d_pin_groups),
1568 .functions = rtd1319d_pin_functions,
1569 .num_functions = ARRAY_SIZE(rtd1319d_pin_functions),
1570 .muxes = rtd1319d_iso_muxes,
1571 .num_muxes = ARRAY_SIZE(rtd1319d_iso_muxes),
1572 .configs = rtd1319d_iso_configs,
1573 .num_configs = ARRAY_SIZE(rtd1319d_iso_configs),
1574 .sconfigs = rtd1319d_iso_sconfigs,
1575 .num_sconfigs = ARRAY_SIZE(rtd1319d_iso_sconfigs),
1576 };
1577
rtd1319d_pinctrl_probe(struct platform_device * pdev)1578 static int rtd1319d_pinctrl_probe(struct platform_device *pdev)
1579 {
1580 return rtd_pinctrl_probe(pdev, &rtd1319d_iso_pinctrl_desc);
1581 }
1582
1583 static const struct of_device_id rtd1319d_pinctrl_of_match[] = {
1584 { .compatible = "realtek,rtd1319d-pinctrl", },
1585 {},
1586 };
1587 MODULE_DEVICE_TABLE(of, rtd1319d_pinctrl_of_match);
1588
1589 static struct platform_driver rtd1319d_pinctrl_driver = {
1590 .driver = {
1591 .name = "rtd1319d-pinctrl",
1592 .of_match_table = rtd1319d_pinctrl_of_match,
1593 },
1594 .probe = rtd1319d_pinctrl_probe,
1595 };
1596
rtd1319d_pinctrl_init(void)1597 static int __init rtd1319d_pinctrl_init(void)
1598 {
1599 return platform_driver_register(&rtd1319d_pinctrl_driver);
1600 }
1601 arch_initcall(rtd1319d_pinctrl_init);
1602
rtd1319d_pinctrl_exit(void)1603 static void __exit rtd1319d_pinctrl_exit(void)
1604 {
1605 platform_driver_unregister(&rtd1319d_pinctrl_driver);
1606 }
1607 module_exit(rtd1319d_pinctrl_exit);
1608
1609 MODULE_LICENSE("GPL");
1610 MODULE_AUTHOR("Realtek Semiconductor Corporation");
1611 MODULE_DESCRIPTION("Realtek DHC SoC RTD1319D pinctrl driver");
1612