18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci//
38c2ecf20Sopenharmony_ci// Freescale imx6ul pinctrl driver
48c2ecf20Sopenharmony_ci//
58c2ecf20Sopenharmony_ci// Author: Anson Huang <Anson.Huang@freescale.com>
68c2ecf20Sopenharmony_ci// Copyright (C) 2015 Freescale Semiconductor, Inc.
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include <linux/err.h>
98c2ecf20Sopenharmony_ci#include <linux/init.h>
108c2ecf20Sopenharmony_ci#include <linux/io.h>
118c2ecf20Sopenharmony_ci#include <linux/of.h>
128c2ecf20Sopenharmony_ci#include <linux/of_device.h>
138c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include "pinctrl-imx.h"
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_cienum imx6ul_pads {
188c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE0 = 0,
198c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE1 = 1,
208c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE2 = 2,
218c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE3 = 3,
228c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE4 = 4,
238c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE5 = 5,
248c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE6 = 6,
258c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE7 = 7,
268c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE8 = 8,
278c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE9 = 9,
288c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE10 = 10,
298c2ecf20Sopenharmony_ci	MX6UL_PAD_SNVS_TAMPER4 = 11,
308c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE12 = 12,
318c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE13 = 13,
328c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE14 = 14,
338c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE15 = 15,
348c2ecf20Sopenharmony_ci	MX6UL_PAD_RESERVE16 = 16,
358c2ecf20Sopenharmony_ci	MX6UL_PAD_JTAG_MOD = 17,
368c2ecf20Sopenharmony_ci	MX6UL_PAD_JTAG_TMS = 18,
378c2ecf20Sopenharmony_ci	MX6UL_PAD_JTAG_TDO = 19,
388c2ecf20Sopenharmony_ci	MX6UL_PAD_JTAG_TDI = 20,
398c2ecf20Sopenharmony_ci	MX6UL_PAD_JTAG_TCK = 21,
408c2ecf20Sopenharmony_ci	MX6UL_PAD_JTAG_TRST_B = 22,
418c2ecf20Sopenharmony_ci	MX6UL_PAD_GPIO1_IO00 = 23,
428c2ecf20Sopenharmony_ci	MX6UL_PAD_GPIO1_IO01 = 24,
438c2ecf20Sopenharmony_ci	MX6UL_PAD_GPIO1_IO02 = 25,
448c2ecf20Sopenharmony_ci	MX6UL_PAD_GPIO1_IO03 = 26,
458c2ecf20Sopenharmony_ci	MX6UL_PAD_GPIO1_IO04 = 27,
468c2ecf20Sopenharmony_ci	MX6UL_PAD_GPIO1_IO05 = 28,
478c2ecf20Sopenharmony_ci	MX6UL_PAD_GPIO1_IO06 = 29,
488c2ecf20Sopenharmony_ci	MX6UL_PAD_GPIO1_IO07 = 30,
498c2ecf20Sopenharmony_ci	MX6UL_PAD_GPIO1_IO08 = 31,
508c2ecf20Sopenharmony_ci	MX6UL_PAD_GPIO1_IO09 = 32,
518c2ecf20Sopenharmony_ci	MX6UL_PAD_UART1_TX_DATA = 33,
528c2ecf20Sopenharmony_ci	MX6UL_PAD_UART1_RX_DATA = 34,
538c2ecf20Sopenharmony_ci	MX6UL_PAD_UART1_CTS_B = 35,
548c2ecf20Sopenharmony_ci	MX6UL_PAD_UART1_RTS_B = 36,
558c2ecf20Sopenharmony_ci	MX6UL_PAD_UART2_TX_DATA = 37,
568c2ecf20Sopenharmony_ci	MX6UL_PAD_UART2_RX_DATA = 38,
578c2ecf20Sopenharmony_ci	MX6UL_PAD_UART2_CTS_B = 39,
588c2ecf20Sopenharmony_ci	MX6UL_PAD_UART2_RTS_B = 40,
598c2ecf20Sopenharmony_ci	MX6UL_PAD_UART3_TX_DATA = 41,
608c2ecf20Sopenharmony_ci	MX6UL_PAD_UART3_RX_DATA = 42,
618c2ecf20Sopenharmony_ci	MX6UL_PAD_UART3_CTS_B = 43,
628c2ecf20Sopenharmony_ci	MX6UL_PAD_UART3_RTS_B = 44,
638c2ecf20Sopenharmony_ci	MX6UL_PAD_UART4_TX_DATA = 45,
648c2ecf20Sopenharmony_ci	MX6UL_PAD_UART4_RX_DATA = 46,
658c2ecf20Sopenharmony_ci	MX6UL_PAD_UART5_TX_DATA = 47,
668c2ecf20Sopenharmony_ci	MX6UL_PAD_UART5_RX_DATA = 48,
678c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET1_RX_DATA0 = 49,
688c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET1_RX_DATA1 = 50,
698c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET1_RX_EN = 51,
708c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET1_TX_DATA0 = 52,
718c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET1_TX_DATA1 = 53,
728c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET1_TX_EN = 54,
738c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET1_TX_CLK = 55,
748c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET1_RX_ER = 56,
758c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET2_RX_DATA0 = 57,
768c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET2_RX_DATA1 = 58,
778c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET2_RX_EN = 59,
788c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET2_TX_DATA0 = 60,
798c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET2_TX_DATA1 = 61,
808c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET2_TX_EN = 62,
818c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET2_TX_CLK = 63,
828c2ecf20Sopenharmony_ci	MX6UL_PAD_ENET2_RX_ER = 64,
838c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_CLK = 65,
848c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_ENABLE = 66,
858c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_HSYNC = 67,
868c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_VSYNC = 68,
878c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_RESET = 69,
888c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA00 = 70,
898c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA01 = 71,
908c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA02 = 72,
918c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA03 = 73,
928c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA04 = 74,
938c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA05 = 75,
948c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA06 = 76,
958c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA07 = 77,
968c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA08 = 78,
978c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA09 = 79,
988c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA10 = 80,
998c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA11 = 81,
1008c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA12 = 82,
1018c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA13 = 83,
1028c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA14 = 84,
1038c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA15 = 85,
1048c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA16 = 86,
1058c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA17 = 87,
1068c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA18 = 88,
1078c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA19 = 89,
1088c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA20 = 90,
1098c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA21 = 91,
1108c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA22 = 92,
1118c2ecf20Sopenharmony_ci	MX6UL_PAD_LCD_DATA23 = 93,
1128c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_RE_B = 94,
1138c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_WE_B = 95,
1148c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_DATA00 = 96,
1158c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_DATA01 = 97,
1168c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_DATA02 = 98,
1178c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_DATA03 = 99,
1188c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_DATA04 = 100,
1198c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_DATA05 = 101,
1208c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_DATA06 = 102,
1218c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_DATA07 = 103,
1228c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_ALE = 104,
1238c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_WP_B = 105,
1248c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_READY_B = 106,
1258c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_CE0_B = 107,
1268c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_CE1_B = 108,
1278c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_CLE = 109,
1288c2ecf20Sopenharmony_ci	MX6UL_PAD_NAND_DQS = 110,
1298c2ecf20Sopenharmony_ci	MX6UL_PAD_SD1_CMD = 111,
1308c2ecf20Sopenharmony_ci	MX6UL_PAD_SD1_CLK = 112,
1318c2ecf20Sopenharmony_ci	MX6UL_PAD_SD1_DATA0 = 113,
1328c2ecf20Sopenharmony_ci	MX6UL_PAD_SD1_DATA1 = 114,
1338c2ecf20Sopenharmony_ci	MX6UL_PAD_SD1_DATA2 = 115,
1348c2ecf20Sopenharmony_ci	MX6UL_PAD_SD1_DATA3 = 116,
1358c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_MCLK = 117,
1368c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_PIXCLK = 118,
1378c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_VSYNC = 119,
1388c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_HSYNC = 120,
1398c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_DATA00 = 121,
1408c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_DATA01 = 122,
1418c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_DATA02 = 123,
1428c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_DATA03 = 124,
1438c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_DATA04 = 125,
1448c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_DATA05 = 126,
1458c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_DATA06 = 127,
1468c2ecf20Sopenharmony_ci	MX6UL_PAD_CSI_DATA07 = 128,
1478c2ecf20Sopenharmony_ci};
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_cienum imx6ull_lpsr_pads {
1508c2ecf20Sopenharmony_ci	MX6ULL_PAD_BOOT_MODE0 = 0,
1518c2ecf20Sopenharmony_ci	MX6ULL_PAD_BOOT_MODE1 = 1,
1528c2ecf20Sopenharmony_ci	MX6ULL_PAD_SNVS_TAMPER0 = 2,
1538c2ecf20Sopenharmony_ci	MX6ULL_PAD_SNVS_TAMPER1 = 3,
1548c2ecf20Sopenharmony_ci	MX6ULL_PAD_SNVS_TAMPER2 = 4,
1558c2ecf20Sopenharmony_ci	MX6ULL_PAD_SNVS_TAMPER3 = 5,
1568c2ecf20Sopenharmony_ci	MX6ULL_PAD_SNVS_TAMPER4 = 6,
1578c2ecf20Sopenharmony_ci	MX6ULL_PAD_SNVS_TAMPER5 = 7,
1588c2ecf20Sopenharmony_ci	MX6ULL_PAD_SNVS_TAMPER6 = 8,
1598c2ecf20Sopenharmony_ci	MX6ULL_PAD_SNVS_TAMPER7 = 9,
1608c2ecf20Sopenharmony_ci	MX6ULL_PAD_SNVS_TAMPER8 = 10,
1618c2ecf20Sopenharmony_ci	MX6ULL_PAD_SNVS_TAMPER9 = 11,
1628c2ecf20Sopenharmony_ci};
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci/* Pad names for the pinmux subsystem */
1658c2ecf20Sopenharmony_cistatic const struct pinctrl_pin_desc imx6ul_pinctrl_pads[] = {
1668c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE0),
1678c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE1),
1688c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE2),
1698c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE3),
1708c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE4),
1718c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE5),
1728c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE6),
1738c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE7),
1748c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE8),
1758c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE9),
1768c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE10),
1778c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_SNVS_TAMPER4),
1788c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE12),
1798c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE13),
1808c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE14),
1818c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE15),
1828c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_RESERVE16),
1838c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_JTAG_MOD),
1848c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_JTAG_TMS),
1858c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_JTAG_TDO),
1868c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_JTAG_TDI),
1878c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_JTAG_TCK),
1888c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_JTAG_TRST_B),
1898c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_GPIO1_IO00),
1908c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_GPIO1_IO01),
1918c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_GPIO1_IO02),
1928c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_GPIO1_IO03),
1938c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_GPIO1_IO04),
1948c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_GPIO1_IO05),
1958c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_GPIO1_IO06),
1968c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_GPIO1_IO07),
1978c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_GPIO1_IO08),
1988c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_GPIO1_IO09),
1998c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART1_TX_DATA),
2008c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART1_RX_DATA),
2018c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART1_CTS_B),
2028c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART1_RTS_B),
2038c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART2_TX_DATA),
2048c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART2_RX_DATA),
2058c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART2_CTS_B),
2068c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART2_RTS_B),
2078c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART3_TX_DATA),
2088c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART3_RX_DATA),
2098c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART3_CTS_B),
2108c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART3_RTS_B),
2118c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART4_TX_DATA),
2128c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART4_RX_DATA),
2138c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART5_TX_DATA),
2148c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_UART5_RX_DATA),
2158c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET1_RX_DATA0),
2168c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET1_RX_DATA1),
2178c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET1_RX_EN),
2188c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET1_TX_DATA0),
2198c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET1_TX_DATA1),
2208c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET1_TX_EN),
2218c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET1_TX_CLK),
2228c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET1_RX_ER),
2238c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET2_RX_DATA0),
2248c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET2_RX_DATA1),
2258c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET2_RX_EN),
2268c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET2_TX_DATA0),
2278c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET2_TX_DATA1),
2288c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET2_TX_EN),
2298c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET2_TX_CLK),
2308c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_ENET2_RX_ER),
2318c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_CLK),
2328c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_ENABLE),
2338c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_HSYNC),
2348c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_VSYNC),
2358c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_RESET),
2368c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA00),
2378c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA01),
2388c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA02),
2398c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA03),
2408c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA04),
2418c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA05),
2428c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA06),
2438c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA07),
2448c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA08),
2458c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA09),
2468c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA10),
2478c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA11),
2488c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA12),
2498c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA13),
2508c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA14),
2518c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA15),
2528c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA16),
2538c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA17),
2548c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA18),
2558c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA19),
2568c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA20),
2578c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA21),
2588c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA22),
2598c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_LCD_DATA23),
2608c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_RE_B),
2618c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_WE_B),
2628c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_DATA00),
2638c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_DATA01),
2648c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_DATA02),
2658c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_DATA03),
2668c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_DATA04),
2678c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_DATA05),
2688c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_DATA06),
2698c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_DATA07),
2708c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_ALE),
2718c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_WP_B),
2728c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_READY_B),
2738c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_CE0_B),
2748c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_CE1_B),
2758c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_CLE),
2768c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_NAND_DQS),
2778c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_SD1_CMD),
2788c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_SD1_CLK),
2798c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_SD1_DATA0),
2808c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_SD1_DATA1),
2818c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_SD1_DATA2),
2828c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_SD1_DATA3),
2838c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_MCLK),
2848c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_PIXCLK),
2858c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_VSYNC),
2868c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_HSYNC),
2878c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_DATA00),
2888c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_DATA01),
2898c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_DATA02),
2908c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_DATA03),
2918c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_DATA04),
2928c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_DATA05),
2938c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_DATA06),
2948c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6UL_PAD_CSI_DATA07),
2958c2ecf20Sopenharmony_ci};
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci/* pad for i.MX6ULL lpsr pinmux */
2988c2ecf20Sopenharmony_cistatic const struct pinctrl_pin_desc imx6ull_snvs_pinctrl_pads[] = {
2998c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_BOOT_MODE0),
3008c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_BOOT_MODE1),
3018c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_SNVS_TAMPER0),
3028c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_SNVS_TAMPER1),
3038c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_SNVS_TAMPER2),
3048c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_SNVS_TAMPER3),
3058c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_SNVS_TAMPER4),
3068c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_SNVS_TAMPER5),
3078c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_SNVS_TAMPER6),
3088c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_SNVS_TAMPER7),
3098c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_SNVS_TAMPER8),
3108c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(MX6ULL_PAD_SNVS_TAMPER9),
3118c2ecf20Sopenharmony_ci};
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_cistatic const struct imx_pinctrl_soc_info imx6ul_pinctrl_info = {
3148c2ecf20Sopenharmony_ci	.pins = imx6ul_pinctrl_pads,
3158c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(imx6ul_pinctrl_pads),
3168c2ecf20Sopenharmony_ci	.gpr_compatible = "fsl,imx6ul-iomuxc-gpr",
3178c2ecf20Sopenharmony_ci};
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_cistatic const struct imx_pinctrl_soc_info imx6ull_snvs_pinctrl_info = {
3208c2ecf20Sopenharmony_ci	.pins = imx6ull_snvs_pinctrl_pads,
3218c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(imx6ull_snvs_pinctrl_pads),
3228c2ecf20Sopenharmony_ci	.flags = ZERO_OFFSET_VALID,
3238c2ecf20Sopenharmony_ci};
3248c2ecf20Sopenharmony_ci
3258c2ecf20Sopenharmony_cistatic const struct of_device_id imx6ul_pinctrl_of_match[] = {
3268c2ecf20Sopenharmony_ci	{ .compatible = "fsl,imx6ul-iomuxc", .data = &imx6ul_pinctrl_info, },
3278c2ecf20Sopenharmony_ci	{ .compatible = "fsl,imx6ull-iomuxc-snvs", .data = &imx6ull_snvs_pinctrl_info, },
3288c2ecf20Sopenharmony_ci	{ /* sentinel */ }
3298c2ecf20Sopenharmony_ci};
3308c2ecf20Sopenharmony_ci
3318c2ecf20Sopenharmony_cistatic int imx6ul_pinctrl_probe(struct platform_device *pdev)
3328c2ecf20Sopenharmony_ci{
3338c2ecf20Sopenharmony_ci	const struct imx_pinctrl_soc_info *pinctrl_info;
3348c2ecf20Sopenharmony_ci
3358c2ecf20Sopenharmony_ci	pinctrl_info = of_device_get_match_data(&pdev->dev);
3368c2ecf20Sopenharmony_ci	if (!pinctrl_info)
3378c2ecf20Sopenharmony_ci		return -ENODEV;
3388c2ecf20Sopenharmony_ci
3398c2ecf20Sopenharmony_ci	return imx_pinctrl_probe(pdev, pinctrl_info);
3408c2ecf20Sopenharmony_ci}
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_cistatic struct platform_driver imx6ul_pinctrl_driver = {
3438c2ecf20Sopenharmony_ci	.driver = {
3448c2ecf20Sopenharmony_ci		.name = "imx6ul-pinctrl",
3458c2ecf20Sopenharmony_ci		.of_match_table = of_match_ptr(imx6ul_pinctrl_of_match),
3468c2ecf20Sopenharmony_ci	},
3478c2ecf20Sopenharmony_ci	.probe = imx6ul_pinctrl_probe,
3488c2ecf20Sopenharmony_ci};
3498c2ecf20Sopenharmony_ci
3508c2ecf20Sopenharmony_cistatic int __init imx6ul_pinctrl_init(void)
3518c2ecf20Sopenharmony_ci{
3528c2ecf20Sopenharmony_ci	return platform_driver_register(&imx6ul_pinctrl_driver);
3538c2ecf20Sopenharmony_ci}
3548c2ecf20Sopenharmony_ciarch_initcall(imx6ul_pinctrl_init);
355