1f05c07b0SAisheng Dong // SPDX-License-Identifier: GPL-2.0+
2f05c07b0SAisheng Dong /*
3f05c07b0SAisheng Dong * Copyright (C) 2016 Freescale Semiconductor, Inc.
4f05c07b0SAisheng Dong * Copyright 2017~2018 NXP
5f05c07b0SAisheng Dong * Dong Aisheng <aisheng.dong@nxp.com>
6f05c07b0SAisheng Dong */
7f05c07b0SAisheng Dong
8f05c07b0SAisheng Dong #include <dt-bindings/pinctrl/pads-imx8qm.h>
9f05c07b0SAisheng Dong #include <linux/err.h>
10f05c07b0SAisheng Dong #include <linux/firmware/imx/sci.h>
11f05c07b0SAisheng Dong #include <linux/init.h>
12f05c07b0SAisheng Dong #include <linux/module.h>
13f05c07b0SAisheng Dong #include <linux/of.h>
14f05c07b0SAisheng Dong #include <linux/pinctrl/pinctrl.h>
15f05c07b0SAisheng Dong #include <linux/platform_device.h>
16f05c07b0SAisheng Dong
17f05c07b0SAisheng Dong #include "pinctrl-imx.h"
18f05c07b0SAisheng Dong
19f05c07b0SAisheng Dong static const struct pinctrl_pin_desc imx8qm_pinctrl_pads[] = {
20f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SIM0_CLK),
21f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SIM0_RST),
22f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SIM0_IO),
23f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SIM0_PD),
24f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SIM0_POWER_EN),
25f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SIM0_GPIO0_00),
26f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_SIM),
27f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_M40_I2C0_SCL),
28f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_M40_I2C0_SDA),
29f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_M40_GPIO0_00),
30f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_M40_GPIO0_01),
31f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_M41_I2C0_SCL),
32f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_M41_I2C0_SDA),
33f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_M41_GPIO0_00),
34f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_M41_GPIO0_01),
35f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_GPT0_CLK),
36f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_GPT0_CAPTURE),
37f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_GPT0_COMPARE),
38f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_GPT1_CLK),
39f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_GPT1_CAPTURE),
40f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_GPT1_COMPARE),
41f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_UART0_RX),
42f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_UART0_TX),
43f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_UART0_RTS_B),
44f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_UART0_CTS_B),
45f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_UART1_TX),
46f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_UART1_RX),
47f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_UART1_RTS_B),
48f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_UART1_CTS_B),
49f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIOLH),
50f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_PMIC_MEMC_ON),
51f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_WDOG_OUT),
52f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_PMIC_I2C_SDA),
53f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_PMIC_I2C_SCL),
54f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_PMIC_EARLY_WARNING),
55f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_PMIC_INT_B),
56f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_00),
57f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_01),
58f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_02),
59f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_03),
60f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_04),
61f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_05),
62f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_06),
63f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_07),
64f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE0),
65f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE1),
66f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE2),
67f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE3),
68f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE4),
69f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE5),
70f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS0_GPIO00),
71f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS0_GPIO01),
72f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS0_I2C0_SCL),
73f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS0_I2C0_SDA),
74f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS0_I2C1_SCL),
75f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS0_I2C1_SDA),
76f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS1_GPIO00),
77f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS1_GPIO01),
78f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS1_I2C0_SCL),
79f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS1_I2C0_SDA),
80f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS1_I2C1_SCL),
81f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_LVDS1_I2C1_SDA),
82f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_LVDSGPIO),
83f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI0_I2C0_SCL),
84f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI0_I2C0_SDA),
85f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI0_GPIO0_00),
86f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI0_GPIO0_01),
87f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI1_I2C0_SCL),
88f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI1_I2C0_SDA),
89f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI1_GPIO0_00),
90f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI1_GPIO0_01),
91f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_MIPIDSIGPIO),
92f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI0_MCLK_OUT),
93f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI0_I2C0_SCL),
94f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI0_I2C0_SDA),
95f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI0_GPIO0_00),
96f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI0_GPIO0_01),
97f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI1_MCLK_OUT),
98f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI1_GPIO0_00),
99f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI1_GPIO0_01),
100f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI1_I2C0_SCL),
101f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI1_I2C0_SDA),
102f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_HDMI_TX0_TS_SCL),
103f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_HDMI_TX0_TS_SDA),
104f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_3V3_HDMIGPIO),
105f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI1_FSR),
106f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI1_FST),
107f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI1_SCKR),
108f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI1_SCKT),
109f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX0),
110f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX1),
111f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX2_RX3),
112f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX3_RX2),
113f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX4_RX1),
114f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX5_RX0),
115f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPDIF0_RX),
116f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPDIF0_TX),
117f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPDIF0_EXT_CLK),
118f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI3_SCK),
119f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI3_SDO),
120f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI3_SDI),
121f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI3_CS0),
122f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI3_CS1),
123f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIORHB),
124f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI0_FSR),
125f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI0_FST),
126f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI0_SCKR),
127f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI0_SCKT),
128f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX0),
129f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX1),
130f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX2_RX3),
131f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX3_RX2),
132f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX4_RX1),
133f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX5_RX0),
134f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MCLK_IN0),
135f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MCLK_OUT0),
136f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIORHC),
137f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI0_SCK),
138f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI0_SDO),
139f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI0_SDI),
140f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI0_CS0),
141f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI0_CS1),
142f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI2_SCK),
143f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI2_SDO),
144f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI2_SDI),
145f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI2_CS0),
146f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SPI2_CS1),
147f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SAI1_RXC),
148f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SAI1_RXD),
149f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SAI1_RXFS),
150f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SAI1_TXC),
151f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SAI1_TXD),
152f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_SAI1_TXFS),
153f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIORHT),
154f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ADC_IN7),
155f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ADC_IN6),
156f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ADC_IN5),
157f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ADC_IN4),
158f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ADC_IN3),
159f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ADC_IN2),
160f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ADC_IN1),
161f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ADC_IN0),
162f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MLB_SIG),
163f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MLB_CLK),
164f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_MLB_DATA),
165f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIOLHT),
166f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_FLEXCAN0_RX),
167f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_FLEXCAN0_TX),
168f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_FLEXCAN1_RX),
169f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_FLEXCAN1_TX),
170f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_FLEXCAN2_RX),
171f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_FLEXCAN2_TX),
172f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIOTHR),
173f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USB_SS3_TC0),
174f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USB_SS3_TC1),
175f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USB_SS3_TC2),
176f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USB_SS3_TC3),
177f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_3V3_USB3IO),
178f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_RESET_B),
179f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_VSELECT),
180f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC2_RESET_B),
181f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC2_VSELECT),
182f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC2_WP),
183f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC2_CD_B),
184f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_VSELSEP),
185f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_MDIO),
186f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_MDC),
187f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_REFCLK_125M_25M),
188f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_REFCLK_125M_25M),
189f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_MDIO),
190f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_MDC),
191f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIOCT),
192f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI1A_SS0_B),
193f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI1A_SS1_B),
194f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI1A_SCLK),
195f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI1A_DQS),
196f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI1A_DATA3),
197f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI1A_DATA2),
198f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI1A_DATA1),
199f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI1A_DATA0),
200f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_QSPI1),
201f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0A_DATA0),
202f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0A_DATA1),
203f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0A_DATA2),
204f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0A_DATA3),
205f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0A_DQS),
206f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0A_SS0_B),
207f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0A_SS1_B),
208f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0A_SCLK),
209f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0B_SCLK),
210f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0B_DATA0),
211f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0B_DATA1),
212f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0B_DATA2),
213f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0B_DATA3),
214f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0B_DQS),
215f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0B_SS0_B),
216f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_QSPI0B_SS1_B),
217f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_QSPI0),
218f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL0_CLKREQ_B),
219f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL0_WAKE_B),
220f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL0_PERST_B),
221f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL1_CLKREQ_B),
222f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL1_WAKE_B),
223f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL1_PERST_B),
224f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_PCIESEP),
225f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USB_HSIC0_DATA),
226f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USB_HSIC0_STROBE),
227f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_CALIBRATION_0_HSIC),
228f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_CALIBRATION_1_HSIC),
229f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_CLK),
230f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_CMD),
231f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA0),
232f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA1),
233f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA2),
234f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA3),
235f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA4),
236f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA5),
237f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA6),
238f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA7),
239f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_STROBE),
240f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_EMMC0_RESET_B),
241f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_SD1FIX),
242f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_CLK),
243f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_CMD),
244f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA0),
245f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA1),
246f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_CTL_NAND_RE_P_N),
247f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA2),
248f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA3),
249f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_CTL_NAND_DQS_P_N),
250f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA4),
251f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA5),
252f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA6),
253f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA7),
254f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC1_STROBE),
255f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_VSEL2),
256f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC2_CLK),
257f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC2_CMD),
258f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC2_DATA0),
259f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC2_DATA1),
260f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC2_DATA2),
261f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_USDHC2_DATA3),
262f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_VSEL3),
263f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TXC),
264f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TX_CTL),
265f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TXD0),
266f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TXD1),
267f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TXD2),
268f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TXD3),
269f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RXC),
270f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RX_CTL),
271f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RXD0),
272f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RXD1),
273f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RXD2),
274f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RXD3),
275f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB),
276f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TXC),
277f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TX_CTL),
278f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TXD0),
279f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TXD1),
280f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TXD2),
281f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TXD3),
282f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RXC),
283f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RX_CTL),
284f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RXD0),
285f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RXD1),
286f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RXD2),
287f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RXD3),
288f05c07b0SAisheng Dong IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_ENET_ENETA),
289f05c07b0SAisheng Dong };
290f05c07b0SAisheng Dong
291f05c07b0SAisheng Dong static const struct imx_pinctrl_soc_info imx8qm_pinctrl_info = {
292f05c07b0SAisheng Dong .pins = imx8qm_pinctrl_pads,
293f05c07b0SAisheng Dong .npins = ARRAY_SIZE(imx8qm_pinctrl_pads),
294f05c07b0SAisheng Dong .flags = IMX_USE_SCU,
29507ae3f07SAnson Huang .imx_pinconf_get = imx_pinconf_get_scu,
29607ae3f07SAnson Huang .imx_pinconf_set = imx_pinconf_set_scu,
29707ae3f07SAnson Huang .imx_pinctrl_parse_pin = imx_pinctrl_parse_pin_scu,
298f05c07b0SAisheng Dong };
299f05c07b0SAisheng Dong
300f05c07b0SAisheng Dong static const struct of_device_id imx8qm_pinctrl_of_match[] = {
301f05c07b0SAisheng Dong { .compatible = "fsl,imx8qm-iomuxc", },
302f05c07b0SAisheng Dong { /* sentinel */ }
303f05c07b0SAisheng Dong };
30436d640faSAnson Huang MODULE_DEVICE_TABLE(of, imx8qm_pinctrl_of_match);
305f05c07b0SAisheng Dong
imx8qm_pinctrl_probe(struct platform_device * pdev)306f05c07b0SAisheng Dong static int imx8qm_pinctrl_probe(struct platform_device *pdev)
307f05c07b0SAisheng Dong {
308f05c07b0SAisheng Dong int ret;
309f05c07b0SAisheng Dong
310f05c07b0SAisheng Dong ret = imx_pinctrl_sc_ipc_init(pdev);
311f05c07b0SAisheng Dong if (ret)
312f05c07b0SAisheng Dong return ret;
313f05c07b0SAisheng Dong
314f05c07b0SAisheng Dong return imx_pinctrl_probe(pdev, &imx8qm_pinctrl_info);
315f05c07b0SAisheng Dong }
316f05c07b0SAisheng Dong
317f05c07b0SAisheng Dong static struct platform_driver imx8qm_pinctrl_driver = {
318f05c07b0SAisheng Dong .driver = {
319f05c07b0SAisheng Dong .name = "imx8qm-pinctrl",
320*f6b6db2dSFabio Estevam .of_match_table = imx8qm_pinctrl_of_match,
321f05c07b0SAisheng Dong .suppress_bind_attrs = true,
322f05c07b0SAisheng Dong },
323f05c07b0SAisheng Dong .probe = imx8qm_pinctrl_probe,
324f05c07b0SAisheng Dong };
325f05c07b0SAisheng Dong
imx8qm_pinctrl_init(void)326f05c07b0SAisheng Dong static int __init imx8qm_pinctrl_init(void)
327f05c07b0SAisheng Dong {
328f05c07b0SAisheng Dong return platform_driver_register(&imx8qm_pinctrl_driver);
329f05c07b0SAisheng Dong }
330f05c07b0SAisheng Dong arch_initcall(imx8qm_pinctrl_init);
33136d640faSAnson Huang
33236d640faSAnson Huang MODULE_AUTHOR("Aisheng Dong <aisheng.dong@nxp.com>");
33336d640faSAnson Huang MODULE_DESCRIPTION("NXP i.MX8QM pinctrl driver");
33436d640faSAnson Huang MODULE_LICENSE("GPL v2");
335