blob: 8482613e97278c992fa08ce2c659ea8a670175e9 [file] [log] [blame]
Uwe Kleine-König253ff1f2010-06-15 11:31:02 +02001/*
2 * Copyright (C) 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
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.
8 */
9#include <linux/kernel.h>
10#include <linux/platform_device.h>
11#include <linux/init.h>
12
Uwe Kleine-König6332c102010-11-02 11:56:54 +010013struct platform_device *imx_add_platform_device_dmamask(
14 const char *name, int id,
Uwe Kleine-König253ff1f2010-06-15 11:31:02 +020015 const struct resource *res, unsigned int num_resources,
Uwe Kleine-König6332c102010-11-02 11:56:54 +010016 const void *data, size_t size_data, u64 dmamask);
17
18static inline struct platform_device *imx_add_platform_device(
19 const char *name, int id,
20 const struct resource *res, unsigned int num_resources,
21 const void *data, size_t size_data)
22{
23 return imx_add_platform_device_dmamask(
24 name, id, res, num_resources, data, size_data, 0);
25}
Uwe Kleine-König66384ee2010-06-15 18:14:19 +020026
Uwe Kleine-König6bd96f32010-10-06 12:00:18 +020027#include <linux/fec.h>
28struct imx_fec_data {
29 resource_size_t iobase;
30 resource_size_t irq;
31};
32struct platform_device *__init imx_add_fec(
33 const struct imx_fec_data *data,
34 const struct fec_platform_data *pdata);
35
Marc Kleine-Budde61c68502010-07-22 11:45:34 +020036#include <linux/can/platform/flexcan.h>
Uwe Kleine-Königfc40d012010-11-04 12:02:35 +010037struct imx_flexcan_data {
38 int id;
39 resource_size_t iobase;
40 resource_size_t iosize;
41 resource_size_t irq;
42};
43struct platform_device *__init imx_add_flexcan(
44 const struct imx_flexcan_data *data,
Marc Kleine-Budde61c68502010-07-22 11:45:34 +020045 const struct flexcan_platform_data *pdata);
Marc Kleine-Budde61c68502010-07-22 11:45:34 +020046
Uwe Kleine-Königbd455ed2010-11-09 17:52:14 +010047#include <linux/fsl_devices.h>
48struct imx_fsl_usb2_udc_data {
49 resource_size_t iobase;
50 resource_size_t irq;
51};
52struct platform_device *__init imx_add_fsl_usb2_udc(
53 const struct imx_fsl_usb2_udc_data *data,
54 const struct fsl_usb2_platform_data *pdata);
55
Dinh Nguyen47c53822010-10-23 09:12:46 -050056#include <linux/gpio_keys.h>
57struct platform_device *__init imx_add_gpio_keys(
58 const struct gpio_keys_platform_data *pdata);
59
Uwe Kleine-König9f8714692010-11-10 10:11:23 +010060#include <mach/mx21-usbhost.h>
61struct imx_imx21_hcd_data {
62 resource_size_t iobase;
63 resource_size_t irq;
64};
65struct platform_device *__init imx_add_imx21_hcd(
66 const struct imx_imx21_hcd_data *data,
67 const struct mx21_usbh_platform_data *pdata);
68
Uwe Kleine-Könige0a19612010-11-04 10:09:10 +010069struct imx_imx2_wdt_data {
70 resource_size_t iobase;
71};
72struct platform_device *__init imx_add_imx2_wdt(
73 const struct imx_imx2_wdt_data *data);
74
Uwe Kleine-Königad851bf2010-11-04 17:07:48 +010075#include <mach/imxfb.h>
76struct imx_imx_fb_data {
77 resource_size_t iobase;
78 resource_size_t irq;
79};
80struct platform_device *__init imx_add_imx_fb(
81 const struct imx_imx_fb_data *data,
82 const struct imx_fb_platform_data *pdata);
83
Uwe Kleine-König99a754d2010-06-16 14:37:51 +020084#include <mach/i2c.h>
Uwe Kleine-König64de5ec2010-09-21 12:13:34 +020085struct imx_imx_i2c_data {
86 int id;
87 resource_size_t iobase;
88 resource_size_t iosize;
89 resource_size_t irq;
90};
91struct platform_device *__init imx_add_imx_i2c(
92 const struct imx_imx_i2c_data *data,
Uwe Kleine-König99a754d2010-06-16 14:37:51 +020093 const struct imxi2c_platform_data *pdata);
94
Uwe Kleine-König3f880142010-11-10 09:58:56 +010095#include <linux/input/matrix_keypad.h>
96struct imx_imx_keypad_data {
97 resource_size_t iobase;
Uwe Kleine-Königab9cee4b2010-11-11 11:35:33 +010098 resource_size_t iosize;
Uwe Kleine-König3f880142010-11-10 09:58:56 +010099 resource_size_t irq;
100};
101struct platform_device *__init imx_add_imx_keypad(
102 const struct imx_imx_keypad_data *data,
103 const struct matrix_keymap_data *pdata);
104
Uwe Kleine-König4697bb922010-08-25 17:37:45 +0200105#include <mach/ssi.h>
106struct imx_imx_ssi_data {
107 int id;
108 resource_size_t iobase;
109 resource_size_t iosize;
110 resource_size_t irq;
111 resource_size_t dmatx0;
112 resource_size_t dmarx0;
113 resource_size_t dmatx1;
114 resource_size_t dmarx1;
115};
116struct platform_device *__init imx_add_imx_ssi(
117 const struct imx_imx_ssi_data *data,
118 const struct imx_ssi_platform_data *pdata);
119
Uwe Kleine-König2db68232010-06-22 14:49:20 +0200120#include <mach/imx-uart.h>
Uwe Kleine-König5162de02010-08-10 22:57:24 +0200121struct imx_imx_uart_3irq_data {
122 int id;
123 resource_size_t iobase;
124 resource_size_t iosize;
125 resource_size_t irqrx;
126 resource_size_t irqtx;
127 resource_size_t irqrts;
128};
129struct platform_device *__init imx_add_imx_uart_3irq(
130 const struct imx_imx_uart_3irq_data *data,
Uwe Kleine-König2db68232010-06-22 14:49:20 +0200131 const struct imxuart_platform_data *pdata);
Uwe Kleine-König5162de02010-08-10 22:57:24 +0200132
133struct imx_imx_uart_1irq_data {
134 int id;
135 resource_size_t iobase;
136 resource_size_t iosize;
137 resource_size_t irq;
138};
139struct platform_device *__init imx_add_imx_uart_1irq(
140 const struct imx_imx_uart_1irq_data *data,
Uwe Kleine-König2db68232010-06-22 14:49:20 +0200141 const struct imxuart_platform_data *pdata);
142
Uwe Kleine-Könige0830002010-11-02 10:03:51 +0100143#include <mach/usb.h>
144struct imx_imx_udc_data {
145 resource_size_t iobase;
146 resource_size_t iosize;
147 resource_size_t irq0;
148 resource_size_t irq1;
149 resource_size_t irq2;
150 resource_size_t irq3;
151 resource_size_t irq4;
152 resource_size_t irq5;
153 resource_size_t irq6;
154};
155struct platform_device *__init imx_add_imx_udc(
156 const struct imx_imx_udc_data *data,
157 const struct imxusb_platform_data *pdata);
158
Uwe Kleine-König9bb39b32010-11-02 11:59:08 +0100159#include <mach/mx1_camera.h>
160struct imx_mx1_camera_data {
161 resource_size_t iobase;
162 resource_size_t iosize;
163 resource_size_t irq;
164};
165struct platform_device *__init imx_add_mx1_camera(
166 const struct imx_mx1_camera_data *data,
167 const struct mx1_camera_pdata *pdata);
168
Uwe Kleine-Königb2997cb2010-11-02 17:50:55 +0100169#include <mach/mx2_cam.h>
170struct imx_mx2_camera_data {
171 resource_size_t iobasecsi;
172 resource_size_t iosizecsi;
173 resource_size_t irqcsi;
174 resource_size_t iobaseemmaprp;
175 resource_size_t iosizeemmaprp;
176 resource_size_t irqemmaprp;
177};
178struct platform_device *__init imx_add_mx2_camera(
179 const struct imx_mx2_camera_data *data,
180 const struct mx2_camera_platform_data *pdata);
181
Uwe Kleine-König2eb42d52010-11-05 18:52:09 +0100182#include <mach/mxc_ehci.h>
183struct imx_mxc_ehci_data {
184 int id;
185 resource_size_t iobase;
186 resource_size_t irq;
187};
188struct platform_device *__init imx_add_mxc_ehci(
189 const struct imx_mxc_ehci_data *data,
190 const struct mxc_usbh_platform_data *pdata);
191
Uwe Kleine-König9d3d9452010-11-05 17:26:09 +0100192#include <mach/mmc.h>
193struct imx_mxc_mmc_data {
194 int id;
195 resource_size_t iobase;
196 resource_size_t irq;
197 resource_size_t dmareq;
198};
199struct platform_device *__init imx_add_mxc_mmc(
200 const struct imx_mxc_mmc_data *data,
201 const struct imxmmc_platform_data *pdata);
202
Uwe Kleine-König66384ee2010-06-15 18:14:19 +0200203#include <mach/mxc_nand.h>
Uwe Kleine-König00b57bf2010-08-23 11:25:52 +0200204struct imx_mxc_nand_data {
Sascha Hauer63a7c6d2010-08-03 11:59:46 +0200205 /*
206 * id is traditionally 0, but -1 is more appropriate. We use -1 for new
207 * machines but don't change existing devices as the nand device usually
208 * appears in the kernel command line to pass its partitioning.
209 */
210 int id;
Uwe Kleine-König00b57bf2010-08-23 11:25:52 +0200211 resource_size_t iobase;
212 resource_size_t iosize;
Sascha Hauer63a7c6d2010-08-03 11:59:46 +0200213 resource_size_t axibase;
Uwe Kleine-König00b57bf2010-08-23 11:25:52 +0200214 resource_size_t irq;
215};
216struct platform_device *__init imx_add_mxc_nand(
217 const struct imx_mxc_nand_data *data,
218 const struct mxc_nand_platform_data *pdata);
Uwe Kleine-König02870732010-06-21 18:02:55 +0200219
Uwe Kleine-Königbf182bc2010-11-05 15:01:16 +0100220struct imx_mxc_pwm_data {
Uwe Kleine-König5f3d1092010-11-10 22:15:45 +0100221 int id;
Uwe Kleine-Königbf182bc2010-11-05 15:01:16 +0100222 resource_size_t iobase;
Uwe Kleine-König5f3d1092010-11-10 22:15:45 +0100223 resource_size_t iosize;
Uwe Kleine-Königbf182bc2010-11-05 15:01:16 +0100224 resource_size_t irq;
225};
226struct platform_device *__init imx_add_mxc_pwm(
227 const struct imx_mxc_pwm_data *data);
228
Uwe Kleine-Königae71a562010-10-29 10:56:07 +0200229struct imx_mxc_w1_data {
230 resource_size_t iobase;
231};
232struct platform_device *__init imx_add_mxc_w1(
233 const struct imx_mxc_w1_data *data);
234
Uwe Kleine-König02870732010-06-21 18:02:55 +0200235#include <mach/spi.h>
Uwe Kleine-König35bab052010-09-09 21:02:02 +0200236struct imx_spi_imx_data {
Uwe Kleine-Königab560502010-09-09 21:02:02 +0200237 const char *devid;
Uwe Kleine-König35bab052010-09-09 21:02:02 +0200238 int id;
239 resource_size_t iobase;
240 resource_size_t iosize;
241 int irq;
242};
243struct platform_device *__init imx_add_spi_imx(
244 const struct imx_spi_imx_data *data,
Uwe Kleine-König02870732010-06-21 18:02:55 +0200245 const struct spi_imx_master *pdata);
Wolfram Sang203a0732010-10-11 12:55:21 +0200246
247#include <mach/esdhc.h>
Eric Bénardc0745122010-10-12 13:12:32 +0200248struct imx_esdhc_imx_data {
249 int id;
250 resource_size_t iobase;
251 resource_size_t irq;
252};
253struct platform_device *__init imx_add_esdhc(
254 const struct imx_esdhc_imx_data *data,
Wolfram Sang203a0732010-10-11 12:55:21 +0200255 const struct esdhc_platform_data *pdata);