blob: a0ac8454229868f4fbd5ce2ed3d0e84a972beb32 [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>
37struct platform_device *__init imx_add_flexcan(int id,
38 resource_size_t iobase, resource_size_t iosize,
39 resource_size_t irq,
40 const struct flexcan_platform_data *pdata);
Marc Kleine-Budde61c68502010-07-22 11:45:34 +020041
Dinh Nguyen47c53822010-10-23 09:12:46 -050042#include <linux/gpio_keys.h>
43struct platform_device *__init imx_add_gpio_keys(
44 const struct gpio_keys_platform_data *pdata);
45
Uwe Kleine-Könige0a19612010-11-04 10:09:10 +010046struct imx_imx2_wdt_data {
47 resource_size_t iobase;
48};
49struct platform_device *__init imx_add_imx2_wdt(
50 const struct imx_imx2_wdt_data *data);
51
Uwe Kleine-König99a754d2010-06-16 14:37:51 +020052#include <mach/i2c.h>
Uwe Kleine-König64de5ec2010-09-21 12:13:34 +020053struct imx_imx_i2c_data {
54 int id;
55 resource_size_t iobase;
56 resource_size_t iosize;
57 resource_size_t irq;
58};
59struct platform_device *__init imx_add_imx_i2c(
60 const struct imx_imx_i2c_data *data,
Uwe Kleine-König99a754d2010-06-16 14:37:51 +020061 const struct imxi2c_platform_data *pdata);
62
Uwe Kleine-König4697bb922010-08-25 17:37:45 +020063#include <mach/ssi.h>
64struct imx_imx_ssi_data {
65 int id;
66 resource_size_t iobase;
67 resource_size_t iosize;
68 resource_size_t irq;
69 resource_size_t dmatx0;
70 resource_size_t dmarx0;
71 resource_size_t dmatx1;
72 resource_size_t dmarx1;
73};
74struct platform_device *__init imx_add_imx_ssi(
75 const struct imx_imx_ssi_data *data,
76 const struct imx_ssi_platform_data *pdata);
77
Uwe Kleine-König2db68232010-06-22 14:49:20 +020078#include <mach/imx-uart.h>
Uwe Kleine-König5162de02010-08-10 22:57:24 +020079struct imx_imx_uart_3irq_data {
80 int id;
81 resource_size_t iobase;
82 resource_size_t iosize;
83 resource_size_t irqrx;
84 resource_size_t irqtx;
85 resource_size_t irqrts;
86};
87struct platform_device *__init imx_add_imx_uart_3irq(
88 const struct imx_imx_uart_3irq_data *data,
Uwe Kleine-König2db68232010-06-22 14:49:20 +020089 const struct imxuart_platform_data *pdata);
Uwe Kleine-König5162de02010-08-10 22:57:24 +020090
91struct imx_imx_uart_1irq_data {
92 int id;
93 resource_size_t iobase;
94 resource_size_t iosize;
95 resource_size_t irq;
96};
97struct platform_device *__init imx_add_imx_uart_1irq(
98 const struct imx_imx_uart_1irq_data *data,
Uwe Kleine-König2db68232010-06-22 14:49:20 +020099 const struct imxuart_platform_data *pdata);
100
Uwe Kleine-Könige0830002010-11-02 10:03:51 +0100101#include <mach/usb.h>
102struct imx_imx_udc_data {
103 resource_size_t iobase;
104 resource_size_t iosize;
105 resource_size_t irq0;
106 resource_size_t irq1;
107 resource_size_t irq2;
108 resource_size_t irq3;
109 resource_size_t irq4;
110 resource_size_t irq5;
111 resource_size_t irq6;
112};
113struct platform_device *__init imx_add_imx_udc(
114 const struct imx_imx_udc_data *data,
115 const struct imxusb_platform_data *pdata);
116
Uwe Kleine-König9bb39b32010-11-02 11:59:08 +0100117#include <mach/mx1_camera.h>
118struct imx_mx1_camera_data {
119 resource_size_t iobase;
120 resource_size_t iosize;
121 resource_size_t irq;
122};
123struct platform_device *__init imx_add_mx1_camera(
124 const struct imx_mx1_camera_data *data,
125 const struct mx1_camera_pdata *pdata);
126
Uwe Kleine-Königb2997cb2010-11-02 17:50:55 +0100127#include <mach/mx2_cam.h>
128struct imx_mx2_camera_data {
129 resource_size_t iobasecsi;
130 resource_size_t iosizecsi;
131 resource_size_t irqcsi;
132 resource_size_t iobaseemmaprp;
133 resource_size_t iosizeemmaprp;
134 resource_size_t irqemmaprp;
135};
136struct platform_device *__init imx_add_mx2_camera(
137 const struct imx_mx2_camera_data *data,
138 const struct mx2_camera_platform_data *pdata);
139
Uwe Kleine-König66384ee2010-06-15 18:14:19 +0200140#include <mach/mxc_nand.h>
Uwe Kleine-König00b57bf2010-08-23 11:25:52 +0200141struct imx_mxc_nand_data {
Sascha Hauer63a7c6d2010-08-03 11:59:46 +0200142 /*
143 * id is traditionally 0, but -1 is more appropriate. We use -1 for new
144 * machines but don't change existing devices as the nand device usually
145 * appears in the kernel command line to pass its partitioning.
146 */
147 int id;
Uwe Kleine-König00b57bf2010-08-23 11:25:52 +0200148 resource_size_t iobase;
149 resource_size_t iosize;
Sascha Hauer63a7c6d2010-08-03 11:59:46 +0200150 resource_size_t axibase;
Uwe Kleine-König00b57bf2010-08-23 11:25:52 +0200151 resource_size_t irq;
152};
153struct platform_device *__init imx_add_mxc_nand(
154 const struct imx_mxc_nand_data *data,
155 const struct mxc_nand_platform_data *pdata);
Uwe Kleine-König02870732010-06-21 18:02:55 +0200156
Uwe Kleine-Königae71a562010-10-29 10:56:07 +0200157struct imx_mxc_w1_data {
158 resource_size_t iobase;
159};
160struct platform_device *__init imx_add_mxc_w1(
161 const struct imx_mxc_w1_data *data);
162
Uwe Kleine-König02870732010-06-21 18:02:55 +0200163#include <mach/spi.h>
Uwe Kleine-König35bab052010-09-09 21:02:02 +0200164struct imx_spi_imx_data {
Uwe Kleine-Königab560502010-09-09 21:02:02 +0200165 const char *devid;
Uwe Kleine-König35bab052010-09-09 21:02:02 +0200166 int id;
167 resource_size_t iobase;
168 resource_size_t iosize;
169 int irq;
170};
171struct platform_device *__init imx_add_spi_imx(
172 const struct imx_spi_imx_data *data,
Uwe Kleine-König02870732010-06-21 18:02:55 +0200173 const struct spi_imx_master *pdata);
Wolfram Sang203a0732010-10-11 12:55:21 +0200174
175#include <mach/esdhc.h>
Eric Bénardc0745122010-10-12 13:12:32 +0200176struct imx_esdhc_imx_data {
177 int id;
178 resource_size_t iobase;
179 resource_size_t irq;
180};
181struct platform_device *__init imx_add_esdhc(
182 const struct imx_esdhc_imx_data *data,
Wolfram Sang203a0732010-10-11 12:55:21 +0200183 const struct esdhc_platform_data *pdata);