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 <mach/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 #include <linux/can/platform/flexcan.h>
54 struct imx_flexcan_data
{
56 resource_size_t iobase
;
57 resource_size_t iosize
;
60 struct platform_device
*__init
imx_add_flexcan(
61 const struct imx_flexcan_data
*data
,
62 const struct flexcan_platform_data
*pdata
);
64 #include <linux/fsl_devices.h>
65 struct imx_fsl_usb2_udc_data
{
66 resource_size_t iobase
;
69 struct platform_device
*__init
imx_add_fsl_usb2_udc(
70 const struct imx_fsl_usb2_udc_data
*data
,
71 const struct fsl_usb2_platform_data
*pdata
);
73 #include <linux/gpio_keys.h>
74 struct platform_device
*__init
imx_add_gpio_keys(
75 const struct gpio_keys_platform_data
*pdata
);
77 #include <mach/mx21-usbhost.h>
78 struct imx_imx21_hcd_data
{
79 resource_size_t iobase
;
82 struct platform_device
*__init
imx_add_imx21_hcd(
83 const struct imx_imx21_hcd_data
*data
,
84 const struct mx21_usbh_platform_data
*pdata
);
86 struct imx_imx2_wdt_data
{
88 resource_size_t iobase
;
89 resource_size_t iosize
;
91 struct platform_device
*__init
imx_add_imx2_wdt(
92 const struct imx_imx2_wdt_data
*data
);
94 struct imx_imxdi_rtc_data
{
95 resource_size_t iobase
;
98 struct platform_device
*__init
imx_add_imxdi_rtc(
99 const struct imx_imxdi_rtc_data
*data
);
101 #include <mach/imxfb.h>
102 struct imx_imx_fb_data
{
103 resource_size_t iobase
;
104 resource_size_t iosize
;
107 struct platform_device
*__init
imx_add_imx_fb(
108 const struct imx_imx_fb_data
*data
,
109 const struct imx_fb_platform_data
*pdata
);
111 #include <mach/i2c.h>
112 struct imx_imx_i2c_data
{
114 resource_size_t iobase
;
115 resource_size_t iosize
;
118 struct platform_device
*__init
imx_add_imx_i2c(
119 const struct imx_imx_i2c_data
*data
,
120 const struct imxi2c_platform_data
*pdata
);
122 #include <linux/input/matrix_keypad.h>
123 struct imx_imx_keypad_data
{
124 resource_size_t iobase
;
125 resource_size_t iosize
;
128 struct platform_device
*__init
imx_add_imx_keypad(
129 const struct imx_imx_keypad_data
*data
,
130 const struct matrix_keymap_data
*pdata
);
132 #include <mach/ssi.h>
133 struct imx_imx_ssi_data
{
135 resource_size_t iobase
;
136 resource_size_t iosize
;
138 resource_size_t dmatx0
;
139 resource_size_t dmarx0
;
140 resource_size_t dmatx1
;
141 resource_size_t dmarx1
;
143 struct platform_device
*__init
imx_add_imx_ssi(
144 const struct imx_imx_ssi_data
*data
,
145 const struct imx_ssi_platform_data
*pdata
);
147 #include <mach/imx-uart.h>
148 struct imx_imx_uart_3irq_data
{
150 resource_size_t iobase
;
151 resource_size_t iosize
;
152 resource_size_t irqrx
;
153 resource_size_t irqtx
;
154 resource_size_t irqrts
;
156 struct platform_device
*__init
imx_add_imx_uart_3irq(
157 const struct imx_imx_uart_3irq_data
*data
,
158 const struct imxuart_platform_data
*pdata
);
160 struct imx_imx_uart_1irq_data
{
162 resource_size_t iobase
;
163 resource_size_t iosize
;
166 struct platform_device
*__init
imx_add_imx_uart_1irq(
167 const struct imx_imx_uart_1irq_data
*data
,
168 const struct imxuart_platform_data
*pdata
);
170 #include <mach/usb.h>
171 struct imx_imx_udc_data
{
172 resource_size_t iobase
;
173 resource_size_t iosize
;
174 resource_size_t irq0
;
175 resource_size_t irq1
;
176 resource_size_t irq2
;
177 resource_size_t irq3
;
178 resource_size_t irq4
;
179 resource_size_t irq5
;
180 resource_size_t irq6
;
182 struct platform_device
*__init
imx_add_imx_udc(
183 const struct imx_imx_udc_data
*data
,
184 const struct imxusb_platform_data
*pdata
);
186 #include <mach/ipu.h>
187 #include <mach/mx3fb.h>
188 #include <mach/mx3_camera.h>
189 struct imx_ipu_core_data
{
190 resource_size_t iobase
;
191 resource_size_t synirq
;
192 resource_size_t errirq
;
194 struct platform_device
*__init
imx_add_ipu_core(
195 const struct imx_ipu_core_data
*data
,
196 const struct ipu_platform_data
*pdata
);
197 struct platform_device
*__init
imx_alloc_mx3_camera(
198 const struct imx_ipu_core_data
*data
,
199 const struct mx3_camera_pdata
*pdata
);
200 struct platform_device
*__init
imx_add_mx3_sdc_fb(
201 const struct imx_ipu_core_data
*data
,
202 struct mx3fb_platform_data
*pdata
);
204 #include <mach/mx1_camera.h>
205 struct imx_mx1_camera_data
{
206 resource_size_t iobase
;
207 resource_size_t iosize
;
210 struct platform_device
*__init
imx_add_mx1_camera(
211 const struct imx_mx1_camera_data
*data
,
212 const struct mx1_camera_pdata
*pdata
);
214 #include <mach/mx2_cam.h>
215 struct imx_mx2_camera_data
{
216 resource_size_t iobasecsi
;
217 resource_size_t iosizecsi
;
218 resource_size_t irqcsi
;
219 resource_size_t iobaseemmaprp
;
220 resource_size_t iosizeemmaprp
;
221 resource_size_t irqemmaprp
;
223 struct platform_device
*__init
imx_add_mx2_camera(
224 const struct imx_mx2_camera_data
*data
,
225 const struct mx2_camera_platform_data
*pdata
);
227 #include <mach/mxc_ehci.h>
228 struct imx_mxc_ehci_data
{
230 resource_size_t iobase
;
233 struct platform_device
*__init
imx_add_mxc_ehci(
234 const struct imx_mxc_ehci_data
*data
,
235 const struct mxc_usbh_platform_data
*pdata
);
237 #include <mach/mmc.h>
238 struct imx_mxc_mmc_data
{
240 resource_size_t iobase
;
241 resource_size_t iosize
;
243 resource_size_t dmareq
;
245 struct platform_device
*__init
imx_add_mxc_mmc(
246 const struct imx_mxc_mmc_data
*data
,
247 const struct imxmmc_platform_data
*pdata
);
249 #include <mach/mxc_nand.h>
250 struct imx_mxc_nand_data
{
252 * id is traditionally 0, but -1 is more appropriate. We use -1 for new
253 * machines but don't change existing devices as the nand device usually
254 * appears in the kernel command line to pass its partitioning.
257 resource_size_t iobase
;
258 resource_size_t iosize
;
259 resource_size_t axibase
;
262 struct platform_device
*__init
imx_add_mxc_nand(
263 const struct imx_mxc_nand_data
*data
,
264 const struct mxc_nand_platform_data
*pdata
);
266 struct imx_pata_imx_data
{
267 resource_size_t iobase
;
268 resource_size_t iosize
;
271 struct platform_device
*__init
imx_add_pata_imx(
272 const struct imx_pata_imx_data
*data
);
274 struct imx_mxc_pwm_data
{
276 resource_size_t iobase
;
277 resource_size_t iosize
;
280 struct platform_device
*__init
imx_add_mxc_pwm(
281 const struct imx_mxc_pwm_data
*data
);
284 struct imx_mxc_rtc_data
{
285 resource_size_t iobase
;
288 struct platform_device
*__init
imx_add_mxc_rtc(
289 const struct imx_mxc_rtc_data
*data
);
292 struct imx_mxc_w1_data
{
293 resource_size_t iobase
;
295 struct platform_device
*__init
imx_add_mxc_w1(
296 const struct imx_mxc_w1_data
*data
);
298 #include <mach/esdhc.h>
299 struct imx_sdhci_esdhc_imx_data
{
302 resource_size_t iobase
;
305 struct platform_device
*__init
imx_add_sdhci_esdhc_imx(
306 const struct imx_sdhci_esdhc_imx_data
*data
,
307 const struct esdhc_platform_data
*pdata
);
309 #include <mach/spi.h>
310 struct imx_spi_imx_data
{
313 resource_size_t iobase
;
314 resource_size_t iosize
;
317 struct platform_device
*__init
imx_add_spi_imx(
318 const struct imx_spi_imx_data
*data
,
319 const struct spi_imx_master
*pdata
);
321 struct platform_device
*imx_add_imx_dma(void);
322 struct platform_device
*imx_add_imx_sdma(char *name
,
323 resource_size_t iobase
, int irq
, struct sdma_platform_data
*pdata
);
325 #include <linux/ahci_platform.h>
326 struct imx_ahci_imx_data
{
328 resource_size_t iobase
;
331 struct platform_device
*__init
imx_add_ahci_imx(
332 const struct imx_ahci_imx_data
*data
,
333 const struct ahci_platform_data
*pdata
);