Shawn Guo | dc38ad4 | 2010-12-09 23:12:46 +0800 | [diff] [blame] | 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> |
Shawn Guo | dbc4245 | 2011-01-04 14:20:52 +0800 | [diff] [blame] | 12 | #include <linux/amba/bus.h> |
Shawn Guo | dc38ad4 | 2010-12-09 23:12:46 +0800 | [diff] [blame] | 13 | |
Shawn Guo | 8d7cf83 | 2011-06-06 09:37:58 -0600 | [diff] [blame] | 14 | extern struct device mxs_apbh_bus; |
| 15 | |
Shawn Guo | dc38ad4 | 2010-12-09 23:12:46 +0800 | [diff] [blame] | 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 | |
| 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 | |
Sascha Hauer | cf3567a | 2011-01-11 15:56:40 +0100 | [diff] [blame] | 30 | /* auart */ |
| 31 | struct mxs_auart_data { |
| 32 | int id; |
| 33 | resource_size_t iobase; |
| 34 | resource_size_t iosize; |
| 35 | resource_size_t irq; |
| 36 | }; |
| 37 | struct platform_device *__init mxs_add_auart( |
| 38 | const struct mxs_auart_data *data); |
| 39 | |
Shawn Guo | b9a2ada | 2010-12-09 23:12:47 +0800 | [diff] [blame] | 40 | /* fec */ |
| 41 | #include <linux/fec.h> |
| 42 | struct mxs_fec_data { |
| 43 | int id; |
| 44 | resource_size_t iobase; |
| 45 | resource_size_t iosize; |
| 46 | resource_size_t irq; |
| 47 | }; |
| 48 | struct platform_device *__init mxs_add_fec( |
| 49 | const struct mxs_fec_data *data, |
| 50 | const struct fec_platform_data *pdata); |
Marc Kleine-Budde | 22cbba1 | 2011-02-02 13:50:30 +0100 | [diff] [blame] | 51 | |
| 52 | /* flexcan */ |
| 53 | #include <linux/can/platform/flexcan.h> |
| 54 | struct mxs_flexcan_data { |
| 55 | int id; |
| 56 | resource_size_t iobase; |
| 57 | resource_size_t iosize; |
| 58 | resource_size_t irq; |
| 59 | }; |
| 60 | struct platform_device *__init mxs_add_flexcan( |
| 61 | const struct mxs_flexcan_data *data, |
| 62 | const struct flexcan_platform_data *pdata); |
Sascha Hauer | 2301dfa | 2011-01-25 11:58:15 +0100 | [diff] [blame] | 63 | |
Huang Shijie | 60c1535 | 2012-02-06 13:08:21 +0800 | [diff] [blame] | 64 | /* gpmi-nand */ |
| 65 | #include <linux/mtd/gpmi-nand.h> |
| 66 | struct mxs_gpmi_nand_data { |
| 67 | const char *devid; |
| 68 | const struct resource res[GPMI_NAND_RES_SIZE]; |
| 69 | }; |
| 70 | struct platform_device *__init |
| 71 | mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata, |
| 72 | const struct mxs_gpmi_nand_data *data); |
| 73 | |
Wolfram Sang | 30feed3 | 2011-02-28 17:40:04 +0100 | [diff] [blame] | 74 | /* i2c */ |
Uwe Kleine-König | 01d8cf03 | 2011-01-11 10:22:14 +0100 | [diff] [blame] | 75 | struct mxs_mxs_i2c_data { |
Wolfram Sang | 30feed3 | 2011-02-28 17:40:04 +0100 | [diff] [blame] | 76 | int id; |
| 77 | resource_size_t iobase; |
| 78 | resource_size_t errirq; |
| 79 | resource_size_t dmairq; |
| 80 | }; |
Uwe Kleine-König | 01d8cf03 | 2011-01-11 10:22:14 +0100 | [diff] [blame] | 81 | struct platform_device * __init mxs_add_mxs_i2c( |
| 82 | const struct mxs_mxs_i2c_data *data); |
Wolfram Sang | 30feed3 | 2011-02-28 17:40:04 +0100 | [diff] [blame] | 83 | |
Shawn Guo | 47babe6 | 2011-03-16 11:31:06 +0100 | [diff] [blame] | 84 | /* mmc */ |
Shawn Guo | 81f38ee | 2012-05-06 10:04:23 +0800 | [diff] [blame] | 85 | #include <linux/mmc/mxs-mmc.h> |
Shawn Guo | 47babe6 | 2011-03-16 11:31:06 +0100 | [diff] [blame] | 86 | struct mxs_mxs_mmc_data { |
Shawn Guo | ef9b4d3 | 2012-05-05 20:24:01 +0800 | [diff] [blame] | 87 | const char *devid; |
Shawn Guo | 47babe6 | 2011-03-16 11:31:06 +0100 | [diff] [blame] | 88 | int id; |
| 89 | resource_size_t iobase; |
| 90 | resource_size_t dma; |
| 91 | resource_size_t irq_err; |
| 92 | resource_size_t irq_dma; |
| 93 | }; |
| 94 | struct platform_device *__init mxs_add_mxs_mmc( |
| 95 | const struct mxs_mxs_mmc_data *data, |
| 96 | const struct mxs_mmc_platform_data *pdata); |
| 97 | |
Sascha Hauer | 2301dfa | 2011-01-25 11:58:15 +0100 | [diff] [blame] | 98 | /* pwm */ |
| 99 | struct platform_device *__init mxs_add_mxs_pwm( |
| 100 | resource_size_t iobase, int id); |
Dong Aisheng | c8ebcac | 2011-07-20 11:41:42 +0800 | [diff] [blame] | 101 | |
| 102 | /* saif */ |
Dong Aisheng | 4c0174c | 2011-11-22 23:54:24 +0800 | [diff] [blame] | 103 | #include <sound/saif.h> |
Dong Aisheng | c8ebcac | 2011-07-20 11:41:42 +0800 | [diff] [blame] | 104 | struct mxs_saif_data { |
| 105 | int id; |
| 106 | resource_size_t iobase; |
| 107 | resource_size_t irq; |
| 108 | resource_size_t dma; |
| 109 | resource_size_t dmairq; |
| 110 | }; |
| 111 | |
| 112 | struct platform_device *__init mxs_add_saif( |
Dong Aisheng | 4c0174c | 2011-11-22 23:54:24 +0800 | [diff] [blame] | 113 | const struct mxs_saif_data *data, |
| 114 | const struct mxs_saif_platform_data *pdata); |