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/video-mx3fb.h>
180 #include <linux/platform_data/camera-mx3.h>
181 struct imx_ipu_core_data
{
182 resource_size_t iobase
;
183 resource_size_t synirq
;
184 resource_size_t errirq
;
186 struct platform_device
*__init
imx_add_ipu_core(
187 const struct imx_ipu_core_data
*data
);
188 struct platform_device
*__init
imx_alloc_mx3_camera(
189 const struct imx_ipu_core_data
*data
,
190 const struct mx3_camera_pdata
*pdata
);
191 struct platform_device
*__init
imx_add_mx3_sdc_fb(
192 const struct imx_ipu_core_data
*data
,
193 struct mx3fb_platform_data
*pdata
);
195 #include <linux/platform_data/camera-mx2.h>
196 struct imx_mx2_camera_data
{
198 resource_size_t iobasecsi
;
199 resource_size_t iosizecsi
;
200 resource_size_t irqcsi
;
201 resource_size_t iobaseemmaprp
;
202 resource_size_t iosizeemmaprp
;
203 resource_size_t irqemmaprp
;
205 struct platform_device
*__init
imx_add_mx2_camera(
206 const struct imx_mx2_camera_data
*data
,
207 const struct mx2_camera_platform_data
*pdata
);
210 struct imx_mx2_emma_data
{
211 resource_size_t iobase
;
212 resource_size_t iosize
;
215 struct platform_device
*__init
imx_add_mx2_emmaprp(
216 const struct imx_mx2_emma_data
*data
);
218 #include <linux/platform_data/usb-ehci-mxc.h>
219 struct imx_mxc_ehci_data
{
221 resource_size_t iobase
;
224 struct platform_device
*__init
imx_add_mxc_ehci(
225 const struct imx_mxc_ehci_data
*data
,
226 const struct mxc_usbh_platform_data
*pdata
);
228 #include <linux/platform_data/mmc-mxcmmc.h>
229 struct imx_mxc_mmc_data
{
232 resource_size_t iobase
;
233 resource_size_t iosize
;
235 resource_size_t dmareq
;
237 struct platform_device
*__init
imx_add_mxc_mmc(
238 const struct imx_mxc_mmc_data
*data
,
239 const struct imxmmc_platform_data
*pdata
);
241 #include <linux/platform_data/mtd-mxc_nand.h>
242 struct imx_mxc_nand_data
{
245 * id is traditionally 0, but -1 is more appropriate. We use -1 for new
246 * machines but don't change existing devices as the nand device usually
247 * appears in the kernel command line to pass its partitioning.
250 resource_size_t iobase
;
251 resource_size_t iosize
;
252 resource_size_t axibase
;
255 struct platform_device
*__init
imx_add_mxc_nand(
256 const struct imx_mxc_nand_data
*data
,
257 const struct mxc_nand_platform_data
*pdata
);
259 struct imx_pata_imx_data
{
260 resource_size_t iobase
;
261 resource_size_t iosize
;
264 struct platform_device
*__init
imx_add_pata_imx(
265 const struct imx_pata_imx_data
*data
);
268 struct imx_mxc_rtc_data
{
270 resource_size_t iobase
;
273 struct platform_device
*__init
imx_add_mxc_rtc(
274 const struct imx_mxc_rtc_data
*data
);
277 struct imx_mxc_w1_data
{
278 resource_size_t iobase
;
280 struct platform_device
*__init
imx_add_mxc_w1(
281 const struct imx_mxc_w1_data
*data
);
283 #include <linux/platform_data/mmc-esdhc-imx.h>
284 struct imx_sdhci_esdhc_imx_data
{
287 resource_size_t iobase
;
290 struct platform_device
*__init
imx_add_sdhci_esdhc_imx(
291 const struct imx_sdhci_esdhc_imx_data
*data
,
292 const struct esdhc_platform_data
*pdata
);
294 #include <linux/platform_data/spi-imx.h>
295 struct imx_spi_imx_data
{
298 resource_size_t iobase
;
299 resource_size_t iosize
;
302 struct platform_device
*__init
imx_add_spi_imx(
303 const struct imx_spi_imx_data
*data
,
304 const struct spi_imx_master
*pdata
);
306 struct platform_device
*imx_add_imx_dma(char *name
, resource_size_t iobase
,
307 int irq
, int irq_err
);
308 struct platform_device
*imx_add_imx_sdma(char *name
,
309 resource_size_t iobase
, int irq
, struct sdma_platform_data
*pdata
);