1 // SPDX-License-Identifier: GPL-2.0
3 * Sophgo CV1812H SoC pinctrl driver.
5 * Copyright (C) 2024 Inochi Amaoto <inochiama@outlook.com>
7 * This file is generated from vendor pinout definition.
10 #include <linux/module.h>
11 #include <linux/platform_device.h>
14 #include <linux/pinctrl/pinctrl.h>
15 #include <linux/pinctrl/pinmux.h>
17 #include <dt-bindings/pinctrl/pinctrl-cv1812h.h>
19 #include "pinctrl-cv18xx.h"
21 enum CV1812H_POWER_DOMAIN
{
32 static const char *const cv1812h_power_domain_desc
[] = {
33 [VDD18A_EPHY
] = "VDD18A_EPHY",
34 [VDD18A_MIPI
] = "VDD18A_MIPI",
35 [VDDIO18_1
] = "VDDIO18_1",
36 [VDDIO_EMMC
] = "VDDIO_EMMC",
37 [VDDIO_RTC
] = "VDDIO_RTC",
38 [VDDIO_SD0
] = "VDDIO_SD0",
39 [VDDIO_SD1
] = "VDDIO_SD1",
40 [VDDIO_VIVO
] = "VDDIO_VIVO",
43 static int cv1812h_get_pull_up(struct cv1800_pin
*pin
, const u32
*psmap
)
45 u32 pstate
= psmap
[pin
->power_domain
];
46 enum cv1800_pin_io_type type
= cv1800_pin_io_type(pin
);
48 if (type
== IO_TYPE_1V8_ONLY
)
51 if (type
== IO_TYPE_1V8_OR_3V3
) {
52 if (pstate
== PIN_POWER_STATE_1V8
)
54 if (pstate
== PIN_POWER_STATE_3V3
)
63 static int cv1812h_get_pull_down(struct cv1800_pin
*pin
, const u32
*psmap
)
65 u32 pstate
= psmap
[pin
->power_domain
];
66 enum cv1800_pin_io_type type
= cv1800_pin_io_type(pin
);
68 if (type
== IO_TYPE_1V8_ONLY
)
71 if (type
== IO_TYPE_1V8_OR_3V3
) {
72 if (pstate
== PIN_POWER_STATE_1V8
)
74 if (pstate
== PIN_POWER_STATE_3V3
)
83 static const u32 cv1812h_1v8_oc_map
[] = {
90 static const u32 cv1812h_18od33_1v8_oc_map
[] = {
101 static const u32 cv1812h_18od33_3v3_oc_map
[] = {
112 static const u32 cv1812h_eth_oc_map
[] = {
117 static int cv1812h_get_oc_map(struct cv1800_pin
*pin
, const u32
*psmap
,
120 enum cv1800_pin_io_type type
= cv1800_pin_io_type(pin
);
121 u32 pstate
= psmap
[pin
->power_domain
];
123 if (type
== IO_TYPE_1V8_ONLY
) {
124 *map
= cv1812h_1v8_oc_map
;
125 return ARRAY_SIZE(cv1812h_1v8_oc_map
);
128 if (type
== IO_TYPE_1V8_OR_3V3
) {
129 if (pstate
== PIN_POWER_STATE_1V8
) {
130 *map
= cv1812h_18od33_1v8_oc_map
;
131 return ARRAY_SIZE(cv1812h_18od33_1v8_oc_map
);
132 } else if (pstate
== PIN_POWER_STATE_3V3
) {
133 *map
= cv1812h_18od33_3v3_oc_map
;
134 return ARRAY_SIZE(cv1812h_18od33_3v3_oc_map
);
138 if (type
== IO_TYPE_ETH
) {
139 *map
= cv1812h_eth_oc_map
;
140 return ARRAY_SIZE(cv1812h_eth_oc_map
);
146 static const u32 cv1812h_1v8_schmitt_map
[] = {
152 static const u32 cv1812h_18od33_1v8_schmitt_map
[] = {
157 static const u32 cv1812h_18od33_3v3_schmitt_map
[] = {
162 static int cv1812h_get_schmitt_map(struct cv1800_pin
*pin
, const u32
*psmap
,
165 enum cv1800_pin_io_type type
= cv1800_pin_io_type(pin
);
166 u32 pstate
= psmap
[pin
->power_domain
];
168 if (type
== IO_TYPE_1V8_ONLY
) {
169 *map
= cv1812h_1v8_schmitt_map
;
170 return ARRAY_SIZE(cv1812h_1v8_schmitt_map
);
173 if (type
== IO_TYPE_1V8_OR_3V3
) {
174 if (pstate
== PIN_POWER_STATE_1V8
) {
175 *map
= cv1812h_18od33_1v8_schmitt_map
;
176 return ARRAY_SIZE(cv1812h_18od33_1v8_schmitt_map
);
177 } else if (pstate
== PIN_POWER_STATE_3V3
) {
178 *map
= cv1812h_18od33_3v3_schmitt_map
;
179 return ARRAY_SIZE(cv1812h_18od33_3v3_schmitt_map
);
186 static const struct cv1800_vddio_cfg_ops cv1812h_vddio_cfg_ops
= {
187 .get_pull_up
= cv1812h_get_pull_up
,
188 .get_pull_down
= cv1812h_get_pull_down
,
189 .get_oc_map
= cv1812h_get_oc_map
,
190 .get_schmitt_map
= cv1812h_get_schmitt_map
,
193 static const struct pinctrl_pin_desc cv1812h_pins
[] = {
194 PINCTRL_PIN(PIN_MIPI_TXM4
, "MIPI_TXM4"),
195 PINCTRL_PIN(PIN_MIPIRX0N
, "MIPIRX0N"),
196 PINCTRL_PIN(PIN_MIPIRX3P
, "MIPIRX3P"),
197 PINCTRL_PIN(PIN_MIPIRX4P
, "MIPIRX4P"),
198 PINCTRL_PIN(PIN_VIVO_D2
, "VIVO_D2"),
199 PINCTRL_PIN(PIN_VIVO_D3
, "VIVO_D3"),
200 PINCTRL_PIN(PIN_VIVO_D10
, "VIVO_D10"),
201 PINCTRL_PIN(PIN_USB_VBUS_DET
, "USB_VBUS_DET"),
202 PINCTRL_PIN(PIN_MIPI_TXP3
, "MIPI_TXP3"),
203 PINCTRL_PIN(PIN_MIPI_TXM3
, "MIPI_TXM3"),
204 PINCTRL_PIN(PIN_MIPI_TXP4
, "MIPI_TXP4"),
205 PINCTRL_PIN(PIN_MIPIRX0P
, "MIPIRX0P"),
206 PINCTRL_PIN(PIN_MIPIRX1N
, "MIPIRX1N"),
207 PINCTRL_PIN(PIN_MIPIRX2N
, "MIPIRX2N"),
208 PINCTRL_PIN(PIN_MIPIRX4N
, "MIPIRX4N"),
209 PINCTRL_PIN(PIN_MIPIRX5N
, "MIPIRX5N"),
210 PINCTRL_PIN(PIN_VIVO_D1
, "VIVO_D1"),
211 PINCTRL_PIN(PIN_VIVO_D5
, "VIVO_D5"),
212 PINCTRL_PIN(PIN_VIVO_D7
, "VIVO_D7"),
213 PINCTRL_PIN(PIN_VIVO_D9
, "VIVO_D9"),
214 PINCTRL_PIN(PIN_USB_ID
, "USB_ID"),
215 PINCTRL_PIN(PIN_ETH_RXM
, "ETH_RXM"),
216 PINCTRL_PIN(PIN_MIPI_TXP2
, "MIPI_TXP2"),
217 PINCTRL_PIN(PIN_MIPI_TXM2
, "MIPI_TXM2"),
218 PINCTRL_PIN(PIN_CAM_PD0
, "CAM_PD0"),
219 PINCTRL_PIN(PIN_CAM_MCLK0
, "CAM_MCLK0"),
220 PINCTRL_PIN(PIN_MIPIRX1P
, "MIPIRX1P"),
221 PINCTRL_PIN(PIN_MIPIRX2P
, "MIPIRX2P"),
222 PINCTRL_PIN(PIN_MIPIRX3N
, "MIPIRX3N"),
223 PINCTRL_PIN(PIN_MIPIRX5P
, "MIPIRX5P"),
224 PINCTRL_PIN(PIN_VIVO_CLK
, "VIVO_CLK"),
225 PINCTRL_PIN(PIN_VIVO_D6
, "VIVO_D6"),
226 PINCTRL_PIN(PIN_VIVO_D8
, "VIVO_D8"),
227 PINCTRL_PIN(PIN_USB_VBUS_EN
, "USB_VBUS_EN"),
228 PINCTRL_PIN(PIN_ETH_RXP
, "ETH_RXP"),
229 PINCTRL_PIN(PIN_GPIO_RTX
, "GPIO_RTX"),
230 PINCTRL_PIN(PIN_MIPI_TXP1
, "MIPI_TXP1"),
231 PINCTRL_PIN(PIN_MIPI_TXM1
, "MIPI_TXM1"),
232 PINCTRL_PIN(PIN_CAM_MCLK1
, "CAM_MCLK1"),
233 PINCTRL_PIN(PIN_IIC3_SCL
, "IIC3_SCL"),
234 PINCTRL_PIN(PIN_VIVO_D4
, "VIVO_D4"),
235 PINCTRL_PIN(PIN_ETH_TXM
, "ETH_TXM"),
236 PINCTRL_PIN(PIN_ETH_TXP
, "ETH_TXP"),
237 PINCTRL_PIN(PIN_MIPI_TXP0
, "MIPI_TXP0"),
238 PINCTRL_PIN(PIN_MIPI_TXM0
, "MIPI_TXM0"),
239 PINCTRL_PIN(PIN_CAM_PD1
, "CAM_PD1"),
240 PINCTRL_PIN(PIN_CAM_RST0
, "CAM_RST0"),
241 PINCTRL_PIN(PIN_VIVO_D0
, "VIVO_D0"),
242 PINCTRL_PIN(PIN_ADC1
, "ADC1"),
243 PINCTRL_PIN(PIN_ADC2
, "ADC2"),
244 PINCTRL_PIN(PIN_ADC3
, "ADC3"),
245 PINCTRL_PIN(PIN_AUD_AOUTL
, "AUD_AOUTL"),
246 PINCTRL_PIN(PIN_IIC3_SDA
, "IIC3_SDA"),
247 PINCTRL_PIN(PIN_SD1_D2
, "SD1_D2"),
248 PINCTRL_PIN(PIN_AUD_AOUTR
, "AUD_AOUTR"),
249 PINCTRL_PIN(PIN_SD1_D3
, "SD1_D3"),
250 PINCTRL_PIN(PIN_SD1_CLK
, "SD1_CLK"),
251 PINCTRL_PIN(PIN_SD1_CMD
, "SD1_CMD"),
252 PINCTRL_PIN(PIN_AUD_AINL_MIC
, "AUD_AINL_MIC"),
253 PINCTRL_PIN(PIN_RSTN
, "RSTN"),
254 PINCTRL_PIN(PIN_PWM0_BUCK
, "PWM0_BUCK"),
255 PINCTRL_PIN(PIN_SD1_D1
, "SD1_D1"),
256 PINCTRL_PIN(PIN_SD1_D0
, "SD1_D0"),
257 PINCTRL_PIN(PIN_AUD_AINR_MIC
, "AUD_AINR_MIC"),
258 PINCTRL_PIN(PIN_IIC2_SCL
, "IIC2_SCL"),
259 PINCTRL_PIN(PIN_IIC2_SDA
, "IIC2_SDA"),
260 PINCTRL_PIN(PIN_SD0_CD
, "SD0_CD"),
261 PINCTRL_PIN(PIN_SD0_D1
, "SD0_D1"),
262 PINCTRL_PIN(PIN_UART2_RX
, "UART2_RX"),
263 PINCTRL_PIN(PIN_UART2_CTS
, "UART2_CTS"),
264 PINCTRL_PIN(PIN_UART2_TX
, "UART2_TX"),
265 PINCTRL_PIN(PIN_SD0_CLK
, "SD0_CLK"),
266 PINCTRL_PIN(PIN_SD0_D0
, "SD0_D0"),
267 PINCTRL_PIN(PIN_SD0_CMD
, "SD0_CMD"),
268 PINCTRL_PIN(PIN_CLK32K
, "CLK32K"),
269 PINCTRL_PIN(PIN_UART2_RTS
, "UART2_RTS"),
270 PINCTRL_PIN(PIN_SD0_D3
, "SD0_D3"),
271 PINCTRL_PIN(PIN_SD0_D2
, "SD0_D2"),
272 PINCTRL_PIN(PIN_UART0_RX
, "UART0_RX"),
273 PINCTRL_PIN(PIN_UART0_TX
, "UART0_TX"),
274 PINCTRL_PIN(PIN_JTAG_CPU_TRST
, "JTAG_CPU_TRST"),
275 PINCTRL_PIN(PIN_PWR_ON
, "PWR_ON"),
276 PINCTRL_PIN(PIN_PWR_GPIO2
, "PWR_GPIO2"),
277 PINCTRL_PIN(PIN_PWR_GPIO0
, "PWR_GPIO0"),
278 PINCTRL_PIN(PIN_CLK25M
, "CLK25M"),
279 PINCTRL_PIN(PIN_SD0_PWR_EN
, "SD0_PWR_EN"),
280 PINCTRL_PIN(PIN_SPK_EN
, "SPK_EN"),
281 PINCTRL_PIN(PIN_JTAG_CPU_TCK
, "JTAG_CPU_TCK"),
282 PINCTRL_PIN(PIN_JTAG_CPU_TMS
, "JTAG_CPU_TMS"),
283 PINCTRL_PIN(PIN_PWR_WAKEUP1
, "PWR_WAKEUP1"),
284 PINCTRL_PIN(PIN_PWR_WAKEUP0
, "PWR_WAKEUP0"),
285 PINCTRL_PIN(PIN_PWR_GPIO1
, "PWR_GPIO1"),
286 PINCTRL_PIN(PIN_EMMC_DAT3
, "EMMC_DAT3"),
287 PINCTRL_PIN(PIN_EMMC_DAT0
, "EMMC_DAT0"),
288 PINCTRL_PIN(PIN_EMMC_DAT2
, "EMMC_DAT2"),
289 PINCTRL_PIN(PIN_EMMC_RSTN
, "EMMC_RSTN"),
290 PINCTRL_PIN(PIN_AUX0
, "AUX0"),
291 PINCTRL_PIN(PIN_IIC0_SDA
, "IIC0_SDA"),
292 PINCTRL_PIN(PIN_PWR_SEQ3
, "PWR_SEQ3"),
293 PINCTRL_PIN(PIN_PWR_VBAT_DET
, "PWR_VBAT_DET"),
294 PINCTRL_PIN(PIN_PWR_SEQ1
, "PWR_SEQ1"),
295 PINCTRL_PIN(PIN_PWR_BUTTON1
, "PWR_BUTTON1"),
296 PINCTRL_PIN(PIN_EMMC_DAT1
, "EMMC_DAT1"),
297 PINCTRL_PIN(PIN_EMMC_CMD
, "EMMC_CMD"),
298 PINCTRL_PIN(PIN_EMMC_CLK
, "EMMC_CLK"),
299 PINCTRL_PIN(PIN_IIC0_SCL
, "IIC0_SCL"),
300 PINCTRL_PIN(PIN_GPIO_ZQ
, "GPIO_ZQ"),
301 PINCTRL_PIN(PIN_PWR_RSTN
, "PWR_RSTN"),
302 PINCTRL_PIN(PIN_PWR_SEQ2
, "PWR_SEQ2"),
303 PINCTRL_PIN(PIN_XTAL_XIN
, "XTAL_XIN"),
306 static const struct cv1800_pin cv1812h_pin_data
[ARRAY_SIZE(cv1812h_pins
)] = {
307 CV1800_GENERAL_PIN(PIN_MIPI_TXM4
, VDD18A_MIPI
,
309 CV1800_PINCONF_AREA_SYS
, 0x194, 7,
310 CV1800_PINCONF_AREA_SYS
, 0xc60),
311 CV1800_GENERAL_PIN(PIN_MIPIRX0N
, VDD18A_MIPI
,
313 CV1800_PINCONF_AREA_SYS
, 0x18c, 7,
314 CV1800_PINCONF_AREA_SYS
, 0xc58),
315 CV1800_GENERATE_PIN_MUX2(PIN_MIPIRX3P
, VDD18A_MIPI
,
317 CV1800_PINCONF_AREA_SYS
, 0x178, 7,
318 CV1800_PINCONF_AREA_SYS
, 0x118, 7,
319 CV1800_PINCONF_AREA_SYS
, 0xc44),
320 CV1800_GENERATE_PIN_MUX2(PIN_MIPIRX4P
, VDD18A_MIPI
,
322 CV1800_PINCONF_AREA_SYS
, 0x170, 7,
323 CV1800_PINCONF_AREA_SYS
, 0x11c, 7,
324 CV1800_PINCONF_AREA_SYS
, 0xc3c),
325 CV1800_GENERAL_PIN(PIN_VIVO_D2
, VDDIO_VIVO
,
327 CV1800_PINCONF_AREA_SYS
, 0x154, 7,
328 CV1800_PINCONF_AREA_SYS
, 0xc20),
329 CV1800_GENERAL_PIN(PIN_VIVO_D3
, VDDIO_VIVO
,
331 CV1800_PINCONF_AREA_SYS
, 0x150, 7,
332 CV1800_PINCONF_AREA_SYS
, 0xc1c),
333 CV1800_GENERAL_PIN(PIN_VIVO_D10
, VDDIO_VIVO
,
335 CV1800_PINCONF_AREA_SYS
, 0x134, 7,
336 CV1800_PINCONF_AREA_SYS
, 0xc00),
337 CV1800_GENERAL_PIN(PIN_USB_VBUS_DET
, VDDIO18_1
,
339 CV1800_PINCONF_AREA_SYS
, 0x108, 5,
340 CV1800_PINCONF_AREA_SYS
, 0x820),
341 CV1800_GENERAL_PIN(PIN_MIPI_TXP3
, VDD18A_MIPI
,
343 CV1800_PINCONF_AREA_SYS
, 0x1a0, 7,
344 CV1800_PINCONF_AREA_SYS
, 0xc6c),
345 CV1800_GENERAL_PIN(PIN_MIPI_TXM3
, VDD18A_MIPI
,
347 CV1800_PINCONF_AREA_SYS
, 0x19c, 7,
348 CV1800_PINCONF_AREA_SYS
, 0xc68),
349 CV1800_GENERAL_PIN(PIN_MIPI_TXP4
, VDD18A_MIPI
,
351 CV1800_PINCONF_AREA_SYS
, 0x198, 7,
352 CV1800_PINCONF_AREA_SYS
, 0xc64),
353 CV1800_GENERAL_PIN(PIN_MIPIRX0P
, VDD18A_MIPI
,
355 CV1800_PINCONF_AREA_SYS
, 0x190, 7,
356 CV1800_PINCONF_AREA_SYS
, 0xc5c),
357 CV1800_GENERAL_PIN(PIN_MIPIRX1N
, VDD18A_MIPI
,
359 CV1800_PINCONF_AREA_SYS
, 0x184, 7,
360 CV1800_PINCONF_AREA_SYS
, 0xc50),
361 CV1800_GENERAL_PIN(PIN_MIPIRX2N
, VDD18A_MIPI
,
363 CV1800_PINCONF_AREA_SYS
, 0x17c, 7,
364 CV1800_PINCONF_AREA_SYS
, 0xc48),
365 CV1800_GENERATE_PIN_MUX2(PIN_MIPIRX4N
, VDD18A_MIPI
,
367 CV1800_PINCONF_AREA_SYS
, 0x16c, 7,
368 CV1800_PINCONF_AREA_SYS
, 0x120, 7,
369 CV1800_PINCONF_AREA_SYS
, 0xc38),
370 CV1800_GENERAL_PIN(PIN_MIPIRX5N
, VDD18A_MIPI
,
372 CV1800_PINCONF_AREA_SYS
, 0x164, 7,
373 CV1800_PINCONF_AREA_SYS
, 0xc30),
374 CV1800_GENERAL_PIN(PIN_VIVO_D1
, VDDIO_VIVO
,
376 CV1800_PINCONF_AREA_SYS
, 0x158, 7,
377 CV1800_PINCONF_AREA_SYS
, 0xc24),
378 CV1800_GENERAL_PIN(PIN_VIVO_D5
, VDDIO_VIVO
,
380 CV1800_PINCONF_AREA_SYS
, 0x148, 7,
381 CV1800_PINCONF_AREA_SYS
, 0xc14),
382 CV1800_GENERAL_PIN(PIN_VIVO_D7
, VDDIO_VIVO
,
384 CV1800_PINCONF_AREA_SYS
, 0x140, 7,
385 CV1800_PINCONF_AREA_SYS
, 0xc0c),
386 CV1800_GENERAL_PIN(PIN_VIVO_D9
, VDDIO_VIVO
,
388 CV1800_PINCONF_AREA_SYS
, 0x138, 7,
389 CV1800_PINCONF_AREA_SYS
, 0xc04),
390 CV1800_GENERAL_PIN(PIN_USB_ID
, VDDIO18_1
,
392 CV1800_PINCONF_AREA_SYS
, 0x0fc, 3,
393 CV1800_PINCONF_AREA_SYS
, 0x814),
394 CV1800_FUNC_PIN(PIN_ETH_RXM
, VDD18A_EPHY
,
396 CV1800_PINCONF_AREA_SYS
, 0x130, 7),
397 CV1800_GENERAL_PIN(PIN_MIPI_TXP2
, VDD18A_MIPI
,
399 CV1800_PINCONF_AREA_SYS
, 0x1a8, 7,
400 CV1800_PINCONF_AREA_SYS
, 0xc74),
401 CV1800_GENERAL_PIN(PIN_MIPI_TXM2
, VDD18A_MIPI
,
403 CV1800_PINCONF_AREA_SYS
, 0x1a4, 7,
404 CV1800_PINCONF_AREA_SYS
, 0xc70),
405 CV1800_GENERAL_PIN(PIN_CAM_PD0
, VDD18A_MIPI
,
407 CV1800_PINCONF_AREA_SYS
, 0x004, 4,
408 CV1800_PINCONF_AREA_SYS
, 0xb04),
409 CV1800_GENERAL_PIN(PIN_CAM_MCLK0
, VDD18A_MIPI
,
411 CV1800_PINCONF_AREA_SYS
, 0x000, 3,
412 CV1800_PINCONF_AREA_SYS
, 0xb00),
413 CV1800_GENERAL_PIN(PIN_MIPIRX1P
, VDD18A_MIPI
,
415 CV1800_PINCONF_AREA_SYS
, 0x188, 7,
416 CV1800_PINCONF_AREA_SYS
, 0xc54),
417 CV1800_GENERAL_PIN(PIN_MIPIRX2P
, VDD18A_MIPI
,
419 CV1800_PINCONF_AREA_SYS
, 0x180, 7,
420 CV1800_PINCONF_AREA_SYS
, 0xc4c),
421 CV1800_GENERATE_PIN_MUX2(PIN_MIPIRX3N
, VDD18A_MIPI
,
423 CV1800_PINCONF_AREA_SYS
, 0x174, 7,
424 CV1800_PINCONF_AREA_SYS
, 0x114, 7,
425 CV1800_PINCONF_AREA_SYS
, 0xc40),
426 CV1800_GENERAL_PIN(PIN_MIPIRX5P
, VDD18A_MIPI
,
428 CV1800_PINCONF_AREA_SYS
, 0x168, 7,
429 CV1800_PINCONF_AREA_SYS
, 0xc34),
430 CV1800_GENERAL_PIN(PIN_VIVO_CLK
, VDDIO_VIVO
,
432 CV1800_PINCONF_AREA_SYS
, 0x160, 7,
433 CV1800_PINCONF_AREA_SYS
, 0xc2c),
434 CV1800_GENERAL_PIN(PIN_VIVO_D6
, VDDIO_VIVO
,
436 CV1800_PINCONF_AREA_SYS
, 0x144, 7,
437 CV1800_PINCONF_AREA_SYS
, 0xc10),
438 CV1800_GENERAL_PIN(PIN_VIVO_D8
, VDDIO_VIVO
,
440 CV1800_PINCONF_AREA_SYS
, 0x13c, 7,
441 CV1800_PINCONF_AREA_SYS
, 0xc08),
442 CV1800_GENERAL_PIN(PIN_USB_VBUS_EN
, VDDIO18_1
,
444 CV1800_PINCONF_AREA_SYS
, 0x100, 3,
445 CV1800_PINCONF_AREA_SYS
, 0x818),
446 CV1800_FUNC_PIN(PIN_ETH_RXP
, VDD18A_EPHY
,
448 CV1800_PINCONF_AREA_SYS
, 0x12c, 7),
449 CV1800_GENERAL_PIN(PIN_GPIO_RTX
, VDDIO18_1
,
451 CV1800_PINCONF_AREA_SYS
, 0x1cc, 5,
452 CV1800_PINCONF_AREA_SYS
, 0xc8c),
453 CV1800_GENERAL_PIN(PIN_MIPI_TXP1
, VDD18A_MIPI
,
455 CV1800_PINCONF_AREA_SYS
, 0x1b0, 7,
456 CV1800_PINCONF_AREA_SYS
, 0xc7c),
457 CV1800_GENERAL_PIN(PIN_MIPI_TXM1
, VDD18A_MIPI
,
459 CV1800_PINCONF_AREA_SYS
, 0x1ac, 7,
460 CV1800_PINCONF_AREA_SYS
, 0xc78),
461 CV1800_GENERAL_PIN(PIN_CAM_MCLK1
, VDD18A_MIPI
,
463 CV1800_PINCONF_AREA_SYS
, 0x00c, 4,
464 CV1800_PINCONF_AREA_SYS
, 0xb0c),
465 CV1800_GENERAL_PIN(PIN_IIC3_SCL
, VDD18A_MIPI
,
467 CV1800_PINCONF_AREA_SYS
, 0x014, 3,
468 CV1800_PINCONF_AREA_SYS
, 0xb14),
469 CV1800_GENERAL_PIN(PIN_VIVO_D4
, VDDIO_VIVO
,
471 CV1800_PINCONF_AREA_SYS
, 0x14c, 7,
472 CV1800_PINCONF_AREA_SYS
, 0xc18),
473 CV1800_FUNC_PIN(PIN_ETH_TXM
, VDD18A_EPHY
,
475 CV1800_PINCONF_AREA_SYS
, 0x128, 7),
476 CV1800_FUNC_PIN(PIN_ETH_TXP
, VDD18A_EPHY
,
478 CV1800_PINCONF_AREA_SYS
, 0x124, 7),
479 CV1800_GENERAL_PIN(PIN_MIPI_TXP0
, VDD18A_MIPI
,
481 CV1800_PINCONF_AREA_SYS
, 0x1b8, 7,
482 CV1800_PINCONF_AREA_SYS
, 0xc84),
483 CV1800_GENERAL_PIN(PIN_MIPI_TXM0
, VDD18A_MIPI
,
485 CV1800_PINCONF_AREA_SYS
, 0x1b4, 7,
486 CV1800_PINCONF_AREA_SYS
, 0xc80),
487 CV1800_GENERAL_PIN(PIN_CAM_PD1
, VDD18A_MIPI
,
489 CV1800_PINCONF_AREA_SYS
, 0x010, 6,
490 CV1800_PINCONF_AREA_SYS
, 0xb10),
491 CV1800_GENERAL_PIN(PIN_CAM_RST0
, VDD18A_MIPI
,
493 CV1800_PINCONF_AREA_SYS
, 0x008, 6,
494 CV1800_PINCONF_AREA_SYS
, 0xb08),
495 CV1800_GENERAL_PIN(PIN_VIVO_D0
, VDDIO_VIVO
,
497 CV1800_PINCONF_AREA_SYS
, 0x15c, 7,
498 CV1800_PINCONF_AREA_SYS
, 0xc28),
499 CV1800_GENERAL_PIN(PIN_ADC1
, VDDIO18_1
,
501 CV1800_PINCONF_AREA_SYS
, 0x0f8, 4,
502 CV1800_PINCONF_AREA_SYS
, 0x810),
503 CV1800_GENERAL_PIN(PIN_ADC2
, VDDIO18_1
,
505 CV1800_PINCONF_AREA_SYS
, 0x0f4, 7,
506 CV1800_PINCONF_AREA_SYS
, 0x80c),
507 CV1800_GENERAL_PIN(PIN_ADC3
, VDDIO18_1
,
509 CV1800_PINCONF_AREA_SYS
, 0x0f0, 7,
510 CV1800_PINCONF_AREA_SYS
, 0x808),
511 CV1800_FUNC_PIN(PIN_AUD_AOUTL
, VDD18A_MIPI
,
513 CV1800_PINCONF_AREA_SYS
, 0x1c4, 5),
514 CV1800_GENERAL_PIN(PIN_IIC3_SDA
, VDD18A_MIPI
,
516 CV1800_PINCONF_AREA_SYS
, 0x018, 3,
517 CV1800_PINCONF_AREA_SYS
, 0xb18),
518 CV1800_GENERAL_PIN(PIN_SD1_D2
, VDDIO_SD1
,
520 CV1800_PINCONF_AREA_SYS
, 0x0d4, 7,
521 CV1800_PINCONF_AREA_RTC
, 0x05c),
522 CV1800_FUNC_PIN(PIN_AUD_AOUTR
, VDD18A_MIPI
,
524 CV1800_PINCONF_AREA_SYS
, 0x1c8, 6),
525 CV1800_GENERAL_PIN(PIN_SD1_D3
, VDDIO_SD1
,
527 CV1800_PINCONF_AREA_SYS
, 0x0d0, 7,
528 CV1800_PINCONF_AREA_RTC
, 0x058),
529 CV1800_GENERAL_PIN(PIN_SD1_CLK
, VDDIO_SD1
,
531 CV1800_PINCONF_AREA_SYS
, 0x0e4, 7,
532 CV1800_PINCONF_AREA_RTC
, 0x06c),
533 CV1800_GENERAL_PIN(PIN_SD1_CMD
, VDDIO_SD1
,
535 CV1800_PINCONF_AREA_SYS
, 0x0e0, 7,
536 CV1800_PINCONF_AREA_RTC
, 0x068),
537 CV1800_FUNC_PIN(PIN_AUD_AINL_MIC
, VDD18A_MIPI
,
539 CV1800_PINCONF_AREA_SYS
, 0x1bc, 5),
540 CV1800_GENERAL_PIN(PIN_RSTN
, VDDIO18_1
,
542 CV1800_PINCONF_AREA_SYS
, 0x0e8, 0,
543 CV1800_PINCONF_AREA_SYS
, 0x800),
544 CV1800_GENERAL_PIN(PIN_PWM0_BUCK
, VDDIO18_1
,
546 CV1800_PINCONF_AREA_SYS
, 0x0ec, 3,
547 CV1800_PINCONF_AREA_SYS
, 0x804),
548 CV1800_GENERAL_PIN(PIN_SD1_D1
, VDDIO_SD1
,
550 CV1800_PINCONF_AREA_SYS
, 0x0d8, 7,
551 CV1800_PINCONF_AREA_RTC
, 0x060),
552 CV1800_GENERAL_PIN(PIN_SD1_D0
, VDDIO_SD1
,
554 CV1800_PINCONF_AREA_SYS
, 0x0dc, 7,
555 CV1800_PINCONF_AREA_RTC
, 0x064),
556 CV1800_FUNC_PIN(PIN_AUD_AINR_MIC
, VDD18A_MIPI
,
558 CV1800_PINCONF_AREA_SYS
, 0x1c0, 6),
559 CV1800_GENERAL_PIN(PIN_IIC2_SCL
, VDDIO_RTC
,
561 CV1800_PINCONF_AREA_SYS
, 0x0b8, 7,
562 CV1800_PINCONF_AREA_RTC
, 0x040),
563 CV1800_GENERAL_PIN(PIN_IIC2_SDA
, VDDIO_RTC
,
565 CV1800_PINCONF_AREA_SYS
, 0x0bc, 7,
566 CV1800_PINCONF_AREA_RTC
, 0x044),
567 CV1800_GENERAL_PIN(PIN_SD0_CD
, VDDIO_EMMC
,
569 CV1800_PINCONF_AREA_SYS
, 0x034, 3,
570 CV1800_PINCONF_AREA_SYS
, 0x900),
571 CV1800_GENERAL_PIN(PIN_SD0_D1
, VDDIO_SD0
,
573 CV1800_PINCONF_AREA_SYS
, 0x028, 7,
574 CV1800_PINCONF_AREA_SYS
, 0xa0c),
575 CV1800_GENERAL_PIN(PIN_UART2_RX
, VDDIO_RTC
,
577 CV1800_PINCONF_AREA_SYS
, 0x0c8, 7,
578 CV1800_PINCONF_AREA_RTC
, 0x050),
579 CV1800_GENERAL_PIN(PIN_UART2_CTS
, VDDIO_RTC
,
581 CV1800_PINCONF_AREA_SYS
, 0x0cc, 7,
582 CV1800_PINCONF_AREA_RTC
, 0x054),
583 CV1800_GENERAL_PIN(PIN_UART2_TX
, VDDIO_RTC
,
585 CV1800_PINCONF_AREA_SYS
, 0x0c0, 7,
586 CV1800_PINCONF_AREA_RTC
, 0x048),
587 CV1800_GENERAL_PIN(PIN_SD0_CLK
, VDDIO_SD0
,
589 CV1800_PINCONF_AREA_SYS
, 0x01c, 7,
590 CV1800_PINCONF_AREA_SYS
, 0xa00),
591 CV1800_GENERAL_PIN(PIN_SD0_D0
, VDDIO_SD0
,
593 CV1800_PINCONF_AREA_SYS
, 0x024, 7,
594 CV1800_PINCONF_AREA_SYS
, 0xa08),
595 CV1800_GENERAL_PIN(PIN_SD0_CMD
, VDDIO_SD0
,
597 CV1800_PINCONF_AREA_SYS
, 0x020, 7,
598 CV1800_PINCONF_AREA_SYS
, 0xa04),
599 CV1800_GENERAL_PIN(PIN_CLK32K
, VDDIO_RTC
,
601 CV1800_PINCONF_AREA_SYS
, 0x0b0, 7,
602 CV1800_PINCONF_AREA_RTC
, 0x038),
603 CV1800_GENERAL_PIN(PIN_UART2_RTS
, VDDIO_RTC
,
605 CV1800_PINCONF_AREA_SYS
, 0x0c4, 7,
606 CV1800_PINCONF_AREA_RTC
, 0x04c),
607 CV1800_GENERAL_PIN(PIN_SD0_D3
, VDDIO_SD0
,
609 CV1800_PINCONF_AREA_SYS
, 0x030, 7,
610 CV1800_PINCONF_AREA_SYS
, 0xa14),
611 CV1800_GENERAL_PIN(PIN_SD0_D2
, VDDIO_SD0
,
613 CV1800_PINCONF_AREA_SYS
, 0x02c, 7,
614 CV1800_PINCONF_AREA_SYS
, 0xa10),
615 CV1800_GENERAL_PIN(PIN_UART0_RX
, VDDIO_EMMC
,
617 CV1800_PINCONF_AREA_SYS
, 0x044, 7,
618 CV1800_PINCONF_AREA_SYS
, 0x910),
619 CV1800_GENERAL_PIN(PIN_UART0_TX
, VDDIO_EMMC
,
621 CV1800_PINCONF_AREA_SYS
, 0x040, 7,
622 CV1800_PINCONF_AREA_SYS
, 0x90c),
623 CV1800_GENERAL_PIN(PIN_JTAG_CPU_TRST
, VDDIO_EMMC
,
625 CV1800_PINCONF_AREA_SYS
, 0x06c, 6,
626 CV1800_PINCONF_AREA_SYS
, 0x938),
627 CV1800_GENERAL_PIN(PIN_PWR_ON
, VDDIO_RTC
,
629 CV1800_PINCONF_AREA_SYS
, 0x09c, 7,
630 CV1800_PINCONF_AREA_RTC
, 0x024),
631 CV1800_GENERAL_PIN(PIN_PWR_GPIO2
, VDDIO_RTC
,
633 CV1800_PINCONF_AREA_SYS
, 0x0ac, 7,
634 CV1800_PINCONF_AREA_RTC
, 0x034),
635 CV1800_GENERAL_PIN(PIN_PWR_GPIO0
, VDDIO_RTC
,
637 CV1800_PINCONF_AREA_SYS
, 0x0a4, 4,
638 CV1800_PINCONF_AREA_RTC
, 0x02c),
639 CV1800_GENERAL_PIN(PIN_CLK25M
, VDDIO_RTC
,
641 CV1800_PINCONF_AREA_SYS
, 0x0b4, 7,
642 CV1800_PINCONF_AREA_RTC
, 0x03c),
643 CV1800_GENERAL_PIN(PIN_SD0_PWR_EN
, VDDIO_EMMC
,
645 CV1800_PINCONF_AREA_SYS
, 0x038, 3,
646 CV1800_PINCONF_AREA_SYS
, 0x904),
647 CV1800_GENERAL_PIN(PIN_SPK_EN
, VDDIO_EMMC
,
649 CV1800_PINCONF_AREA_SYS
, 0x03c, 3,
650 CV1800_PINCONF_AREA_SYS
, 0x908),
651 CV1800_GENERAL_PIN(PIN_JTAG_CPU_TCK
, VDDIO_EMMC
,
653 CV1800_PINCONF_AREA_SYS
, 0x068, 7,
654 CV1800_PINCONF_AREA_SYS
, 0x934),
655 CV1800_GENERAL_PIN(PIN_JTAG_CPU_TMS
, VDDIO_EMMC
,
657 CV1800_PINCONF_AREA_SYS
, 0x064, 7,
658 CV1800_PINCONF_AREA_SYS
, 0x930),
659 CV1800_GENERAL_PIN(PIN_PWR_WAKEUP1
, VDDIO_RTC
,
661 CV1800_PINCONF_AREA_SYS
, 0x094, 7,
662 CV1800_PINCONF_AREA_RTC
, 0x01c),
663 CV1800_GENERAL_PIN(PIN_PWR_WAKEUP0
, VDDIO_RTC
,
665 CV1800_PINCONF_AREA_SYS
, 0x090, 7,
666 CV1800_PINCONF_AREA_RTC
, 0x018),
667 CV1800_GENERAL_PIN(PIN_PWR_GPIO1
, VDDIO_RTC
,
669 CV1800_PINCONF_AREA_SYS
, 0x0a8, 7,
670 CV1800_PINCONF_AREA_RTC
, 0x030),
671 CV1800_GENERAL_PIN(PIN_EMMC_DAT3
, VDDIO_EMMC
,
673 CV1800_PINCONF_AREA_SYS
, 0x058, 3,
674 CV1800_PINCONF_AREA_SYS
, 0x924),
675 CV1800_GENERAL_PIN(PIN_EMMC_DAT0
, VDDIO_EMMC
,
677 CV1800_PINCONF_AREA_SYS
, 0x054, 3,
678 CV1800_PINCONF_AREA_SYS
, 0x920),
679 CV1800_GENERAL_PIN(PIN_EMMC_DAT2
, VDDIO_EMMC
,
681 CV1800_PINCONF_AREA_SYS
, 0x04c, 3,
682 CV1800_PINCONF_AREA_SYS
, 0x918),
683 CV1800_GENERAL_PIN(PIN_EMMC_RSTN
, VDDIO_EMMC
,
685 CV1800_PINCONF_AREA_SYS
, 0x048, 4,
686 CV1800_PINCONF_AREA_SYS
, 0x914),
687 CV1800_GENERAL_PIN(PIN_AUX0
, VDDIO_EMMC
,
689 CV1800_PINCONF_AREA_SYS
, 0x078, 7,
690 CV1800_PINCONF_AREA_SYS
, 0x944),
691 CV1800_GENERAL_PIN(PIN_IIC0_SDA
, VDDIO_EMMC
,
693 CV1800_PINCONF_AREA_SYS
, 0x074, 7,
694 CV1800_PINCONF_AREA_SYS
, 0x940),
695 CV1800_GENERAL_PIN(PIN_PWR_SEQ3
, VDDIO_RTC
,
697 CV1800_PINCONF_AREA_SYS
, 0x08c, 3,
698 CV1800_PINCONF_AREA_RTC
, 0x010),
699 CV1800_GENERAL_PIN(PIN_PWR_VBAT_DET
, VDDIO_RTC
,
701 CV1800_PINCONF_AREA_SYS
, 0x07c, 0,
702 CV1800_PINCONF_AREA_RTC
, 0x000),
703 CV1800_GENERAL_PIN(PIN_PWR_SEQ1
, VDDIO_RTC
,
705 CV1800_PINCONF_AREA_SYS
, 0x084, 3,
706 CV1800_PINCONF_AREA_RTC
, 0x008),
707 CV1800_GENERAL_PIN(PIN_PWR_BUTTON1
, VDDIO_RTC
,
709 CV1800_PINCONF_AREA_SYS
, 0x098, 7,
710 CV1800_PINCONF_AREA_RTC
, 0x020),
711 CV1800_GENERAL_PIN(PIN_EMMC_DAT1
, VDDIO_EMMC
,
713 CV1800_PINCONF_AREA_SYS
, 0x060, 3,
714 CV1800_PINCONF_AREA_SYS
, 0x92c),
715 CV1800_GENERAL_PIN(PIN_EMMC_CMD
, VDDIO_EMMC
,
717 CV1800_PINCONF_AREA_SYS
, 0x05c, 3,
718 CV1800_PINCONF_AREA_SYS
, 0x928),
719 CV1800_GENERAL_PIN(PIN_EMMC_CLK
, VDDIO_EMMC
,
721 CV1800_PINCONF_AREA_SYS
, 0x050, 3,
722 CV1800_PINCONF_AREA_SYS
, 0x91c),
723 CV1800_GENERAL_PIN(PIN_IIC0_SCL
, VDDIO_EMMC
,
725 CV1800_PINCONF_AREA_SYS
, 0x070, 7,
726 CV1800_PINCONF_AREA_SYS
, 0x93c),
727 CV1800_GENERAL_PIN(PIN_GPIO_ZQ
, VDDIO_RTC
,
729 CV1800_PINCONF_AREA_SYS
, 0x1d0, 4,
730 CV1800_PINCONF_AREA_RTC
, 0x0e0),
731 CV1800_GENERAL_PIN(PIN_PWR_RSTN
, VDDIO_RTC
,
733 CV1800_PINCONF_AREA_SYS
, 0x080, 0,
734 CV1800_PINCONF_AREA_RTC
, 0x004),
735 CV1800_GENERAL_PIN(PIN_PWR_SEQ2
, VDDIO_RTC
,
737 CV1800_PINCONF_AREA_SYS
, 0x088, 3,
738 CV1800_PINCONF_AREA_RTC
, 0x00c),
739 CV1800_GENERAL_PIN(PIN_XTAL_XIN
, VDDIO_RTC
,
741 CV1800_PINCONF_AREA_SYS
, 0x0a0, 0,
742 CV1800_PINCONF_AREA_RTC
, 0x028),
745 static const struct cv1800_pinctrl_data cv1812h_pindata
= {
746 .pins
= cv1812h_pins
,
747 .pindata
= cv1812h_pin_data
,
748 .pdnames
= cv1812h_power_domain_desc
,
749 .vddio_ops
= &cv1812h_vddio_cfg_ops
,
750 .npins
= ARRAY_SIZE(cv1812h_pins
),
751 .npd
= ARRAY_SIZE(cv1812h_power_domain_desc
),
754 static const struct of_device_id cv1812h_pinctrl_ids
[] = {
755 { .compatible
= "sophgo,cv1812h-pinctrl", .data
= &cv1812h_pindata
},
758 MODULE_DEVICE_TABLE(of
, cv1812h_pinctrl_ids
);
760 static struct platform_driver cv1812h_pinctrl_driver
= {
761 .probe
= cv1800_pinctrl_probe
,
763 .name
= "cv1812h-pinctrl",
764 .suppress_bind_attrs
= true,
765 .of_match_table
= cv1812h_pinctrl_ids
,
768 module_platform_driver(cv1812h_pinctrl_driver
);
770 MODULE_DESCRIPTION("Pinctrl driver for the CV1812H series SoC");
771 MODULE_LICENSE("GPL");