162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0+
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2016 Freescale Semiconductor, Inc.
462306a36Sopenharmony_ci * Copyright 2017~2018 NXP
562306a36Sopenharmony_ci *	Dong Aisheng <aisheng.dong@nxp.com>
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#include <dt-bindings/pinctrl/pads-imx8qm.h>
962306a36Sopenharmony_ci#include <linux/err.h>
1062306a36Sopenharmony_ci#include <linux/firmware/imx/sci.h>
1162306a36Sopenharmony_ci#include <linux/init.h>
1262306a36Sopenharmony_ci#include <linux/module.h>
1362306a36Sopenharmony_ci#include <linux/of.h>
1462306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
1562306a36Sopenharmony_ci#include <linux/platform_device.h>
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#include "pinctrl-imx.h"
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_cistatic const struct pinctrl_pin_desc imx8qm_pinctrl_pads[] = {
2062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SIM0_CLK),
2162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SIM0_RST),
2262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SIM0_IO),
2362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SIM0_PD),
2462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SIM0_POWER_EN),
2562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SIM0_GPIO0_00),
2662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_SIM),
2762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_M40_I2C0_SCL),
2862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_M40_I2C0_SDA),
2962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_M40_GPIO0_00),
3062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_M40_GPIO0_01),
3162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_M41_I2C0_SCL),
3262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_M41_I2C0_SDA),
3362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_M41_GPIO0_00),
3462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_M41_GPIO0_01),
3562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_GPT0_CLK),
3662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_GPT0_CAPTURE),
3762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_GPT0_COMPARE),
3862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_GPT1_CLK),
3962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_GPT1_CAPTURE),
4062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_GPT1_COMPARE),
4162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_UART0_RX),
4262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_UART0_TX),
4362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_UART0_RTS_B),
4462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_UART0_CTS_B),
4562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_UART1_TX),
4662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_UART1_RX),
4762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_UART1_RTS_B),
4862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_UART1_CTS_B),
4962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIOLH),
5062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_PMIC_MEMC_ON),
5162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_WDOG_OUT),
5262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_PMIC_I2C_SDA),
5362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_PMIC_I2C_SCL),
5462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_PMIC_EARLY_WARNING),
5562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_PMIC_INT_B),
5662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_00),
5762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_01),
5862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_02),
5962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_03),
6062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_04),
6162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_05),
6262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_06),
6362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_GPIO0_07),
6462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE0),
6562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE1),
6662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE2),
6762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE3),
6862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE4),
6962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SCU_BOOT_MODE5),
7062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS0_GPIO00),
7162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS0_GPIO01),
7262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS0_I2C0_SCL),
7362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS0_I2C0_SDA),
7462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS0_I2C1_SCL),
7562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS0_I2C1_SDA),
7662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS1_GPIO00),
7762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS1_GPIO01),
7862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS1_I2C0_SCL),
7962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS1_I2C0_SDA),
8062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS1_I2C1_SCL),
8162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_LVDS1_I2C1_SDA),
8262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_LVDSGPIO),
8362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI0_I2C0_SCL),
8462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI0_I2C0_SDA),
8562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI0_GPIO0_00),
8662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI0_GPIO0_01),
8762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI1_I2C0_SCL),
8862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI1_I2C0_SDA),
8962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI1_GPIO0_00),
9062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_DSI1_GPIO0_01),
9162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_MIPIDSIGPIO),
9262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI0_MCLK_OUT),
9362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI0_I2C0_SCL),
9462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI0_I2C0_SDA),
9562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI0_GPIO0_00),
9662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI0_GPIO0_01),
9762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI1_MCLK_OUT),
9862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI1_GPIO0_00),
9962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI1_GPIO0_01),
10062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI1_I2C0_SCL),
10162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MIPI_CSI1_I2C0_SDA),
10262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_HDMI_TX0_TS_SCL),
10362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_HDMI_TX0_TS_SDA),
10462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_3V3_HDMIGPIO),
10562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI1_FSR),
10662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI1_FST),
10762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI1_SCKR),
10862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI1_SCKT),
10962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX0),
11062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX1),
11162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX2_RX3),
11262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX3_RX2),
11362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX4_RX1),
11462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI1_TX5_RX0),
11562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPDIF0_RX),
11662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPDIF0_TX),
11762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPDIF0_EXT_CLK),
11862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI3_SCK),
11962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI3_SDO),
12062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI3_SDI),
12162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI3_CS0),
12262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI3_CS1),
12362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIORHB),
12462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI0_FSR),
12562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI0_FST),
12662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI0_SCKR),
12762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI0_SCKT),
12862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX0),
12962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX1),
13062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX2_RX3),
13162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX3_RX2),
13262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX4_RX1),
13362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ESAI0_TX5_RX0),
13462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MCLK_IN0),
13562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MCLK_OUT0),
13662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIORHC),
13762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI0_SCK),
13862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI0_SDO),
13962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI0_SDI),
14062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI0_CS0),
14162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI0_CS1),
14262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI2_SCK),
14362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI2_SDO),
14462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI2_SDI),
14562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI2_CS0),
14662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SPI2_CS1),
14762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SAI1_RXC),
14862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SAI1_RXD),
14962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SAI1_RXFS),
15062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SAI1_TXC),
15162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SAI1_TXD),
15262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_SAI1_TXFS),
15362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIORHT),
15462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ADC_IN7),
15562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ADC_IN6),
15662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ADC_IN5),
15762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ADC_IN4),
15862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ADC_IN3),
15962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ADC_IN2),
16062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ADC_IN1),
16162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ADC_IN0),
16262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MLB_SIG),
16362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MLB_CLK),
16462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_MLB_DATA),
16562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIOLHT),
16662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_FLEXCAN0_RX),
16762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_FLEXCAN0_TX),
16862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_FLEXCAN1_RX),
16962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_FLEXCAN1_TX),
17062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_FLEXCAN2_RX),
17162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_FLEXCAN2_TX),
17262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIOTHR),
17362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USB_SS3_TC0),
17462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USB_SS3_TC1),
17562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USB_SS3_TC2),
17662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USB_SS3_TC3),
17762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_3V3_USB3IO),
17862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_RESET_B),
17962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_VSELECT),
18062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC2_RESET_B),
18162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC2_VSELECT),
18262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC2_WP),
18362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC2_CD_B),
18462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_VSELSEP),
18562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_MDIO),
18662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_MDC),
18762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_REFCLK_125M_25M),
18862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_REFCLK_125M_25M),
18962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_MDIO),
19062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_MDC),
19162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_GPIOCT),
19262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI1A_SS0_B),
19362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI1A_SS1_B),
19462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI1A_SCLK),
19562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI1A_DQS),
19662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI1A_DATA3),
19762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI1A_DATA2),
19862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI1A_DATA1),
19962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI1A_DATA0),
20062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_QSPI1),
20162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0A_DATA0),
20262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0A_DATA1),
20362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0A_DATA2),
20462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0A_DATA3),
20562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0A_DQS),
20662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0A_SS0_B),
20762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0A_SS1_B),
20862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0A_SCLK),
20962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0B_SCLK),
21062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0B_DATA0),
21162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0B_DATA1),
21262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0B_DATA2),
21362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0B_DATA3),
21462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0B_DQS),
21562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0B_SS0_B),
21662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_QSPI0B_SS1_B),
21762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_QSPI0),
21862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL0_CLKREQ_B),
21962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL0_WAKE_B),
22062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL0_PERST_B),
22162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL1_CLKREQ_B),
22262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL1_WAKE_B),
22362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_PCIE_CTRL1_PERST_B),
22462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_PCIESEP),
22562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USB_HSIC0_DATA),
22662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USB_HSIC0_STROBE),
22762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_CALIBRATION_0_HSIC),
22862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_CALIBRATION_1_HSIC),
22962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_CLK),
23062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_CMD),
23162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA0),
23262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA1),
23362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA2),
23462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA3),
23562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA4),
23662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA5),
23762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA6),
23862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_DATA7),
23962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_STROBE),
24062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_EMMC0_RESET_B),
24162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_SD1FIX),
24262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_CLK),
24362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_CMD),
24462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA0),
24562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA1),
24662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_CTL_NAND_RE_P_N),
24762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA2),
24862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA3),
24962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_CTL_NAND_DQS_P_N),
25062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA4),
25162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA5),
25262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA6),
25362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_DATA7),
25462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC1_STROBE),
25562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_VSEL2),
25662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC2_CLK),
25762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC2_CMD),
25862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC2_DATA0),
25962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC2_DATA1),
26062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC2_DATA2),
26162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_USDHC2_DATA3),
26262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_VSEL3),
26362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TXC),
26462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TX_CTL),
26562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TXD0),
26662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TXD1),
26762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TXD2),
26862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_TXD3),
26962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RXC),
27062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RX_CTL),
27162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RXD0),
27262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RXD1),
27362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RXD2),
27462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET0_RGMII_RXD3),
27562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB),
27662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TXC),
27762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TX_CTL),
27862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TXD0),
27962306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TXD1),
28062306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TXD2),
28162306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_TXD3),
28262306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RXC),
28362306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RX_CTL),
28462306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RXD0),
28562306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RXD1),
28662306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RXD2),
28762306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_ENET1_RGMII_RXD3),
28862306a36Sopenharmony_ci	IMX_PINCTRL_PIN(IMX8QM_COMP_CTL_GPIO_1V8_3V3_ENET_ENETA),
28962306a36Sopenharmony_ci};
29062306a36Sopenharmony_ci
29162306a36Sopenharmony_cistatic const struct imx_pinctrl_soc_info imx8qm_pinctrl_info = {
29262306a36Sopenharmony_ci	.pins = imx8qm_pinctrl_pads,
29362306a36Sopenharmony_ci	.npins = ARRAY_SIZE(imx8qm_pinctrl_pads),
29462306a36Sopenharmony_ci	.flags = IMX_USE_SCU,
29562306a36Sopenharmony_ci	.imx_pinconf_get = imx_pinconf_get_scu,
29662306a36Sopenharmony_ci	.imx_pinconf_set = imx_pinconf_set_scu,
29762306a36Sopenharmony_ci	.imx_pinctrl_parse_pin = imx_pinctrl_parse_pin_scu,
29862306a36Sopenharmony_ci};
29962306a36Sopenharmony_ci
30062306a36Sopenharmony_cistatic const struct of_device_id imx8qm_pinctrl_of_match[] = {
30162306a36Sopenharmony_ci	{ .compatible = "fsl,imx8qm-iomuxc", },
30262306a36Sopenharmony_ci	{ /* sentinel */ }
30362306a36Sopenharmony_ci};
30462306a36Sopenharmony_ciMODULE_DEVICE_TABLE(of, imx8qm_pinctrl_of_match);
30562306a36Sopenharmony_ci
30662306a36Sopenharmony_cistatic int imx8qm_pinctrl_probe(struct platform_device *pdev)
30762306a36Sopenharmony_ci{
30862306a36Sopenharmony_ci	int ret;
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_ci	ret = imx_pinctrl_sc_ipc_init(pdev);
31162306a36Sopenharmony_ci	if (ret)
31262306a36Sopenharmony_ci		return ret;
31362306a36Sopenharmony_ci
31462306a36Sopenharmony_ci	return imx_pinctrl_probe(pdev, &imx8qm_pinctrl_info);
31562306a36Sopenharmony_ci}
31662306a36Sopenharmony_ci
31762306a36Sopenharmony_cistatic struct platform_driver imx8qm_pinctrl_driver = {
31862306a36Sopenharmony_ci	.driver = {
31962306a36Sopenharmony_ci		.name = "imx8qm-pinctrl",
32062306a36Sopenharmony_ci		.of_match_table = imx8qm_pinctrl_of_match,
32162306a36Sopenharmony_ci		.suppress_bind_attrs = true,
32262306a36Sopenharmony_ci	},
32362306a36Sopenharmony_ci	.probe = imx8qm_pinctrl_probe,
32462306a36Sopenharmony_ci};
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_cistatic int __init imx8qm_pinctrl_init(void)
32762306a36Sopenharmony_ci{
32862306a36Sopenharmony_ci	return platform_driver_register(&imx8qm_pinctrl_driver);
32962306a36Sopenharmony_ci}
33062306a36Sopenharmony_ciarch_initcall(imx8qm_pinctrl_init);
33162306a36Sopenharmony_ci
33262306a36Sopenharmony_ciMODULE_AUTHOR("Aisheng Dong <aisheng.dong@nxp.com>");
33362306a36Sopenharmony_ciMODULE_DESCRIPTION("NXP i.MX8QM pinctrl driver");
33462306a36Sopenharmony_ciMODULE_LICENSE("GPL v2");
335