2010-06-15 17:31:02 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2009-2010 Pengutronix
|
|
|
|
* Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU General Public License version 2 as published by the
|
|
|
|
* Free Software Foundation.
|
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <linux/init.h>
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/dma-imx-sdma.h>
|
2010-06-15 17:31:02 +08:00
|
|
|
|
2011-06-06 00:07:55 +08:00
|
|
|
extern struct device mxc_aips_bus;
|
2011-06-22 22:41:30 +08:00
|
|
|
extern struct device mxc_ahb_bus;
|
2011-06-06 00:07:55 +08:00
|
|
|
|
2011-08-25 17:16:01 +08:00
|
|
|
static inline struct platform_device *imx_add_platform_device_dmamask(
|
2010-11-02 18:56:54 +08:00
|
|
|
const char *name, int id,
|
2010-06-15 17:31:02 +08:00
|
|
|
const struct resource *res, unsigned int num_resources,
|
2011-08-25 17:16:01 +08:00
|
|
|
const void *data, size_t size_data, u64 dmamask)
|
|
|
|
{
|
|
|
|
struct platform_device_info pdevinfo = {
|
|
|
|
.name = name,
|
|
|
|
.id = id,
|
|
|
|
.res = res,
|
|
|
|
.num_res = num_resources,
|
|
|
|
.data = data,
|
|
|
|
.size_data = size_data,
|
|
|
|
.dma_mask = dmamask,
|
|
|
|
};
|
|
|
|
return platform_device_register_full(&pdevinfo);
|
|
|
|
}
|
2010-11-02 18:56:54 +08:00
|
|
|
|
|
|
|
static inline struct platform_device *imx_add_platform_device(
|
|
|
|
const char *name, int id,
|
|
|
|
const struct resource *res, unsigned int num_resources,
|
|
|
|
const void *data, size_t size_data)
|
|
|
|
{
|
|
|
|
return imx_add_platform_device_dmamask(
|
|
|
|
name, id, res, num_resources, data, size_data, 0);
|
|
|
|
}
|
2010-06-16 00:14:19 +08:00
|
|
|
|
2010-10-06 18:00:18 +08:00
|
|
|
#include <linux/fec.h>
|
|
|
|
struct imx_fec_data {
|
2011-07-01 18:11:22 +08:00
|
|
|
const char *devid;
|
2010-10-06 18:00:18 +08:00
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_fec(
|
|
|
|
const struct imx_fec_data *data,
|
|
|
|
const struct fec_platform_data *pdata);
|
|
|
|
|
2010-07-22 17:45:34 +08:00
|
|
|
#include <linux/can/platform/flexcan.h>
|
2010-11-04 19:02:35 +08:00
|
|
|
struct imx_flexcan_data {
|
|
|
|
int id;
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t iosize;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_flexcan(
|
|
|
|
const struct imx_flexcan_data *data,
|
2010-07-22 17:45:34 +08:00
|
|
|
const struct flexcan_platform_data *pdata);
|
|
|
|
|
2010-11-10 00:52:14 +08:00
|
|
|
#include <linux/fsl_devices.h>
|
|
|
|
struct imx_fsl_usb2_udc_data {
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_fsl_usb2_udc(
|
|
|
|
const struct imx_fsl_usb2_udc_data *data,
|
|
|
|
const struct fsl_usb2_platform_data *pdata);
|
|
|
|
|
2010-10-23 22:12:46 +08:00
|
|
|
#include <linux/gpio_keys.h>
|
|
|
|
struct platform_device *__init imx_add_gpio_keys(
|
|
|
|
const struct gpio_keys_platform_data *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/usb-mx2.h>
|
2010-11-10 17:11:23 +08:00
|
|
|
struct imx_imx21_hcd_data {
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imx21_hcd(
|
|
|
|
const struct imx_imx21_hcd_data *data,
|
|
|
|
const struct mx21_usbh_platform_data *pdata);
|
|
|
|
|
2012-07-26 16:45:32 +08:00
|
|
|
struct imx_imx27_coda_data {
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t iosize;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imx27_coda(
|
|
|
|
const struct imx_imx27_coda_data *data);
|
|
|
|
|
2010-11-04 17:09:10 +08:00
|
|
|
struct imx_imx2_wdt_data {
|
2010-12-07 02:38:32 +08:00
|
|
|
int id;
|
2010-11-04 17:09:10 +08:00
|
|
|
resource_size_t iobase;
|
2010-11-11 23:58:50 +08:00
|
|
|
resource_size_t iosize;
|
2010-11-04 17:09:10 +08:00
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imx2_wdt(
|
|
|
|
const struct imx_imx2_wdt_data *data);
|
|
|
|
|
2010-11-11 18:57:21 +08:00
|
|
|
struct imx_imxdi_rtc_data {
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imxdi_rtc(
|
|
|
|
const struct imx_imxdi_rtc_data *data);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/video-imxfb.h>
|
2010-11-05 00:07:48 +08:00
|
|
|
struct imx_imx_fb_data {
|
|
|
|
resource_size_t iobase;
|
2010-11-11 22:32:21 +08:00
|
|
|
resource_size_t iosize;
|
2010-11-05 00:07:48 +08:00
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imx_fb(
|
|
|
|
const struct imx_imx_fb_data *data,
|
|
|
|
const struct imx_fb_platform_data *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/i2c-imx.h>
|
2010-09-21 18:13:34 +08:00
|
|
|
struct imx_imx_i2c_data {
|
2012-09-14 15:19:00 +08:00
|
|
|
const char *devid;
|
2010-09-21 18:13:34 +08:00
|
|
|
int id;
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t iosize;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imx_i2c(
|
|
|
|
const struct imx_imx_i2c_data *data,
|
2010-06-16 20:37:51 +08:00
|
|
|
const struct imxi2c_platform_data *pdata);
|
|
|
|
|
2010-11-10 16:58:56 +08:00
|
|
|
#include <linux/input/matrix_keypad.h>
|
|
|
|
struct imx_imx_keypad_data {
|
|
|
|
resource_size_t iobase;
|
2010-11-11 18:35:33 +08:00
|
|
|
resource_size_t iosize;
|
2010-11-10 16:58:56 +08:00
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imx_keypad(
|
|
|
|
const struct imx_imx_keypad_data *data,
|
|
|
|
const struct matrix_keymap_data *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/asoc-imx-ssi.h>
|
2010-08-25 23:37:45 +08:00
|
|
|
struct imx_imx_ssi_data {
|
|
|
|
int id;
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t iosize;
|
|
|
|
resource_size_t irq;
|
|
|
|
resource_size_t dmatx0;
|
|
|
|
resource_size_t dmarx0;
|
|
|
|
resource_size_t dmatx1;
|
|
|
|
resource_size_t dmarx1;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imx_ssi(
|
|
|
|
const struct imx_imx_ssi_data *data,
|
|
|
|
const struct imx_ssi_platform_data *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/serial-imx.h>
|
2010-08-11 04:57:24 +08:00
|
|
|
struct imx_imx_uart_3irq_data {
|
|
|
|
int id;
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t iosize;
|
|
|
|
resource_size_t irqrx;
|
|
|
|
resource_size_t irqtx;
|
|
|
|
resource_size_t irqrts;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imx_uart_3irq(
|
|
|
|
const struct imx_imx_uart_3irq_data *data,
|
2010-06-22 20:49:20 +08:00
|
|
|
const struct imxuart_platform_data *pdata);
|
2010-08-11 04:57:24 +08:00
|
|
|
|
|
|
|
struct imx_imx_uart_1irq_data {
|
|
|
|
int id;
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t iosize;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imx_uart_1irq(
|
|
|
|
const struct imx_imx_uart_1irq_data *data,
|
2010-06-22 20:49:20 +08:00
|
|
|
const struct imxuart_platform_data *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/usb-imx_udc.h>
|
2010-11-02 17:03:51 +08:00
|
|
|
struct imx_imx_udc_data {
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t iosize;
|
|
|
|
resource_size_t irq0;
|
|
|
|
resource_size_t irq1;
|
|
|
|
resource_size_t irq2;
|
|
|
|
resource_size_t irq3;
|
|
|
|
resource_size_t irq4;
|
|
|
|
resource_size_t irq5;
|
|
|
|
resource_size_t irq6;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_imx_udc(
|
|
|
|
const struct imx_imx_udc_data *data,
|
|
|
|
const struct imxusb_platform_data *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/video-mx3fb.h>
|
|
|
|
#include <linux/platform_data/camera-mx3.h>
|
2011-03-04 04:32:02 +08:00
|
|
|
struct imx_ipu_core_data {
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t synirq;
|
|
|
|
resource_size_t errirq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_ipu_core(
|
2012-06-13 14:07:31 +08:00
|
|
|
const struct imx_ipu_core_data *data);
|
2011-03-04 04:32:02 +08:00
|
|
|
struct platform_device *__init imx_alloc_mx3_camera(
|
|
|
|
const struct imx_ipu_core_data *data,
|
|
|
|
const struct mx3_camera_pdata *pdata);
|
|
|
|
struct platform_device *__init imx_add_mx3_sdc_fb(
|
|
|
|
const struct imx_ipu_core_data *data,
|
|
|
|
struct mx3fb_platform_data *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/camera-mx1.h>
|
2010-11-02 18:59:08 +08:00
|
|
|
struct imx_mx1_camera_data {
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t iosize;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_mx1_camera(
|
|
|
|
const struct imx_mx1_camera_data *data,
|
|
|
|
const struct mx1_camera_pdata *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/camera-mx2.h>
|
2010-11-03 00:50:55 +08:00
|
|
|
struct imx_mx2_camera_data {
|
|
|
|
resource_size_t iobasecsi;
|
|
|
|
resource_size_t iosizecsi;
|
|
|
|
resource_size_t irqcsi;
|
|
|
|
resource_size_t iobaseemmaprp;
|
|
|
|
resource_size_t iosizeemmaprp;
|
|
|
|
resource_size_t irqemmaprp;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_mx2_camera(
|
|
|
|
const struct imx_mx2_camera_data *data,
|
|
|
|
const struct mx2_camera_platform_data *pdata);
|
2012-01-13 17:31:57 +08:00
|
|
|
struct platform_device *__init imx_add_mx2_emmaprp(
|
|
|
|
const struct imx_mx2_camera_data *data);
|
2010-11-03 00:50:55 +08:00
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/usb-ehci-mxc.h>
|
2010-11-06 01:52:09 +08:00
|
|
|
struct imx_mxc_ehci_data {
|
|
|
|
int id;
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_mxc_ehci(
|
|
|
|
const struct imx_mxc_ehci_data *data,
|
|
|
|
const struct mxc_usbh_platform_data *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/mmc-mxcmmc.h>
|
2010-11-06 00:26:09 +08:00
|
|
|
struct imx_mxc_mmc_data {
|
|
|
|
int id;
|
|
|
|
resource_size_t iobase;
|
2010-11-12 18:10:55 +08:00
|
|
|
resource_size_t iosize;
|
2010-11-06 00:26:09 +08:00
|
|
|
resource_size_t irq;
|
|
|
|
resource_size_t dmareq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_mxc_mmc(
|
|
|
|
const struct imx_mxc_mmc_data *data,
|
|
|
|
const struct imxmmc_platform_data *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/mtd-mxc_nand.h>
|
2010-08-23 17:25:52 +08:00
|
|
|
struct imx_mxc_nand_data {
|
2012-09-15 13:34:09 +08:00
|
|
|
const char *devid;
|
2010-08-03 17:59:46 +08:00
|
|
|
/*
|
|
|
|
* id is traditionally 0, but -1 is more appropriate. We use -1 for new
|
|
|
|
* machines but don't change existing devices as the nand device usually
|
|
|
|
* appears in the kernel command line to pass its partitioning.
|
|
|
|
*/
|
|
|
|
int id;
|
2010-08-23 17:25:52 +08:00
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t iosize;
|
2010-08-03 17:59:46 +08:00
|
|
|
resource_size_t axibase;
|
2010-08-23 17:25:52 +08:00
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_mxc_nand(
|
|
|
|
const struct imx_mxc_nand_data *data,
|
|
|
|
const struct mxc_nand_platform_data *pdata);
|
2010-06-22 00:02:55 +08:00
|
|
|
|
2011-07-26 22:54:25 +08:00
|
|
|
struct imx_pata_imx_data {
|
|
|
|
resource_size_t iobase;
|
2011-08-24 04:18:06 +08:00
|
|
|
resource_size_t iosize;
|
2011-07-26 22:54:25 +08:00
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_pata_imx(
|
|
|
|
const struct imx_pata_imx_data *data);
|
|
|
|
|
2010-11-05 22:01:16 +08:00
|
|
|
struct imx_mxc_pwm_data {
|
2010-11-11 05:15:45 +08:00
|
|
|
int id;
|
2010-11-05 22:01:16 +08:00
|
|
|
resource_size_t iobase;
|
2010-11-11 05:15:45 +08:00
|
|
|
resource_size_t iosize;
|
2010-11-05 22:01:16 +08:00
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_mxc_pwm(
|
|
|
|
const struct imx_mxc_pwm_data *data);
|
|
|
|
|
2011-03-01 18:04:34 +08:00
|
|
|
/* mxc_rtc */
|
|
|
|
struct imx_mxc_rtc_data {
|
2012-09-15 14:26:14 +08:00
|
|
|
const char *devid;
|
2011-03-01 18:04:34 +08:00
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_mxc_rtc(
|
|
|
|
const struct imx_mxc_rtc_data *data);
|
|
|
|
|
|
|
|
/* mxc_w1 */
|
2010-10-29 16:56:07 +08:00
|
|
|
struct imx_mxc_w1_data {
|
|
|
|
resource_size_t iobase;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_mxc_w1(
|
|
|
|
const struct imx_mxc_w1_data *data);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/mmc-esdhc-imx.h>
|
2010-11-20 04:03:33 +08:00
|
|
|
struct imx_sdhci_esdhc_imx_data {
|
2011-06-30 09:24:26 +08:00
|
|
|
const char *devid;
|
2010-11-20 04:03:33 +08:00
|
|
|
int id;
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_sdhci_esdhc_imx(
|
|
|
|
const struct imx_sdhci_esdhc_imx_data *data,
|
|
|
|
const struct esdhc_platform_data *pdata);
|
|
|
|
|
2012-08-24 21:14:29 +08:00
|
|
|
#include <linux/platform_data/spi-imx.h>
|
2010-09-10 03:02:02 +08:00
|
|
|
struct imx_spi_imx_data {
|
2010-09-10 03:02:02 +08:00
|
|
|
const char *devid;
|
2010-09-10 03:02:02 +08:00
|
|
|
int id;
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t iosize;
|
|
|
|
int irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_spi_imx(
|
|
|
|
const struct imx_spi_imx_data *data,
|
2010-06-22 00:02:55 +08:00
|
|
|
const struct spi_imx_master *pdata);
|
2011-06-22 22:41:30 +08:00
|
|
|
|
2012-09-15 15:57:00 +08:00
|
|
|
struct platform_device *imx_add_imx_dma(resource_size_t iobase,
|
|
|
|
int irq, int irq_err);
|
2011-07-13 21:33:17 +08:00
|
|
|
struct platform_device *imx_add_imx_sdma(char *name,
|
2011-06-22 22:41:30 +08:00
|
|
|
resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
|
2011-09-28 15:41:53 +08:00
|
|
|
|
|
|
|
#include <linux/ahci_platform.h>
|
|
|
|
struct imx_ahci_imx_data {
|
|
|
|
const char *devid;
|
|
|
|
resource_size_t iobase;
|
|
|
|
resource_size_t irq;
|
|
|
|
};
|
|
|
|
struct platform_device *__init imx_add_ahci_imx(
|
|
|
|
const struct imx_ahci_imx_data *data,
|
|
|
|
const struct ahci_platform_data *pdata);
|