Uwe Kleine-König | 253ff1f | 2010-06-15 11:31:02 +0200 | [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> |
| 12 | |
Uwe Kleine-König | 6332c10 | 2010-11-02 11:56:54 +0100 | [diff] [blame] | 13 | struct platform_device *imx_add_platform_device_dmamask( |
| 14 | const char *name, int id, |
Uwe Kleine-König | 253ff1f | 2010-06-15 11:31:02 +0200 | [diff] [blame] | 15 | const struct resource *res, unsigned int num_resources, |
Uwe Kleine-König | 6332c10 | 2010-11-02 11:56:54 +0100 | [diff] [blame] | 16 | const void *data, size_t size_data, u64 dmamask); |
| 17 | |
| 18 | static 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önig | 66384ee | 2010-06-15 18:14:19 +0200 | [diff] [blame] | 26 | |
Uwe Kleine-König | 6bd96f3 | 2010-10-06 12:00:18 +0200 | [diff] [blame] | 27 | #include <linux/fec.h> |
| 28 | struct imx_fec_data { |
| 29 | resource_size_t iobase; |
| 30 | resource_size_t irq; |
| 31 | }; |
| 32 | struct platform_device *__init imx_add_fec( |
| 33 | const struct imx_fec_data *data, |
| 34 | const struct fec_platform_data *pdata); |
| 35 | |
Marc Kleine-Budde | 61c6850 | 2010-07-22 11:45:34 +0200 | [diff] [blame] | 36 | #include <linux/can/platform/flexcan.h> |
| 37 | struct 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-Budde | 61c6850 | 2010-07-22 11:45:34 +0200 | [diff] [blame] | 41 | |
Dinh Nguyen | 47c5382 | 2010-10-23 09:12:46 -0500 | [diff] [blame] | 42 | #include <linux/gpio_keys.h> |
| 43 | struct platform_device *__init imx_add_gpio_keys( |
| 44 | const struct gpio_keys_platform_data *pdata); |
| 45 | |
Uwe Kleine-König | e0a1961 | 2010-11-04 10:09:10 +0100 | [diff] [blame^] | 46 | struct imx_imx2_wdt_data { |
| 47 | resource_size_t iobase; |
| 48 | }; |
| 49 | struct platform_device *__init imx_add_imx2_wdt( |
| 50 | const struct imx_imx2_wdt_data *data); |
| 51 | |
Uwe Kleine-König | 99a754d | 2010-06-16 14:37:51 +0200 | [diff] [blame] | 52 | #include <mach/i2c.h> |
Uwe Kleine-König | 64de5ec | 2010-09-21 12:13:34 +0200 | [diff] [blame] | 53 | struct imx_imx_i2c_data { |
| 54 | int id; |
| 55 | resource_size_t iobase; |
| 56 | resource_size_t iosize; |
| 57 | resource_size_t irq; |
| 58 | }; |
| 59 | struct platform_device *__init imx_add_imx_i2c( |
| 60 | const struct imx_imx_i2c_data *data, |
Uwe Kleine-König | 99a754d | 2010-06-16 14:37:51 +0200 | [diff] [blame] | 61 | const struct imxi2c_platform_data *pdata); |
| 62 | |
Uwe Kleine-König | 4697bb92 | 2010-08-25 17:37:45 +0200 | [diff] [blame] | 63 | #include <mach/ssi.h> |
| 64 | struct 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 | }; |
| 74 | struct 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önig | 2db6823 | 2010-06-22 14:49:20 +0200 | [diff] [blame] | 78 | #include <mach/imx-uart.h> |
Uwe Kleine-König | 5162de0 | 2010-08-10 22:57:24 +0200 | [diff] [blame] | 79 | struct 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 | }; |
| 87 | struct platform_device *__init imx_add_imx_uart_3irq( |
| 88 | const struct imx_imx_uart_3irq_data *data, |
Uwe Kleine-König | 2db6823 | 2010-06-22 14:49:20 +0200 | [diff] [blame] | 89 | const struct imxuart_platform_data *pdata); |
Uwe Kleine-König | 5162de0 | 2010-08-10 22:57:24 +0200 | [diff] [blame] | 90 | |
| 91 | struct imx_imx_uart_1irq_data { |
| 92 | int id; |
| 93 | resource_size_t iobase; |
| 94 | resource_size_t iosize; |
| 95 | resource_size_t irq; |
| 96 | }; |
| 97 | struct platform_device *__init imx_add_imx_uart_1irq( |
| 98 | const struct imx_imx_uart_1irq_data *data, |
Uwe Kleine-König | 2db6823 | 2010-06-22 14:49:20 +0200 | [diff] [blame] | 99 | const struct imxuart_platform_data *pdata); |
| 100 | |
Uwe Kleine-König | e083000 | 2010-11-02 10:03:51 +0100 | [diff] [blame] | 101 | #include <mach/usb.h> |
| 102 | struct 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 | }; |
| 113 | struct 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önig | 9bb39b3 | 2010-11-02 11:59:08 +0100 | [diff] [blame] | 117 | #include <mach/mx1_camera.h> |
| 118 | struct imx_mx1_camera_data { |
| 119 | resource_size_t iobase; |
| 120 | resource_size_t iosize; |
| 121 | resource_size_t irq; |
| 122 | }; |
| 123 | struct 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önig | b2997cb | 2010-11-02 17:50:55 +0100 | [diff] [blame] | 127 | #include <mach/mx2_cam.h> |
| 128 | struct 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 | }; |
| 136 | struct 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önig | 66384ee | 2010-06-15 18:14:19 +0200 | [diff] [blame] | 140 | #include <mach/mxc_nand.h> |
Uwe Kleine-König | 00b57bf | 2010-08-23 11:25:52 +0200 | [diff] [blame] | 141 | struct imx_mxc_nand_data { |
Sascha Hauer | 63a7c6d | 2010-08-03 11:59:46 +0200 | [diff] [blame] | 142 | /* |
| 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önig | 00b57bf | 2010-08-23 11:25:52 +0200 | [diff] [blame] | 148 | resource_size_t iobase; |
| 149 | resource_size_t iosize; |
Sascha Hauer | 63a7c6d | 2010-08-03 11:59:46 +0200 | [diff] [blame] | 150 | resource_size_t axibase; |
Uwe Kleine-König | 00b57bf | 2010-08-23 11:25:52 +0200 | [diff] [blame] | 151 | resource_size_t irq; |
| 152 | }; |
| 153 | struct 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önig | 0287073 | 2010-06-21 18:02:55 +0200 | [diff] [blame] | 156 | |
Uwe Kleine-König | ae71a56 | 2010-10-29 10:56:07 +0200 | [diff] [blame] | 157 | struct imx_mxc_w1_data { |
| 158 | resource_size_t iobase; |
| 159 | }; |
| 160 | struct platform_device *__init imx_add_mxc_w1( |
| 161 | const struct imx_mxc_w1_data *data); |
| 162 | |
Uwe Kleine-König | 0287073 | 2010-06-21 18:02:55 +0200 | [diff] [blame] | 163 | #include <mach/spi.h> |
Uwe Kleine-König | 35bab05 | 2010-09-09 21:02:02 +0200 | [diff] [blame] | 164 | struct imx_spi_imx_data { |
Uwe Kleine-König | ab56050 | 2010-09-09 21:02:02 +0200 | [diff] [blame] | 165 | const char *devid; |
Uwe Kleine-König | 35bab05 | 2010-09-09 21:02:02 +0200 | [diff] [blame] | 166 | int id; |
| 167 | resource_size_t iobase; |
| 168 | resource_size_t iosize; |
| 169 | int irq; |
| 170 | }; |
| 171 | struct platform_device *__init imx_add_spi_imx( |
| 172 | const struct imx_spi_imx_data *data, |
Uwe Kleine-König | 0287073 | 2010-06-21 18:02:55 +0200 | [diff] [blame] | 173 | const struct spi_imx_master *pdata); |
Wolfram Sang | 203a073 | 2010-10-11 12:55:21 +0200 | [diff] [blame] | 174 | |
| 175 | #include <mach/esdhc.h> |
Eric Bénard | c074512 | 2010-10-12 13:12:32 +0200 | [diff] [blame] | 176 | struct imx_esdhc_imx_data { |
| 177 | int id; |
| 178 | resource_size_t iobase; |
| 179 | resource_size_t irq; |
| 180 | }; |
| 181 | struct platform_device *__init imx_add_esdhc( |
| 182 | const struct imx_esdhc_imx_data *data, |
Wolfram Sang | 203a073 | 2010-10-11 12:55:21 +0200 | [diff] [blame] | 183 | const struct esdhc_platform_data *pdata); |