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,
98 MX25_PAD_CONTRAST
= 70,
100 MX25_PAD_CSI_D2
= 72,
101 MX25_PAD_CSI_D3
= 73,
102 MX25_PAD_CSI_D4
= 74,
103 MX25_PAD_CSI_D5
= 75,
104 MX25_PAD_CSI_D6
= 76,
105 MX25_PAD_CSI_D7
= 77,
106 MX25_PAD_CSI_D8
= 78,
107 MX25_PAD_CSI_D9
= 79,
108 MX25_PAD_CSI_MCLK
= 80,
109 MX25_PAD_CSI_VSYNC
= 81,
110 MX25_PAD_CSI_HSYNC
= 82,
111 MX25_PAD_CSI_PIXCLK
= 83,
112 MX25_PAD_I2C1_CLK
= 84,
113 MX25_PAD_I2C1_DAT
= 85,
114 MX25_PAD_CSPI1_MOSI
= 86,
115 MX25_PAD_CSPI1_MISO
= 87,
116 MX25_PAD_CSPI1_SS0
= 88,
117 MX25_PAD_CSPI1_SS1
= 89,
118 MX25_PAD_CSPI1_SCLK
= 90,
119 MX25_PAD_CSPI1_RDY
= 91,
120 MX25_PAD_UART1_RXD
= 92,
121 MX25_PAD_UART1_TXD
= 93,
122 MX25_PAD_UART1_RTS
= 94,
123 MX25_PAD_UART1_CTS
= 95,
124 MX25_PAD_UART2_RXD
= 96,
125 MX25_PAD_UART2_TXD
= 97,
126 MX25_PAD_UART2_RTS
= 98,
127 MX25_PAD_UART2_CTS
= 99,
128 MX25_PAD_SD1_CMD
= 100,
129 MX25_PAD_SD1_CLK
= 101,
130 MX25_PAD_SD1_DATA0
= 102,
131 MX25_PAD_SD1_DATA1
= 103,
132 MX25_PAD_SD1_DATA2
= 104,
133 MX25_PAD_SD1_DATA3
= 105,
134 MX25_PAD_KPP_ROW0
= 106,
135 MX25_PAD_KPP_ROW1
= 107,
136 MX25_PAD_KPP_ROW2
= 108,
137 MX25_PAD_KPP_ROW3
= 109,
138 MX25_PAD_KPP_COL0
= 110,
139 MX25_PAD_KPP_COL1
= 111,
140 MX25_PAD_KPP_COL2
= 112,
141 MX25_PAD_KPP_COL3
= 113,
142 MX25_PAD_FEC_MDC
= 114,
143 MX25_PAD_FEC_MDIO
= 115,
144 MX25_PAD_FEC_TDATA0
= 116,
145 MX25_PAD_FEC_TDATA1
= 117,
146 MX25_PAD_FEC_TX_EN
= 118,
147 MX25_PAD_FEC_RDATA0
= 119,
148 MX25_PAD_FEC_RDATA1
= 120,
149 MX25_PAD_FEC_RX_DV
= 121,
150 MX25_PAD_FEC_TX_CLK
= 122,
153 MX25_PAD_GPIO_A
= 125,
154 MX25_PAD_GPIO_B
= 126,
155 MX25_PAD_GPIO_C
= 127,
156 MX25_PAD_GPIO_D
= 128,
157 MX25_PAD_GPIO_E
= 129,
158 MX25_PAD_GPIO_F
= 130,
159 MX25_PAD_EXT_ARMCLK
= 131,
160 MX25_PAD_UPLL_BYPCLK
= 132,
161 MX25_PAD_VSTBY_REQ
= 133,
162 MX25_PAD_VSTBY_ACK
= 134,
163 MX25_PAD_POWER_FAIL
= 135,
165 MX25_PAD_BOOT_MODE0
= 137,
166 MX25_PAD_BOOT_MODE1
= 138,
169 /* Pad names for the pinmux subsystem */
170 static const struct pinctrl_pin_desc imx25_pinctrl_pads
[] = {
171 IMX_PINCTRL_PIN(MX25_PAD_RESERVE0
),
172 IMX_PINCTRL_PIN(MX25_PAD_A10
),
173 IMX_PINCTRL_PIN(MX25_PAD_A13
),
174 IMX_PINCTRL_PIN(MX25_PAD_A14
),
175 IMX_PINCTRL_PIN(MX25_PAD_A15
),
176 IMX_PINCTRL_PIN(MX25_PAD_A16
),
177 IMX_PINCTRL_PIN(MX25_PAD_A17
),
178 IMX_PINCTRL_PIN(MX25_PAD_A18
),
179 IMX_PINCTRL_PIN(MX25_PAD_A19
),
180 IMX_PINCTRL_PIN(MX25_PAD_A20
),
181 IMX_PINCTRL_PIN(MX25_PAD_A21
),
182 IMX_PINCTRL_PIN(MX25_PAD_A22
),
183 IMX_PINCTRL_PIN(MX25_PAD_A23
),
184 IMX_PINCTRL_PIN(MX25_PAD_A24
),
185 IMX_PINCTRL_PIN(MX25_PAD_A25
),
186 IMX_PINCTRL_PIN(MX25_PAD_EB0
),
187 IMX_PINCTRL_PIN(MX25_PAD_EB1
),
188 IMX_PINCTRL_PIN(MX25_PAD_OE
),
189 IMX_PINCTRL_PIN(MX25_PAD_CS0
),
190 IMX_PINCTRL_PIN(MX25_PAD_CS1
),
191 IMX_PINCTRL_PIN(MX25_PAD_CS4
),
192 IMX_PINCTRL_PIN(MX25_PAD_CS5
),
193 IMX_PINCTRL_PIN(MX25_PAD_NF_CE0
),
194 IMX_PINCTRL_PIN(MX25_PAD_ECB
),
195 IMX_PINCTRL_PIN(MX25_PAD_LBA
),
196 IMX_PINCTRL_PIN(MX25_PAD_BCLK
),
197 IMX_PINCTRL_PIN(MX25_PAD_RW
),
198 IMX_PINCTRL_PIN(MX25_PAD_NFWE_B
),
199 IMX_PINCTRL_PIN(MX25_PAD_NFRE_B
),
200 IMX_PINCTRL_PIN(MX25_PAD_NFALE
),
201 IMX_PINCTRL_PIN(MX25_PAD_NFCLE
),
202 IMX_PINCTRL_PIN(MX25_PAD_NFWP_B
),
203 IMX_PINCTRL_PIN(MX25_PAD_NFRB
),
204 IMX_PINCTRL_PIN(MX25_PAD_D15
),
205 IMX_PINCTRL_PIN(MX25_PAD_D14
),
206 IMX_PINCTRL_PIN(MX25_PAD_D13
),
207 IMX_PINCTRL_PIN(MX25_PAD_D12
),
208 IMX_PINCTRL_PIN(MX25_PAD_D11
),
209 IMX_PINCTRL_PIN(MX25_PAD_D10
),
210 IMX_PINCTRL_PIN(MX25_PAD_D9
),
211 IMX_PINCTRL_PIN(MX25_PAD_D8
),
212 IMX_PINCTRL_PIN(MX25_PAD_D7
),
213 IMX_PINCTRL_PIN(MX25_PAD_D6
),
214 IMX_PINCTRL_PIN(MX25_PAD_D5
),
215 IMX_PINCTRL_PIN(MX25_PAD_D4
),
216 IMX_PINCTRL_PIN(MX25_PAD_D3
),
217 IMX_PINCTRL_PIN(MX25_PAD_D2
),
218 IMX_PINCTRL_PIN(MX25_PAD_D1
),
219 IMX_PINCTRL_PIN(MX25_PAD_D0
),
220 IMX_PINCTRL_PIN(MX25_PAD_LD0
),
221 IMX_PINCTRL_PIN(MX25_PAD_LD1
),
222 IMX_PINCTRL_PIN(MX25_PAD_LD2
),
223 IMX_PINCTRL_PIN(MX25_PAD_LD3
),
224 IMX_PINCTRL_PIN(MX25_PAD_LD4
),
225 IMX_PINCTRL_PIN(MX25_PAD_LD5
),
226 IMX_PINCTRL_PIN(MX25_PAD_LD6
),
227 IMX_PINCTRL_PIN(MX25_PAD_LD7
),
228 IMX_PINCTRL_PIN(MX25_PAD_LD8
),
229 IMX_PINCTRL_PIN(MX25_PAD_LD9
),
230 IMX_PINCTRL_PIN(MX25_PAD_LD10
),
231 IMX_PINCTRL_PIN(MX25_PAD_LD11
),
232 IMX_PINCTRL_PIN(MX25_PAD_LD12
),
233 IMX_PINCTRL_PIN(MX25_PAD_LD13
),
234 IMX_PINCTRL_PIN(MX25_PAD_LD14
),
235 IMX_PINCTRL_PIN(MX25_PAD_LD15
),
236 IMX_PINCTRL_PIN(MX25_PAD_HSYNC
),
237 IMX_PINCTRL_PIN(MX25_PAD_VSYNC
),
238 IMX_PINCTRL_PIN(MX25_PAD_LSCLK
),
239 IMX_PINCTRL_PIN(MX25_PAD_OE_ACD
),
240 IMX_PINCTRL_PIN(MX25_PAD_CONTRAST
),
241 IMX_PINCTRL_PIN(MX25_PAD_PWM
),
242 IMX_PINCTRL_PIN(MX25_PAD_CSI_D2
),
243 IMX_PINCTRL_PIN(MX25_PAD_CSI_D3
),
244 IMX_PINCTRL_PIN(MX25_PAD_CSI_D4
),
245 IMX_PINCTRL_PIN(MX25_PAD_CSI_D5
),
246 IMX_PINCTRL_PIN(MX25_PAD_CSI_D6
),
247 IMX_PINCTRL_PIN(MX25_PAD_CSI_D7
),
248 IMX_PINCTRL_PIN(MX25_PAD_CSI_D8
),
249 IMX_PINCTRL_PIN(MX25_PAD_CSI_D9
),
250 IMX_PINCTRL_PIN(MX25_PAD_CSI_MCLK
),
251 IMX_PINCTRL_PIN(MX25_PAD_CSI_VSYNC
),
252 IMX_PINCTRL_PIN(MX25_PAD_CSI_HSYNC
),
253 IMX_PINCTRL_PIN(MX25_PAD_CSI_PIXCLK
),
254 IMX_PINCTRL_PIN(MX25_PAD_I2C1_CLK
),
255 IMX_PINCTRL_PIN(MX25_PAD_I2C1_DAT
),
256 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_MOSI
),
257 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_MISO
),
258 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_SS0
),
259 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_SS1
),
260 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_SCLK
),
261 IMX_PINCTRL_PIN(MX25_PAD_CSPI1_RDY
),
262 IMX_PINCTRL_PIN(MX25_PAD_UART1_RXD
),
263 IMX_PINCTRL_PIN(MX25_PAD_UART1_TXD
),
264 IMX_PINCTRL_PIN(MX25_PAD_UART1_RTS
),
265 IMX_PINCTRL_PIN(MX25_PAD_UART1_CTS
),
266 IMX_PINCTRL_PIN(MX25_PAD_UART2_RXD
),
267 IMX_PINCTRL_PIN(MX25_PAD_UART2_TXD
),
268 IMX_PINCTRL_PIN(MX25_PAD_UART2_RTS
),
269 IMX_PINCTRL_PIN(MX25_PAD_UART2_CTS
),
270 IMX_PINCTRL_PIN(MX25_PAD_SD1_CMD
),
271 IMX_PINCTRL_PIN(MX25_PAD_SD1_CLK
),
272 IMX_PINCTRL_PIN(MX25_PAD_SD1_DATA0
),
273 IMX_PINCTRL_PIN(MX25_PAD_SD1_DATA1
),
274 IMX_PINCTRL_PIN(MX25_PAD_SD1_DATA2
),
275 IMX_PINCTRL_PIN(MX25_PAD_SD1_DATA3
),
276 IMX_PINCTRL_PIN(MX25_PAD_KPP_ROW0
),
277 IMX_PINCTRL_PIN(MX25_PAD_KPP_ROW1
),
278 IMX_PINCTRL_PIN(MX25_PAD_KPP_ROW2
),
279 IMX_PINCTRL_PIN(MX25_PAD_KPP_ROW3
),
280 IMX_PINCTRL_PIN(MX25_PAD_KPP_COL0
),
281 IMX_PINCTRL_PIN(MX25_PAD_KPP_COL1
),
282 IMX_PINCTRL_PIN(MX25_PAD_KPP_COL2
),
283 IMX_PINCTRL_PIN(MX25_PAD_KPP_COL3
),
284 IMX_PINCTRL_PIN(MX25_PAD_FEC_MDC
),
285 IMX_PINCTRL_PIN(MX25_PAD_FEC_MDIO
),
286 IMX_PINCTRL_PIN(MX25_PAD_FEC_TDATA0
),
287 IMX_PINCTRL_PIN(MX25_PAD_FEC_TDATA1
),
288 IMX_PINCTRL_PIN(MX25_PAD_FEC_TX_EN
),
289 IMX_PINCTRL_PIN(MX25_PAD_FEC_RDATA0
),
290 IMX_PINCTRL_PIN(MX25_PAD_FEC_RDATA1
),
291 IMX_PINCTRL_PIN(MX25_PAD_FEC_RX_DV
),
292 IMX_PINCTRL_PIN(MX25_PAD_FEC_TX_CLK
),
293 IMX_PINCTRL_PIN(MX25_PAD_RTCK
),
294 IMX_PINCTRL_PIN(MX25_PAD_DE_B
),
295 IMX_PINCTRL_PIN(MX25_PAD_GPIO_A
),
296 IMX_PINCTRL_PIN(MX25_PAD_GPIO_B
),
297 IMX_PINCTRL_PIN(MX25_PAD_GPIO_C
),
298 IMX_PINCTRL_PIN(MX25_PAD_GPIO_D
),
299 IMX_PINCTRL_PIN(MX25_PAD_GPIO_E
),
300 IMX_PINCTRL_PIN(MX25_PAD_GPIO_F
),
301 IMX_PINCTRL_PIN(MX25_PAD_EXT_ARMCLK
),
302 IMX_PINCTRL_PIN(MX25_PAD_UPLL_BYPCLK
),
303 IMX_PINCTRL_PIN(MX25_PAD_VSTBY_REQ
),
304 IMX_PINCTRL_PIN(MX25_PAD_VSTBY_ACK
),
305 IMX_PINCTRL_PIN(MX25_PAD_POWER_FAIL
),
306 IMX_PINCTRL_PIN(MX25_PAD_CLKO
),
307 IMX_PINCTRL_PIN(MX25_PAD_BOOT_MODE0
),
308 IMX_PINCTRL_PIN(MX25_PAD_BOOT_MODE1
),
311 static struct imx_pinctrl_soc_info imx25_pinctrl_info
= {
312 .pins
= imx25_pinctrl_pads
,
313 .npins
= ARRAY_SIZE(imx25_pinctrl_pads
),
316 static const struct of_device_id imx25_pinctrl_of_match
[] = {
317 { .compatible
= "fsl,imx25-iomuxc", },
321 static int imx25_pinctrl_probe(struct platform_device
*pdev
)
323 return imx_pinctrl_probe(pdev
, &imx25_pinctrl_info
);
326 static struct platform_driver imx25_pinctrl_driver
= {
328 .name
= "imx25-pinctrl",
329 .of_match_table
= of_match_ptr(imx25_pinctrl_of_match
),
331 .probe
= imx25_pinctrl_probe
,
332 .remove
= imx_pinctrl_remove
,
335 static int __init
imx25_pinctrl_init(void)
337 return platform_driver_register(&imx25_pinctrl_driver
);
339 arch_initcall(imx25_pinctrl_init
);
341 static void __exit
imx25_pinctrl_exit(void)
343 platform_driver_unregister(&imx25_pinctrl_driver
);
345 module_exit(imx25_pinctrl_exit
);
346 MODULE_AUTHOR("Denis Carikli <denis@eukrea.com>");
347 MODULE_DESCRIPTION("Freescale IMX25 pinctrl driver");
348 MODULE_LICENSE("GPL v2");