2 * imx25 pinctrl driver.
4 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
6 * This driver was mostly copied from the imx51 pinctrl driver which has:
8 * Copyright (C) 2012 Freescale Semiconductor, Inc.
9 * Copyright (C) 2012 Linaro, Inc.
11 * Author: Denis Carikli <denis@eukrea.com>
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as published
15 * by the Free Software Foundation.
18 #include <linux/err.h>
19 #include <linux/init.h>
21 #include <linux/module.h>
23 #include <linux/of_device.h>
24 #include <linux/pinctrl/pinctrl.h>
26 #include "pinctrl-imx.h"
29 MX25_PAD_RESERVE0 = 1,
30 MX25_PAD_RESERVE1 = 2,
99 MX25_PAD_CONTRAST = 71,
101 MX25_PAD_CSI_D2 = 73,
102 MX25_PAD_CSI_D3 = 74,
103 MX25_PAD_CSI_D4 = 75,
104 MX25_PAD_CSI_D5 = 76,
105 MX25_PAD_CSI_D6 = 77,
106 MX25_PAD_CSI_D7 = 78,
107 MX25_PAD_CSI_D8 = 79,
108 MX25_PAD_CSI_D9 = 80,
109 MX25_PAD_CSI_MCLK = 81,
110 MX25_PAD_CSI_VSYNC = 82,
111 MX25_PAD_CSI_HSYNC = 83,
112 MX25_PAD_CSI_PIXCLK = 84,
113 MX25_PAD_I2C1_CLK = 85,
114 MX25_PAD_I2C1_DAT = 86,
115 MX25_PAD_CSPI1_MOSI = 87,
116 MX25_PAD_CSPI1_MISO = 88,
117 MX25_PAD_CSPI1_SS0 = 89,
118 MX25_PAD_CSPI1_SS1 = 90,
119 MX25_PAD_CSPI1_SCLK = 91,
120 MX25_PAD_CSPI1_RDY = 92,
121 MX25_PAD_UART1_RXD = 93,
122 MX25_PAD_UART1_TXD = 94,
123 MX25_PAD_UART1_RTS = 95,
124 MX25_PAD_UART1_CTS = 96,
125 MX25_PAD_UART2_RXD = 97,
126 MX25_PAD_UART2_TXD = 98,
127 MX25_PAD_UART2_RTS = 99,
128 MX25_PAD_UART2_CTS = 100,
129 MX25_PAD_SD1_CMD = 101,
130 MX25_PAD_SD1_CLK = 102,
131 MX25_PAD_SD1_DATA0 = 103,
132 MX25_PAD_SD1_DATA1 = 104,
133 MX25_PAD_SD1_DATA2 = 105,
134 MX25_PAD_SD1_DATA3 = 106,
135 MX25_PAD_KPP_ROW0 = 107,
136 MX25_PAD_KPP_ROW1 = 108,
137 MX25_PAD_KPP_ROW2 = 109,
138 MX25_PAD_KPP_ROW3 = 110,
139 MX25_PAD_KPP_COL0 = 111,
140 MX25_PAD_KPP_COL1 = 112,
141 MX25_PAD_KPP_COL2 = 113,
142 MX25_PAD_KPP_COL3 = 114,
143 MX25_PAD_FEC_MDC = 115,
144 MX25_PAD_FEC_MDIO = 116,
145 MX25_PAD_FEC_TDATA0 = 117,
146 MX25_PAD_FEC_TDATA1 = 118,
147 MX25_PAD_FEC_TX_EN = 119,
148 MX25_PAD_FEC_RDATA0 = 120,
149 MX25_PAD_FEC_RDATA1 = 121,
150 MX25_PAD_FEC_RX_DV = 122,
151 MX25_PAD_FEC_TX_CLK = 123,
154 MX25_PAD_GPIO_A = 126,
155 MX25_PAD_GPIO_B = 127,
156 MX25_PAD_GPIO_C = 128,
157 MX25_PAD_GPIO_D = 129,
158 MX25_PAD_GPIO_E = 130,
159 MX25_PAD_GPIO_F = 131,
160 MX25_PAD_EXT_ARMCLK = 132,
161 MX25_PAD_UPLL_BYPCLK = 133,
162 MX25_PAD_VSTBY_REQ = 134,
163 MX25_PAD_VSTBY_ACK = 135,
164 MX25_PAD_POWER_FAIL = 136,
166 MX25_PAD_BOOT_MODE0 = 138,
167 MX25_PAD_BOOT_MODE1 = 139,
170 /* Pad names for the pinmux subsystem */
171 static const struct pinctrl_pin_desc imx25_pinctrl_pads[] = {
172 IMX_PINCTRL_PIN(MX25_PAD_RESERVE0),
173 IMX_PINCTRL_PIN(MX25_PAD_RESERVE1),
174 IMX_PINCTRL_PIN(MX25_PAD_A10),
175 IMX_PINCTRL_PIN(MX25_PAD_A13),
176 IMX_PINCTRL_PIN(MX25_PAD_A14),
177 IMX_PINCTRL_PIN(MX25_PAD_A15),
178 IMX_PINCTRL_PIN(MX25_PAD_A16),
179 IMX_PINCTRL_PIN(MX25_PAD_A17),
180 IMX_PINCTRL_PIN(MX25_PAD_A18),
181 IMX_PINCTRL_PIN(MX25_PAD_A19),
182 IMX_PINCTRL_PIN(MX25_PAD_A20),
183 IMX_PINCTRL_PIN(MX25_PAD_A21),
184 IMX_PINCTRL_PIN(MX25_PAD_A22),
185 IMX_PINCTRL_PIN(MX25_PAD_A23),
186 IMX_PINCTRL_PIN(MX25_PAD_A24),
187 IMX_PINCTRL_PIN(MX25_PAD_A25),
188 IMX_PINCTRL_PIN(MX25_PAD_EB0),
189 IMX_PINCTRL_PIN(MX25_PAD_EB1),
190 IMX_PINCTRL_PIN(MX25_PAD_OE),
191 IMX_PINCTRL_PIN(MX25_PAD_CS0),
192 IMX_PINCTRL_PIN(MX25_PAD_CS1),
193 IMX_PINCTRL_PIN(MX25_PAD_CS4),
194 IMX_PINCTRL_PIN(MX25_PAD_CS5),
195 IMX_PINCTRL_PIN(MX25_PAD_NF_CE0),
196 IMX_PINCTRL_PIN(MX25_PAD_ECB),
197 IMX_PINCTRL_PIN(MX25_PAD_LBA),
198 IMX_PINCTRL_PIN(MX25_PAD_BCLK),
199 IMX_PINCTRL_PIN(MX25_PAD_RW),
200 IMX_PINCTRL_PIN(MX25_PAD_NFWE_B),
201 IMX_PINCTRL_PIN(MX25_PAD_NFRE_B),
202 IMX_PINCTRL_PIN(MX25_PAD_NFALE),
203 IMX_PINCTRL_PIN(MX25_PAD_NFCLE),
204 IMX_PINCTRL_PIN(MX25_PAD_NFWP_B),
205 IMX_PINCTRL_PIN(MX25_PAD_NFRB),
206 IMX_PINCTRL_PIN(MX25_PAD_D15),
207 IMX_PINCTRL_PIN(MX25_PAD_D14),
208 IMX_PINCTRL_PIN(MX25_PAD_D13),
209 IMX_PINCTRL_PIN(MX25_PAD_D12),
210 IMX_PINCTRL_PIN(MX25_PAD_D11),
211 IMX_PINCTRL_PIN(MX25_PAD_D10),
212 IMX_PINCTRL_PIN(MX25_PAD_D9),
213 IMX_PINCTRL_PIN(MX25_PAD_D8),
214 IMX_PINCTRL_PIN(MX25_PAD_D7),
215 IMX_PINCTRL_PIN(MX25_PAD_D6),
216 IMX_PINCTRL_PIN(MX25_PAD_D5),
217 IMX_PINCTRL_PIN(MX25_PAD_D4),
218 IMX_PINCTRL_PIN(MX25_PAD_D3),
219 IMX_PINCTRL_PIN(MX25_PAD_D2),
220 IMX_PINCTRL_PIN(MX25_PAD_D1),
221 IMX_PINCTRL_PIN(MX25_PAD_D0),
222 IMX_PINCTRL_PIN(MX25_PAD_LD0),
223 IMX_PINCTRL_PIN(MX25_PAD_LD1),
224 IMX_PINCTRL_PIN(MX25_PAD_LD2),
225 IMX_PINCTRL_PIN(MX25_PAD_LD3),
226 IMX_PINCTRL_PIN(MX25_PAD_LD4),
227 IMX_PINCTRL_PIN(MX25_PAD_LD5),
228 IMX_PINCTRL_PIN(MX25_PAD_LD6),
229 IMX_PINCTRL_PIN(MX25_PAD_LD7),
230 IMX_PINCTRL_PIN(MX25_PAD_LD8),
231 IMX_PINCTRL_PIN(MX25_PAD_LD9),
232 IMX_PINCTRL_PIN(MX25_PAD_LD10),
233 IMX_PINCTRL_PIN(MX25_PAD_LD11),
234 IMX_PINCTRL_PIN(MX25_PAD_LD12),
235 IMX_PINCTRL_PIN(MX25_PAD_LD13),
236 IMX_PINCTRL_PIN(MX25_PAD_LD14),
237 IMX_PINCTRL_PIN(MX25_PAD_LD15),
238 IMX_PINCTRL_PIN(MX25_PAD_HSYNC),
239 IMX_PINCTRL_PIN(MX25_PAD_VSYNC),
240 IMX_PINCTRL_PIN(MX25_PAD_LSCLK),
241 IMX_PINCTRL_PIN(MX25_PAD_OE_ACD),
242 IMX_PINCTRL_PIN(MX25_PAD_CONTRAST),
243 IMX_PINCTRL_PIN(MX25_PAD_PWM),
244 IMX_PINCTRL_PIN(MX25_PAD_CSI_D2),
245 IMX_PINCTRL_PIN(MX25_PAD_CSI_D3),
246 IMX_PINCTRL_PIN(MX25_PAD_CSI_D4),
247 IMX_PINCTRL_PIN(MX25_PAD_CSI_D5),
248 IMX_PINCTRL_PIN(MX25_PAD_CSI_D6),
249 IMX_PINCTRL_PIN(MX25_PAD_CSI_D7),
250 IMX_PINCTRL_PIN(MX25_PAD_CSI_D8),
251 IMX_PINCTRL_PIN(MX25_PAD_CSI_D9),
252 IMX_PINCTRL_PIN(MX25_PAD_CSI_MCLK),
253 IMX_PINCTRL_PIN(MX25_PAD_CSI_VSYNC),
254 IMX_PINCTRL_PIN(MX25_PAD_CSI_HSYNC),
255 IMX_PINCTRL_PIN(MX25_PAD_CSI_PIXCLK),
256 IMX_PINCTRL_PIN(MX25_PAD_I2C1_CLK),
257 IMX_PINCTRL_PIN(MX25_PAD_I2C1_DAT),
258 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_MOSI),
259 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_MISO),
260 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_SS0),
261 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_SS1),
262 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_SCLK),
263 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_RDY),
264 IMX_PINCTRL_PIN(MX25_PAD_UART1_RXD),
265 IMX_PINCTRL_PIN(MX25_PAD_UART1_TXD),
266 IMX_PINCTRL_PIN(MX25_PAD_UART1_RTS),
267 IMX_PINCTRL_PIN(MX25_PAD_UART1_CTS),
268 IMX_PINCTRL_PIN(MX25_PAD_UART2_RXD),
269 IMX_PINCTRL_PIN(MX25_PAD_UART2_TXD),
270 IMX_PINCTRL_PIN(MX25_PAD_UART2_RTS),
271 IMX_PINCTRL_PIN(MX25_PAD_UART2_CTS),
272 IMX_PINCTRL_PIN(MX25_PAD_SD1_CMD),
273 IMX_PINCTRL_PIN(MX25_PAD_SD1_CLK),
274 IMX_PINCTRL_PIN(MX25_PAD_SD1_DATA0),
275 IMX_PINCTRL_PIN(MX25_PAD_SD1_DATA1),
276 IMX_PINCTRL_PIN(MX25_PAD_SD1_DATA2),
277 IMX_PINCTRL_PIN(MX25_PAD_SD1_DATA3),
278 IMX_PINCTRL_PIN(MX25_PAD_KPP_ROW0),
279 IMX_PINCTRL_PIN(MX25_PAD_KPP_ROW1),
280 IMX_PINCTRL_PIN(MX25_PAD_KPP_ROW2),
281 IMX_PINCTRL_PIN(MX25_PAD_KPP_ROW3),
282 IMX_PINCTRL_PIN(MX25_PAD_KPP_COL0),
283 IMX_PINCTRL_PIN(MX25_PAD_KPP_COL1),
284 IMX_PINCTRL_PIN(MX25_PAD_KPP_COL2),
285 IMX_PINCTRL_PIN(MX25_PAD_KPP_COL3),
286 IMX_PINCTRL_PIN(MX25_PAD_FEC_MDC),
287 IMX_PINCTRL_PIN(MX25_PAD_FEC_MDIO),
288 IMX_PINCTRL_PIN(MX25_PAD_FEC_TDATA0),
289 IMX_PINCTRL_PIN(MX25_PAD_FEC_TDATA1),
290 IMX_PINCTRL_PIN(MX25_PAD_FEC_TX_EN),
291 IMX_PINCTRL_PIN(MX25_PAD_FEC_RDATA0),
292 IMX_PINCTRL_PIN(MX25_PAD_FEC_RDATA1),
293 IMX_PINCTRL_PIN(MX25_PAD_FEC_RX_DV),
294 IMX_PINCTRL_PIN(MX25_PAD_FEC_TX_CLK),
295 IMX_PINCTRL_PIN(MX25_PAD_RTCK),
296 IMX_PINCTRL_PIN(MX25_PAD_DE_B),
297 IMX_PINCTRL_PIN(MX25_PAD_GPIO_A),
298 IMX_PINCTRL_PIN(MX25_PAD_GPIO_B),
299 IMX_PINCTRL_PIN(MX25_PAD_GPIO_C),
300 IMX_PINCTRL_PIN(MX25_PAD_GPIO_D),
301 IMX_PINCTRL_PIN(MX25_PAD_GPIO_E),
302 IMX_PINCTRL_PIN(MX25_PAD_GPIO_F),
303 IMX_PINCTRL_PIN(MX25_PAD_EXT_ARMCLK),
304 IMX_PINCTRL_PIN(MX25_PAD_UPLL_BYPCLK),
305 IMX_PINCTRL_PIN(MX25_PAD_VSTBY_REQ),
306 IMX_PINCTRL_PIN(MX25_PAD_VSTBY_ACK),
307 IMX_PINCTRL_PIN(MX25_PAD_POWER_FAIL),
308 IMX_PINCTRL_PIN(MX25_PAD_CLKO),
309 IMX_PINCTRL_PIN(MX25_PAD_BOOT_MODE0),
310 IMX_PINCTRL_PIN(MX25_PAD_BOOT_MODE1),
313 static struct imx_pinctrl_soc_info imx25_pinctrl_info = {
314 .pins = imx25_pinctrl_pads,
315 .npins = ARRAY_SIZE(imx25_pinctrl_pads),
318 static struct of_device_id imx25_pinctrl_of_match[] = {
319 { .compatible = "fsl,imx25-iomuxc", },
323 static int imx25_pinctrl_probe(struct platform_device *pdev)
325 return imx_pinctrl_probe(pdev, &imx25_pinctrl_info);
328 static struct platform_driver imx25_pinctrl_driver = {
330 .name = "imx25-pinctrl",
331 .owner = THIS_MODULE,
332 .of_match_table = of_match_ptr(imx25_pinctrl_of_match),
334 .probe = imx25_pinctrl_probe,
335 .remove = imx_pinctrl_remove,
338 static int __init imx25_pinctrl_init(void)
340 return platform_driver_register(&imx25_pinctrl_driver);
342 arch_initcall(imx25_pinctrl_init);
344 static void __exit imx25_pinctrl_exit(void)
346 platform_driver_unregister(&imx25_pinctrl_driver);
348 module_exit(imx25_pinctrl_exit);
349 MODULE_AUTHOR("Denis Carikli <denis@eukrea.com>");
350 MODULE_DESCRIPTION("Freescale IMX25 pinctrl driver");
351 MODULE_LICENSE("GPL v2");