1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2009-2010 Pengutronix
4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
6 #include <linux/kernel.h>
7 #include <linux/platform_device.h>
8 #include <linux/init.h>
9 #include <linux/platform_data/dma-imx-sdma.h>
11 extern struct device mxc_aips_bus
;
12 extern struct device mxc_ahb_bus
;
14 static inline struct platform_device
*imx_add_platform_device_dmamask(
15 const char *name
, int id
,
16 const struct resource
*res
, unsigned int num_resources
,
17 const void *data
, size_t size_data
, u64 dmamask
)
19 struct platform_device_info pdevinfo
= {
23 .num_res
= num_resources
,
25 .size_data
= size_data
,
28 return platform_device_register_full(&pdevinfo
);
31 static inline struct platform_device
*imx_add_platform_device(
32 const char *name
, int id
,
33 const struct resource
*res
, unsigned int num_resources
,
34 const void *data
, size_t size_data
)
36 return imx_add_platform_device_dmamask(
37 name
, id
, res
, num_resources
, data
, size_data
, 0);
40 #include <linux/fec.h>
43 resource_size_t iobase
;
46 struct platform_device
*__init
imx_add_fec(
47 const struct imx_fec_data
*data
,
48 const struct fec_platform_data
*pdata
);
50 struct imx_flexcan_data
{
52 resource_size_t iobase
;
53 resource_size_t iosize
;
56 struct platform_device
*__init
imx_add_flexcan(
57 const struct imx_flexcan_data
*data
);
59 #include <linux/fsl_devices.h>
60 struct imx_fsl_usb2_udc_data
{
62 resource_size_t iobase
;
65 struct platform_device
*__init
imx_add_fsl_usb2_udc(
66 const struct imx_fsl_usb2_udc_data
*data
,
67 const struct fsl_usb2_platform_data
*pdata
);
69 #include <linux/gpio_keys.h>
70 struct platform_device
*__init
imx_add_gpio_keys(
71 const struct gpio_keys_platform_data
*pdata
);
73 #include <linux/platform_data/usb-mx2.h>
74 struct imx_imx21_hcd_data
{
75 resource_size_t iobase
;
78 struct platform_device
*__init
imx_add_imx21_hcd(
79 const struct imx_imx21_hcd_data
*data
,
80 const struct mx21_usbh_platform_data
*pdata
);
82 struct imx_imx27_coda_data
{
83 resource_size_t iobase
;
84 resource_size_t iosize
;
87 struct platform_device
*__init
imx_add_imx27_coda(
88 const struct imx_imx27_coda_data
*data
);
90 struct imx_imx2_wdt_data
{
92 resource_size_t iobase
;
93 resource_size_t iosize
;
95 struct platform_device
*__init
imx_add_imx2_wdt(
96 const struct imx_imx2_wdt_data
*data
);
98 struct imx_imxdi_rtc_data
{
99 resource_size_t iobase
;
102 struct platform_device
*__init
imx_add_imxdi_rtc(
103 const struct imx_imxdi_rtc_data
*data
);
105 #include <linux/platform_data/video-imxfb.h>
106 struct imx_imx_fb_data
{
108 resource_size_t iobase
;
109 resource_size_t iosize
;
112 struct platform_device
*__init
imx_add_imx_fb(
113 const struct imx_imx_fb_data
*data
,
114 const struct imx_fb_platform_data
*pdata
);
116 #include <linux/platform_data/i2c-imx.h>
117 struct imx_imx_i2c_data
{
120 resource_size_t iobase
;
121 resource_size_t iosize
;
124 struct platform_device
*__init
imx_add_imx_i2c(
125 const struct imx_imx_i2c_data
*data
,
126 const struct imxi2c_platform_data
*pdata
);
128 #include <linux/input/matrix_keypad.h>
129 struct imx_imx_keypad_data
{
130 resource_size_t iobase
;
131 resource_size_t iosize
;
134 struct platform_device
*__init
imx_add_imx_keypad(
135 const struct imx_imx_keypad_data
*data
,
136 const struct matrix_keymap_data
*pdata
);
138 #include <linux/platform_data/asoc-imx-ssi.h>
139 struct imx_imx_ssi_data
{
141 resource_size_t iobase
;
142 resource_size_t iosize
;
144 resource_size_t dmatx0
;
145 resource_size_t dmarx0
;
146 resource_size_t dmatx1
;
147 resource_size_t dmarx1
;
149 struct platform_device
*__init
imx_add_imx_ssi(
150 const struct imx_imx_ssi_data
*data
,
151 const struct imx_ssi_platform_data
*pdata
);
153 #include <linux/platform_data/serial-imx.h>
154 struct imx_imx_uart_1irq_data
{
156 resource_size_t iobase
;
157 resource_size_t iosize
;
160 struct platform_device
*__init
imx_add_imx_uart_1irq(
161 const struct imx_imx_uart_1irq_data
*data
,
162 const struct imxuart_platform_data
*pdata
);
164 #include <linux/platform_data/video-mx3fb.h>
165 #include <linux/platform_data/media/camera-mx3.h>
166 struct imx_ipu_core_data
{
167 resource_size_t iobase
;
168 resource_size_t synirq
;
169 resource_size_t errirq
;
171 struct platform_device
*__init
imx_add_ipu_core(
172 const struct imx_ipu_core_data
*data
);
173 struct platform_device
*__init
imx_alloc_mx3_camera(
174 const struct imx_ipu_core_data
*data
,
175 const struct mx3_camera_pdata
*pdata
);
176 struct platform_device
*__init
imx_add_mx3_sdc_fb(
177 const struct imx_ipu_core_data
*data
,
178 struct mx3fb_platform_data
*pdata
);
180 #include <linux/platform_data/media/camera-mx2.h>
181 struct imx_mx2_camera_data
{
183 resource_size_t iobasecsi
;
184 resource_size_t iosizecsi
;
185 resource_size_t irqcsi
;
186 resource_size_t iobaseemmaprp
;
187 resource_size_t iosizeemmaprp
;
188 resource_size_t irqemmaprp
;
190 struct platform_device
*__init
imx_add_mx2_camera(
191 const struct imx_mx2_camera_data
*data
,
192 const struct mx2_camera_platform_data
*pdata
);
195 struct imx_mx2_emma_data
{
196 resource_size_t iobase
;
197 resource_size_t iosize
;
200 struct platform_device
*__init
imx_add_mx2_emmaprp(
201 const struct imx_mx2_emma_data
*data
);
203 #include <linux/platform_data/usb-ehci-mxc.h>
204 struct imx_mxc_ehci_data
{
206 resource_size_t iobase
;
209 struct platform_device
*__init
imx_add_mxc_ehci(
210 const struct imx_mxc_ehci_data
*data
,
211 const struct mxc_usbh_platform_data
*pdata
);
213 #include <linux/platform_data/mmc-mxcmmc.h>
214 struct imx_mxc_mmc_data
{
217 resource_size_t iobase
;
218 resource_size_t iosize
;
220 resource_size_t dmareq
;
222 struct platform_device
*__init
imx_add_mxc_mmc(
223 const struct imx_mxc_mmc_data
*data
,
224 const struct imxmmc_platform_data
*pdata
);
226 #include <linux/platform_data/mtd-mxc_nand.h>
227 struct imx_mxc_nand_data
{
230 * id is traditionally 0, but -1 is more appropriate. We use -1 for new
231 * machines but don't change existing devices as the nand device usually
232 * appears in the kernel command line to pass its partitioning.
235 resource_size_t iobase
;
236 resource_size_t iosize
;
237 resource_size_t axibase
;
240 struct platform_device
*__init
imx_add_mxc_nand(
241 const struct imx_mxc_nand_data
*data
,
242 const struct mxc_nand_platform_data
*pdata
);
244 struct imx_pata_imx_data
{
245 resource_size_t iobase
;
246 resource_size_t iosize
;
249 struct platform_device
*__init
imx_add_pata_imx(
250 const struct imx_pata_imx_data
*data
);
253 struct imx_mxc_rtc_data
{
255 resource_size_t iobase
;
258 struct platform_device
*__init
imx_add_mxc_rtc(
259 const struct imx_mxc_rtc_data
*data
);
262 struct imx_mxc_w1_data
{
263 resource_size_t iobase
;
265 struct platform_device
*__init
imx_add_mxc_w1(
266 const struct imx_mxc_w1_data
*data
);
268 #include <linux/platform_data/mmc-esdhc-imx.h>
269 struct imx_sdhci_esdhc_imx_data
{
272 resource_size_t iobase
;
275 struct platform_device
*__init
imx_add_sdhci_esdhc_imx(
276 const struct imx_sdhci_esdhc_imx_data
*data
,
277 const struct esdhc_platform_data
*pdata
);
279 #include <linux/platform_data/spi-imx.h>
280 struct imx_spi_imx_data
{
283 resource_size_t iobase
;
284 resource_size_t iosize
;
287 struct platform_device
*__init
imx_add_spi_imx(
288 const struct imx_spi_imx_data
*data
,
289 const struct spi_imx_master
*pdata
);
291 struct platform_device
*imx_add_imx_dma(char *name
, resource_size_t iobase
,
292 int irq
, int irq_err
);
293 struct platform_device
*imx_add_imx_sdma(char *name
,
294 resource_size_t iobase
, int irq
, struct sdma_platform_data
*pdata
);