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> |
Uwe Kleine-König | fc40d01 | 2010-11-04 12:02:35 +0100 | [diff] [blame] | 37 | struct imx_flexcan_data { |
| 38 | int id; |
| 39 | resource_size_t iobase; |
| 40 | resource_size_t iosize; |
| 41 | resource_size_t irq; |
| 42 | }; |
| 43 | struct platform_device *__init imx_add_flexcan( |
| 44 | const struct imx_flexcan_data *data, |
Marc Kleine-Budde | 61c6850 | 2010-07-22 11:45:34 +0200 | [diff] [blame] | 45 | const struct flexcan_platform_data *pdata); |
Marc Kleine-Budde | 61c6850 | 2010-07-22 11:45:34 +0200 | [diff] [blame] | 46 | |
Uwe Kleine-König | bd455ed | 2010-11-09 17:52:14 +0100 | [diff] [blame] | 47 | #include <linux/fsl_devices.h> |
| 48 | struct imx_fsl_usb2_udc_data { |
| 49 | resource_size_t iobase; |
| 50 | resource_size_t irq; |
| 51 | }; |
| 52 | struct platform_device *__init imx_add_fsl_usb2_udc( |
| 53 | const struct imx_fsl_usb2_udc_data *data, |
| 54 | const struct fsl_usb2_platform_data *pdata); |
| 55 | |
Dinh Nguyen | 47c5382 | 2010-10-23 09:12:46 -0500 | [diff] [blame] | 56 | #include <linux/gpio_keys.h> |
| 57 | struct platform_device *__init imx_add_gpio_keys( |
| 58 | const struct gpio_keys_platform_data *pdata); |
| 59 | |
Uwe Kleine-König | 9f871469 | 2010-11-10 10:11:23 +0100 | [diff] [blame] | 60 | #include <mach/mx21-usbhost.h> |
| 61 | struct imx_imx21_hcd_data { |
| 62 | resource_size_t iobase; |
| 63 | resource_size_t irq; |
| 64 | }; |
| 65 | struct platform_device *__init imx_add_imx21_hcd( |
| 66 | const struct imx_imx21_hcd_data *data, |
| 67 | const struct mx21_usbh_platform_data *pdata); |
| 68 | |
Uwe Kleine-König | e0a1961 | 2010-11-04 10:09:10 +0100 | [diff] [blame] | 69 | struct imx_imx2_wdt_data { |
| 70 | resource_size_t iobase; |
| 71 | }; |
| 72 | struct platform_device *__init imx_add_imx2_wdt( |
| 73 | const struct imx_imx2_wdt_data *data); |
| 74 | |
Uwe Kleine-König | ad851bf | 2010-11-04 17:07:48 +0100 | [diff] [blame] | 75 | #include <mach/imxfb.h> |
| 76 | struct imx_imx_fb_data { |
| 77 | resource_size_t iobase; |
| 78 | resource_size_t irq; |
| 79 | }; |
| 80 | struct platform_device *__init imx_add_imx_fb( |
| 81 | const struct imx_imx_fb_data *data, |
| 82 | const struct imx_fb_platform_data *pdata); |
| 83 | |
Uwe Kleine-König | 99a754d | 2010-06-16 14:37:51 +0200 | [diff] [blame] | 84 | #include <mach/i2c.h> |
Uwe Kleine-König | 64de5ec | 2010-09-21 12:13:34 +0200 | [diff] [blame] | 85 | struct imx_imx_i2c_data { |
| 86 | int id; |
| 87 | resource_size_t iobase; |
| 88 | resource_size_t iosize; |
| 89 | resource_size_t irq; |
| 90 | }; |
| 91 | struct platform_device *__init imx_add_imx_i2c( |
| 92 | const struct imx_imx_i2c_data *data, |
Uwe Kleine-König | 99a754d | 2010-06-16 14:37:51 +0200 | [diff] [blame] | 93 | const struct imxi2c_platform_data *pdata); |
| 94 | |
Uwe Kleine-König | 3f88014 | 2010-11-10 09:58:56 +0100 | [diff] [blame] | 95 | #include <linux/input/matrix_keypad.h> |
| 96 | struct imx_imx_keypad_data { |
| 97 | resource_size_t iobase; |
Uwe Kleine-König | ab9cee4b | 2010-11-11 11:35:33 +0100 | [diff] [blame^] | 98 | resource_size_t iosize; |
Uwe Kleine-König | 3f88014 | 2010-11-10 09:58:56 +0100 | [diff] [blame] | 99 | resource_size_t irq; |
| 100 | }; |
| 101 | struct platform_device *__init imx_add_imx_keypad( |
| 102 | const struct imx_imx_keypad_data *data, |
| 103 | const struct matrix_keymap_data *pdata); |
| 104 | |
Uwe Kleine-König | 4697bb92 | 2010-08-25 17:37:45 +0200 | [diff] [blame] | 105 | #include <mach/ssi.h> |
| 106 | struct imx_imx_ssi_data { |
| 107 | int id; |
| 108 | resource_size_t iobase; |
| 109 | resource_size_t iosize; |
| 110 | resource_size_t irq; |
| 111 | resource_size_t dmatx0; |
| 112 | resource_size_t dmarx0; |
| 113 | resource_size_t dmatx1; |
| 114 | resource_size_t dmarx1; |
| 115 | }; |
| 116 | struct platform_device *__init imx_add_imx_ssi( |
| 117 | const struct imx_imx_ssi_data *data, |
| 118 | const struct imx_ssi_platform_data *pdata); |
| 119 | |
Uwe Kleine-König | 2db6823 | 2010-06-22 14:49:20 +0200 | [diff] [blame] | 120 | #include <mach/imx-uart.h> |
Uwe Kleine-König | 5162de0 | 2010-08-10 22:57:24 +0200 | [diff] [blame] | 121 | struct imx_imx_uart_3irq_data { |
| 122 | int id; |
| 123 | resource_size_t iobase; |
| 124 | resource_size_t iosize; |
| 125 | resource_size_t irqrx; |
| 126 | resource_size_t irqtx; |
| 127 | resource_size_t irqrts; |
| 128 | }; |
| 129 | struct platform_device *__init imx_add_imx_uart_3irq( |
| 130 | const struct imx_imx_uart_3irq_data *data, |
Uwe Kleine-König | 2db6823 | 2010-06-22 14:49:20 +0200 | [diff] [blame] | 131 | const struct imxuart_platform_data *pdata); |
Uwe Kleine-König | 5162de0 | 2010-08-10 22:57:24 +0200 | [diff] [blame] | 132 | |
| 133 | struct imx_imx_uart_1irq_data { |
| 134 | int id; |
| 135 | resource_size_t iobase; |
| 136 | resource_size_t iosize; |
| 137 | resource_size_t irq; |
| 138 | }; |
| 139 | struct platform_device *__init imx_add_imx_uart_1irq( |
| 140 | const struct imx_imx_uart_1irq_data *data, |
Uwe Kleine-König | 2db6823 | 2010-06-22 14:49:20 +0200 | [diff] [blame] | 141 | const struct imxuart_platform_data *pdata); |
| 142 | |
Uwe Kleine-König | e083000 | 2010-11-02 10:03:51 +0100 | [diff] [blame] | 143 | #include <mach/usb.h> |
| 144 | struct imx_imx_udc_data { |
| 145 | resource_size_t iobase; |
| 146 | resource_size_t iosize; |
| 147 | resource_size_t irq0; |
| 148 | resource_size_t irq1; |
| 149 | resource_size_t irq2; |
| 150 | resource_size_t irq3; |
| 151 | resource_size_t irq4; |
| 152 | resource_size_t irq5; |
| 153 | resource_size_t irq6; |
| 154 | }; |
| 155 | struct platform_device *__init imx_add_imx_udc( |
| 156 | const struct imx_imx_udc_data *data, |
| 157 | const struct imxusb_platform_data *pdata); |
| 158 | |
Uwe Kleine-König | 9bb39b3 | 2010-11-02 11:59:08 +0100 | [diff] [blame] | 159 | #include <mach/mx1_camera.h> |
| 160 | struct imx_mx1_camera_data { |
| 161 | resource_size_t iobase; |
| 162 | resource_size_t iosize; |
| 163 | resource_size_t irq; |
| 164 | }; |
| 165 | struct platform_device *__init imx_add_mx1_camera( |
| 166 | const struct imx_mx1_camera_data *data, |
| 167 | const struct mx1_camera_pdata *pdata); |
| 168 | |
Uwe Kleine-König | b2997cb | 2010-11-02 17:50:55 +0100 | [diff] [blame] | 169 | #include <mach/mx2_cam.h> |
| 170 | struct imx_mx2_camera_data { |
| 171 | resource_size_t iobasecsi; |
| 172 | resource_size_t iosizecsi; |
| 173 | resource_size_t irqcsi; |
| 174 | resource_size_t iobaseemmaprp; |
| 175 | resource_size_t iosizeemmaprp; |
| 176 | resource_size_t irqemmaprp; |
| 177 | }; |
| 178 | struct platform_device *__init imx_add_mx2_camera( |
| 179 | const struct imx_mx2_camera_data *data, |
| 180 | const struct mx2_camera_platform_data *pdata); |
| 181 | |
Uwe Kleine-König | 2eb42d5 | 2010-11-05 18:52:09 +0100 | [diff] [blame] | 182 | #include <mach/mxc_ehci.h> |
| 183 | struct imx_mxc_ehci_data { |
| 184 | int id; |
| 185 | resource_size_t iobase; |
| 186 | resource_size_t irq; |
| 187 | }; |
| 188 | struct platform_device *__init imx_add_mxc_ehci( |
| 189 | const struct imx_mxc_ehci_data *data, |
| 190 | const struct mxc_usbh_platform_data *pdata); |
| 191 | |
Uwe Kleine-König | 9d3d945 | 2010-11-05 17:26:09 +0100 | [diff] [blame] | 192 | #include <mach/mmc.h> |
| 193 | struct imx_mxc_mmc_data { |
| 194 | int id; |
| 195 | resource_size_t iobase; |
| 196 | resource_size_t irq; |
| 197 | resource_size_t dmareq; |
| 198 | }; |
| 199 | struct platform_device *__init imx_add_mxc_mmc( |
| 200 | const struct imx_mxc_mmc_data *data, |
| 201 | const struct imxmmc_platform_data *pdata); |
| 202 | |
Uwe Kleine-König | 66384ee | 2010-06-15 18:14:19 +0200 | [diff] [blame] | 203 | #include <mach/mxc_nand.h> |
Uwe Kleine-König | 00b57bf | 2010-08-23 11:25:52 +0200 | [diff] [blame] | 204 | struct imx_mxc_nand_data { |
Sascha Hauer | 63a7c6d | 2010-08-03 11:59:46 +0200 | [diff] [blame] | 205 | /* |
| 206 | * id is traditionally 0, but -1 is more appropriate. We use -1 for new |
| 207 | * machines but don't change existing devices as the nand device usually |
| 208 | * appears in the kernel command line to pass its partitioning. |
| 209 | */ |
| 210 | int id; |
Uwe Kleine-König | 00b57bf | 2010-08-23 11:25:52 +0200 | [diff] [blame] | 211 | resource_size_t iobase; |
| 212 | resource_size_t iosize; |
Sascha Hauer | 63a7c6d | 2010-08-03 11:59:46 +0200 | [diff] [blame] | 213 | resource_size_t axibase; |
Uwe Kleine-König | 00b57bf | 2010-08-23 11:25:52 +0200 | [diff] [blame] | 214 | resource_size_t irq; |
| 215 | }; |
| 216 | struct platform_device *__init imx_add_mxc_nand( |
| 217 | const struct imx_mxc_nand_data *data, |
| 218 | const struct mxc_nand_platform_data *pdata); |
Uwe Kleine-König | 0287073 | 2010-06-21 18:02:55 +0200 | [diff] [blame] | 219 | |
Uwe Kleine-König | bf182bc | 2010-11-05 15:01:16 +0100 | [diff] [blame] | 220 | struct imx_mxc_pwm_data { |
Uwe Kleine-König | 5f3d109 | 2010-11-10 22:15:45 +0100 | [diff] [blame] | 221 | int id; |
Uwe Kleine-König | bf182bc | 2010-11-05 15:01:16 +0100 | [diff] [blame] | 222 | resource_size_t iobase; |
Uwe Kleine-König | 5f3d109 | 2010-11-10 22:15:45 +0100 | [diff] [blame] | 223 | resource_size_t iosize; |
Uwe Kleine-König | bf182bc | 2010-11-05 15:01:16 +0100 | [diff] [blame] | 224 | resource_size_t irq; |
| 225 | }; |
| 226 | struct platform_device *__init imx_add_mxc_pwm( |
| 227 | const struct imx_mxc_pwm_data *data); |
| 228 | |
Uwe Kleine-König | ae71a56 | 2010-10-29 10:56:07 +0200 | [diff] [blame] | 229 | struct imx_mxc_w1_data { |
| 230 | resource_size_t iobase; |
| 231 | }; |
| 232 | struct platform_device *__init imx_add_mxc_w1( |
| 233 | const struct imx_mxc_w1_data *data); |
| 234 | |
Uwe Kleine-König | 0287073 | 2010-06-21 18:02:55 +0200 | [diff] [blame] | 235 | #include <mach/spi.h> |
Uwe Kleine-König | 35bab05 | 2010-09-09 21:02:02 +0200 | [diff] [blame] | 236 | struct imx_spi_imx_data { |
Uwe Kleine-König | ab56050 | 2010-09-09 21:02:02 +0200 | [diff] [blame] | 237 | const char *devid; |
Uwe Kleine-König | 35bab05 | 2010-09-09 21:02:02 +0200 | [diff] [blame] | 238 | int id; |
| 239 | resource_size_t iobase; |
| 240 | resource_size_t iosize; |
| 241 | int irq; |
| 242 | }; |
| 243 | struct platform_device *__init imx_add_spi_imx( |
| 244 | const struct imx_spi_imx_data *data, |
Uwe Kleine-König | 0287073 | 2010-06-21 18:02:55 +0200 | [diff] [blame] | 245 | const struct spi_imx_master *pdata); |
Wolfram Sang | 203a073 | 2010-10-11 12:55:21 +0200 | [diff] [blame] | 246 | |
| 247 | #include <mach/esdhc.h> |
Eric Bénard | c074512 | 2010-10-12 13:12:32 +0200 | [diff] [blame] | 248 | struct imx_esdhc_imx_data { |
| 249 | int id; |
| 250 | resource_size_t iobase; |
| 251 | resource_size_t irq; |
| 252 | }; |
| 253 | struct platform_device *__init imx_add_esdhc( |
| 254 | const struct imx_esdhc_imx_data *data, |
Wolfram Sang | 203a073 | 2010-10-11 12:55:21 +0200 | [diff] [blame] | 255 | const struct esdhc_platform_data *pdata); |