1 /*
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 #include <linux/amba/bus.h>
13
14 extern struct device mxs_apbh_bus;
15
16 struct platform_device *mxs_add_platform_device_dmamask(
17 const char *name, int id,
18 const struct resource *res, unsigned int num_resources,
19 const void *data, size_t size_data, u64 dmamask);
20
mxs_add_platform_device(const char * name,int id,const struct resource * res,unsigned int num_resources,const void * data,size_t size_data)21 static inline struct platform_device *mxs_add_platform_device(
22 const char *name, int id,
23 const struct resource *res, unsigned int num_resources,
24 const void *data, size_t size_data)
25 {
26 return mxs_add_platform_device_dmamask(
27 name, id, res, num_resources, data, size_data, 0);
28 }
29
30 int __init mxs_add_amba_device(const struct amba_device *dev);
31
32 /* duart */
33 int __init mxs_add_duart(const struct amba_device *dev);
34
35 /* auart */
36 struct mxs_auart_data {
37 int id;
38 resource_size_t iobase;
39 resource_size_t iosize;
40 resource_size_t irq;
41 };
42 struct platform_device *__init mxs_add_auart(
43 const struct mxs_auart_data *data);
44
45 /* fec */
46 #include <linux/fec.h>
47 struct mxs_fec_data {
48 int id;
49 resource_size_t iobase;
50 resource_size_t iosize;
51 resource_size_t irq;
52 };
53 struct platform_device *__init mxs_add_fec(
54 const struct mxs_fec_data *data,
55 const struct fec_platform_data *pdata);
56
57 /* flexcan */
58 #include <linux/can/platform/flexcan.h>
59 struct mxs_flexcan_data {
60 int id;
61 resource_size_t iobase;
62 resource_size_t iosize;
63 resource_size_t irq;
64 };
65 struct platform_device *__init mxs_add_flexcan(
66 const struct mxs_flexcan_data *data,
67 const struct flexcan_platform_data *pdata);
68
69 /* gpmi-nand */
70 #include <linux/mtd/gpmi-nand.h>
71 struct mxs_gpmi_nand_data {
72 const char *devid;
73 const struct resource res[GPMI_NAND_RES_SIZE];
74 };
75 struct platform_device *__init
76 mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata,
77 const struct mxs_gpmi_nand_data *data);
78
79 /* i2c */
80 struct mxs_mxs_i2c_data {
81 int id;
82 resource_size_t iobase;
83 resource_size_t errirq;
84 resource_size_t dmairq;
85 };
86 struct platform_device * __init mxs_add_mxs_i2c(
87 const struct mxs_mxs_i2c_data *data);
88
89 /* mmc */
90 #include <mach/mmc.h>
91 struct mxs_mxs_mmc_data {
92 int id;
93 resource_size_t iobase;
94 resource_size_t dma;
95 resource_size_t irq_err;
96 resource_size_t irq_dma;
97 };
98 struct platform_device *__init mxs_add_mxs_mmc(
99 const struct mxs_mxs_mmc_data *data,
100 const struct mxs_mmc_platform_data *pdata);
101
102 /* pwm */
103 struct platform_device *__init mxs_add_mxs_pwm(
104 resource_size_t iobase, int id);
105
106 /* saif */
107 #include <sound/saif.h>
108 struct mxs_saif_data {
109 int id;
110 resource_size_t iobase;
111 resource_size_t irq;
112 resource_size_t dma;
113 resource_size_t dmairq;
114 };
115
116 struct platform_device *__init mxs_add_saif(
117 const struct mxs_saif_data *data,
118 const struct mxs_saif_platform_data *pdata);
119