2 * Copyright (C) 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
9 #include <linux/kernel.h>
10 #include <linux/platform_device.h>
11 #include <linux/init.h>
12 #include <linux/platform_data/dma-imx-sdma.h>
14 extern struct device mxc_aips_bus
;
15 extern struct device mxc_ahb_bus
;
17 static inline struct platform_device
*imx_add_platform_device_dmamask(
18 const char *name
, int id
,
19 const struct resource
*res
, unsigned int num_resources
,
20 const void *data
, size_t size_data
, u64 dmamask
)
22 struct platform_device_info pdevinfo
= {
26 .num_res
= num_resources
,
28 .size_data
= size_data
,
31 return platform_device_register_full(&pdevinfo
);
34 static inline struct platform_device
*imx_add_platform_device(
35 const char *name
, int id
,
36 const struct resource
*res
, unsigned int num_resources
,
37 const void *data
, size_t size_data
)
39 return imx_add_platform_device_dmamask(
40 name
, id
, res
, num_resources
, data
, size_data
, 0);
43 #include <linux/fec.h>
46 resource_size_t iobase
;
49 struct platform_device
*__init
imx_add_fec(
50 const struct imx_fec_data
*data
,
51 const struct fec_platform_data
*pdata
);
53 struct imx_flexcan_data
{
55 resource_size_t iobase
;
56 resource_size_t iosize
;
59 struct platform_device
*__init
imx_add_flexcan(
60 const struct imx_flexcan_data
*data
);
62 #include <linux/fsl_devices.h>
63 struct imx_fsl_usb2_udc_data
{
65 resource_size_t iobase
;
68 struct platform_device
*__init
imx_add_fsl_usb2_udc(
69 const struct imx_fsl_usb2_udc_data
*data
,
70 const struct fsl_usb2_platform_data
*pdata
);
72 #include <linux/gpio_keys.h>
73 struct platform_device
*__init
imx_add_gpio_keys(
74 const struct gpio_keys_platform_data
*pdata
);
76 #include <linux/platform_data/usb-mx2.h>
77 struct imx_imx21_hcd_data
{
78 resource_size_t iobase
;
81 struct platform_device
*__init
imx_add_imx21_hcd(
82 const struct imx_imx21_hcd_data
*data
,
83 const struct mx21_usbh_platform_data
*pdata
);
85 struct imx_imx27_coda_data
{
86 resource_size_t iobase
;
87 resource_size_t iosize
;
90 struct platform_device
*__init
imx_add_imx27_coda(
91 const struct imx_imx27_coda_data
*data
);
93 struct imx_imx2_wdt_data
{
95 resource_size_t iobase
;
96 resource_size_t iosize
;
98 struct platform_device
*__init
imx_add_imx2_wdt(
99 const struct imx_imx2_wdt_data
*data
);
101 struct imx_imxdi_rtc_data
{
102 resource_size_t iobase
;
105 struct platform_device
*__init
imx_add_imxdi_rtc(
106 const struct imx_imxdi_rtc_data
*data
);
108 #include <linux/platform_data/video-imxfb.h>
109 struct imx_imx_fb_data
{
111 resource_size_t iobase
;
112 resource_size_t iosize
;
115 struct platform_device
*__init
imx_add_imx_fb(
116 const struct imx_imx_fb_data
*data
,
117 const struct imx_fb_platform_data
*pdata
);
119 #include <linux/platform_data/i2c-imx.h>
120 struct imx_imx_i2c_data
{
123 resource_size_t iobase
;
124 resource_size_t iosize
;
127 struct platform_device
*__init
imx_add_imx_i2c(
128 const struct imx_imx_i2c_data
*data
,
129 const struct imxi2c_platform_data
*pdata
);
131 #include <linux/input/matrix_keypad.h>
132 struct imx_imx_keypad_data
{
133 resource_size_t iobase
;
134 resource_size_t iosize
;
137 struct platform_device
*__init
imx_add_imx_keypad(
138 const struct imx_imx_keypad_data
*data
,
139 const struct matrix_keymap_data
*pdata
);
141 #include <linux/platform_data/asoc-imx-ssi.h>
142 struct imx_imx_ssi_data
{
144 resource_size_t iobase
;
145 resource_size_t iosize
;
147 resource_size_t dmatx0
;
148 resource_size_t dmarx0
;
149 resource_size_t dmatx1
;
150 resource_size_t dmarx1
;
152 struct platform_device
*__init
imx_add_imx_ssi(
153 const struct imx_imx_ssi_data
*data
,
154 const struct imx_ssi_platform_data
*pdata
);
156 #include <linux/platform_data/serial-imx.h>
157 struct imx_imx_uart_3irq_data
{
159 resource_size_t iobase
;
160 resource_size_t iosize
;
161 resource_size_t irqrx
;
162 resource_size_t irqtx
;
163 resource_size_t irqrts
;
165 struct platform_device
*__init
imx_add_imx_uart_3irq(
166 const struct imx_imx_uart_3irq_data
*data
,
167 const struct imxuart_platform_data
*pdata
);
169 struct imx_imx_uart_1irq_data
{
171 resource_size_t iobase
;
172 resource_size_t iosize
;
175 struct platform_device
*__init
imx_add_imx_uart_1irq(
176 const struct imx_imx_uart_1irq_data
*data
,
177 const struct imxuart_platform_data
*pdata
);
179 #include <linux/platform_data/usb-imx_udc.h>
180 struct imx_imx_udc_data
{
181 resource_size_t iobase
;
182 resource_size_t iosize
;
183 resource_size_t irq0
;
184 resource_size_t irq1
;
185 resource_size_t irq2
;
186 resource_size_t irq3
;
187 resource_size_t irq4
;
188 resource_size_t irq5
;
189 resource_size_t irq6
;
191 struct platform_device
*__init
imx_add_imx_udc(
192 const struct imx_imx_udc_data
*data
,
193 const struct imxusb_platform_data
*pdata
);
195 #include <linux/platform_data/video-mx3fb.h>
196 #include <linux/platform_data/camera-mx3.h>
197 struct imx_ipu_core_data
{
198 resource_size_t iobase
;
199 resource_size_t synirq
;
200 resource_size_t errirq
;
202 struct platform_device
*__init
imx_add_ipu_core(
203 const struct imx_ipu_core_data
*data
);
204 struct platform_device
*__init
imx_alloc_mx3_camera(
205 const struct imx_ipu_core_data
*data
,
206 const struct mx3_camera_pdata
*pdata
);
207 struct platform_device
*__init
imx_add_mx3_sdc_fb(
208 const struct imx_ipu_core_data
*data
,
209 struct mx3fb_platform_data
*pdata
);
211 #include <linux/platform_data/camera-mx1.h>
212 struct imx_mx1_camera_data
{
213 resource_size_t iobase
;
214 resource_size_t iosize
;
217 struct platform_device
*__init
imx_add_mx1_camera(
218 const struct imx_mx1_camera_data
*data
,
219 const struct mx1_camera_pdata
*pdata
);
221 #include <linux/platform_data/camera-mx2.h>
222 struct imx_mx2_camera_data
{
224 resource_size_t iobasecsi
;
225 resource_size_t iosizecsi
;
226 resource_size_t irqcsi
;
227 resource_size_t iobaseemmaprp
;
228 resource_size_t iosizeemmaprp
;
229 resource_size_t irqemmaprp
;
231 struct platform_device
*__init
imx_add_mx2_camera(
232 const struct imx_mx2_camera_data
*data
,
233 const struct mx2_camera_platform_data
*pdata
);
236 struct imx_mx2_emma_data
{
237 resource_size_t iobase
;
238 resource_size_t iosize
;
241 struct platform_device
*__init
imx_add_mx2_emmaprp(
242 const struct imx_mx2_emma_data
*data
);
244 #include <linux/platform_data/usb-ehci-mxc.h>
245 struct imx_mxc_ehci_data
{
247 resource_size_t iobase
;
250 struct platform_device
*__init
imx_add_mxc_ehci(
251 const struct imx_mxc_ehci_data
*data
,
252 const struct mxc_usbh_platform_data
*pdata
);
254 #include <linux/platform_data/mmc-mxcmmc.h>
255 struct imx_mxc_mmc_data
{
258 resource_size_t iobase
;
259 resource_size_t iosize
;
261 resource_size_t dmareq
;
263 struct platform_device
*__init
imx_add_mxc_mmc(
264 const struct imx_mxc_mmc_data
*data
,
265 const struct imxmmc_platform_data
*pdata
);
267 #include <linux/platform_data/mtd-mxc_nand.h>
268 struct imx_mxc_nand_data
{
271 * id is traditionally 0, but -1 is more appropriate. We use -1 for new
272 * machines but don't change existing devices as the nand device usually
273 * appears in the kernel command line to pass its partitioning.
276 resource_size_t iobase
;
277 resource_size_t iosize
;
278 resource_size_t axibase
;
281 struct platform_device
*__init
imx_add_mxc_nand(
282 const struct imx_mxc_nand_data
*data
,
283 const struct mxc_nand_platform_data
*pdata
);
285 struct imx_pata_imx_data
{
286 resource_size_t iobase
;
287 resource_size_t iosize
;
290 struct platform_device
*__init
imx_add_pata_imx(
291 const struct imx_pata_imx_data
*data
);
294 struct imx_mxc_rtc_data
{
296 resource_size_t iobase
;
299 struct platform_device
*__init
imx_add_mxc_rtc(
300 const struct imx_mxc_rtc_data
*data
);
303 struct imx_mxc_w1_data
{
304 resource_size_t iobase
;
306 struct platform_device
*__init
imx_add_mxc_w1(
307 const struct imx_mxc_w1_data
*data
);
309 #include <linux/platform_data/mmc-esdhc-imx.h>
310 struct imx_sdhci_esdhc_imx_data
{
313 resource_size_t iobase
;
316 struct platform_device
*__init
imx_add_sdhci_esdhc_imx(
317 const struct imx_sdhci_esdhc_imx_data
*data
,
318 const struct esdhc_platform_data
*pdata
);
320 #include <linux/platform_data/spi-imx.h>
321 struct imx_spi_imx_data
{
324 resource_size_t iobase
;
325 resource_size_t iosize
;
328 struct platform_device
*__init
imx_add_spi_imx(
329 const struct imx_spi_imx_data
*data
,
330 const struct spi_imx_master
*pdata
);
332 struct platform_device
*imx_add_imx_dma(char *name
, resource_size_t iobase
,
333 int irq
, int irq_err
);
334 struct platform_device
*imx_add_imx_sdma(char *name
,
335 resource_size_t iobase
, int irq
, struct sdma_platform_data
*pdata
);