blob: a8080f44c03d9310d74b26d2965dba0862f006f1 [file] [log] [blame]
Shawn Guodc38ad42010-12-09 23:12:46 +08001/*
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>
Shawn Guodbc42452011-01-04 14:20:52 +080012#include <linux/amba/bus.h>
Shawn Guodc38ad42010-12-09 23:12:46 +080013
Shawn Guo8d7cf832011-06-06 09:37:58 -060014extern struct device mxs_apbh_bus;
15
Shawn Guodc38ad42010-12-09 23:12:46 +080016struct 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
21static 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
Shawn Guodbc42452011-01-04 14:20:52 +080030int __init mxs_add_amba_device(const struct amba_device *dev);
31
Shawn Guodc38ad42010-12-09 23:12:46 +080032/* duart */
Shawn Guodbc42452011-01-04 14:20:52 +080033int __init mxs_add_duart(const struct amba_device *dev);
Shawn Guob9a2ada2010-12-09 23:12:47 +080034
Sascha Hauercf3567a2011-01-11 15:56:40 +010035/* auart */
36struct mxs_auart_data {
37 int id;
38 resource_size_t iobase;
39 resource_size_t iosize;
40 resource_size_t irq;
41};
42struct platform_device *__init mxs_add_auart(
43 const struct mxs_auart_data *data);
44
Shawn Guob9a2ada2010-12-09 23:12:47 +080045/* fec */
46#include <linux/fec.h>
47struct mxs_fec_data {
48 int id;
49 resource_size_t iobase;
50 resource_size_t iosize;
51 resource_size_t irq;
52};
53struct platform_device *__init mxs_add_fec(
54 const struct mxs_fec_data *data,
55 const struct fec_platform_data *pdata);
Marc Kleine-Budde22cbba12011-02-02 13:50:30 +010056
57/* flexcan */
58#include <linux/can/platform/flexcan.h>
59struct mxs_flexcan_data {
60 int id;
61 resource_size_t iobase;
62 resource_size_t iosize;
63 resource_size_t irq;
64};
65struct platform_device *__init mxs_add_flexcan(
66 const struct mxs_flexcan_data *data,
67 const struct flexcan_platform_data *pdata);
Sascha Hauer2301dfa2011-01-25 11:58:15 +010068
Wolfram Sang30feed32011-02-28 17:40:04 +010069/* i2c */
Uwe Kleine-König01d8cf032011-01-11 10:22:14 +010070struct mxs_mxs_i2c_data {
Wolfram Sang30feed32011-02-28 17:40:04 +010071 int id;
72 resource_size_t iobase;
73 resource_size_t errirq;
74 resource_size_t dmairq;
75};
Uwe Kleine-König01d8cf032011-01-11 10:22:14 +010076struct platform_device * __init mxs_add_mxs_i2c(
77 const struct mxs_mxs_i2c_data *data);
Wolfram Sang30feed32011-02-28 17:40:04 +010078
Shawn Guo47babe62011-03-16 11:31:06 +010079/* mmc */
80#include <mach/mmc.h>
81struct mxs_mxs_mmc_data {
82 int id;
83 resource_size_t iobase;
84 resource_size_t dma;
85 resource_size_t irq_err;
86 resource_size_t irq_dma;
87};
88struct platform_device *__init mxs_add_mxs_mmc(
89 const struct mxs_mxs_mmc_data *data,
90 const struct mxs_mmc_platform_data *pdata);
91
Sascha Hauer2301dfa2011-01-25 11:58:15 +010092/* pwm */
93struct platform_device *__init mxs_add_mxs_pwm(
94 resource_size_t iobase, int id);
Dong Aishengc8ebcac2011-07-20 11:41:42 +080095
96/* saif */
97struct mxs_saif_data {
98 int id;
99 resource_size_t iobase;
100 resource_size_t irq;
101 resource_size_t dma;
102 resource_size_t dmairq;
103};
104
105struct platform_device *__init mxs_add_saif(
106 const struct mxs_saif_data *data);