mx31: rework of iomux support
[linux-2.6-microblaze.git] / arch / arm / mach-mx3 / devices.c
index 1d46cb4..c48a341 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/serial.h>
 #include <linux/gpio.h>
 #include <mach/hardware.h>
+#include <mach/irqs.h>
 #include <mach/imx-uart.h>
 
 static struct resource uart0[] = {
@@ -179,3 +180,63 @@ struct platform_device mxc_nand_device = {
        .num_resources = ARRAY_SIZE(mxc_nand_resources),
        .resource = mxc_nand_resources,
 };
+
+static struct resource mxc_i2c0_resources[] = {
+       {
+               .start = I2C_BASE_ADDR,
+               .end = I2C_BASE_ADDR + SZ_4K - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = MXC_INT_I2C,
+               .end = MXC_INT_I2C,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device mxc_i2c_device0 = {
+       .name = "imx-i2c",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(mxc_i2c0_resources),
+       .resource = mxc_i2c0_resources,
+};
+
+static struct resource mxc_i2c1_resources[] = {
+       {
+               .start = I2C2_BASE_ADDR,
+               .end = I2C2_BASE_ADDR + SZ_4K - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = MXC_INT_I2C2,
+               .end = MXC_INT_I2C2,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device mxc_i2c_device1 = {
+       .name = "imx-i2c",
+       .id = 1,
+       .num_resources = ARRAY_SIZE(mxc_i2c1_resources),
+       .resource = mxc_i2c1_resources,
+};
+
+static struct resource mxc_i2c2_resources[] = {
+       {
+               .start = I2C3_BASE_ADDR,
+               .end = I2C3_BASE_ADDR + SZ_4K - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = MXC_INT_I2C3,
+               .end = MXC_INT_I2C3,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device mxc_i2c_device2 = {
+       .name = "imx-i2c",
+       .id = 2,
+       .num_resources = ARRAY_SIZE(mxc_i2c2_resources),
+       .resource = mxc_i2c2_resources,
+};