[ARM] MX2: Add I2C devices / resources
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 28 Jan 2009 12:26:56 +0000 (13:26 +0100)
committerSascha Hauer <s.hauer@pengutronix.de>
Fri, 13 Mar 2009 09:34:12 +0000 (10:34 +0100)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mx2/devices.c
arch/arm/mach-mx2/devices.h

index bef418e0e60ec7b51104a26b7033f66ecb10e39f..7d12c2c4108f057581f3e70eb3a0a93b2fdcc556 100644 (file)
@@ -281,6 +281,48 @@ struct platform_device mxc_fec_device = {
 };
 #endif
 
+static struct resource mxc_i2c_1_resources[] = {
+       [0] = {
+               .start  = I2C_BASE_ADDR,
+               .end    = I2C_BASE_ADDR + 0x0fff,
+               .flags  = IORESOURCE_MEM
+       },
+       [1] = {
+               .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_i2c_1_resources),
+       .resource = mxc_i2c_1_resources
+};
+
+#ifdef CONFIG_MACH_MX27
+static struct resource mxc_i2c_2_resources[] = {
+       [0] = {
+               .start  = I2C2_BASE_ADDR,
+               .end    = I2C2_BASE_ADDR + 0x0fff,
+               .flags  = IORESOURCE_MEM
+       },
+       [1] = {
+               .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_i2c_2_resources),
+       .resource = mxc_i2c_2_resources
+};
+#endif
+
 static struct resource mxc_pwm_resources[] = {
        [0] = {
                .start  = PWM_BASE_ADDR,
index 94a241419af7476a7ae43ec71cf96dd5d78292b8..271ab1e698262ad8634b14e738b8873213070839 100644 (file)
@@ -16,3 +16,5 @@ extern struct platform_device mxc_nand_device;
 extern struct platform_device mxc_fb_device;
 extern struct platform_device mxc_fec_device;
 extern struct platform_device mxc_pwm_device;
+extern struct platform_device mxc_i2c_device0;
+extern struct platform_device mxc_i2c_device1;