ARM: shmobile: r8a7779: add I2C driver support
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 11 Oct 2012 02:56:51 +0000 (19:56 -0700)
committerSimon Horman <horms@verge.net.au>
Tue, 6 Nov 2012 04:47:23 +0000 (13:47 +0900)
This patch enable R-Car I2C driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
arch/arm/configs/marzen_defconfig
arch/arm/mach-shmobile/setup-r8a7779.c

index 53382b6c8bb43345ae75b8f1ea39ab509d161980..f79b55c512d0638a5386db30a6b1ab21c59ee1d6 100644 (file)
@@ -69,6 +69,8 @@ CONFIG_SERIAL_SH_SCI=y
 CONFIG_SERIAL_SH_SCI_NR_UARTS=6
 CONFIG_SERIAL_SH_SCI_CONSOLE=y
 # CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_I2C_RCAR=y
 CONFIG_GPIO_SYSFS=y
 # CONFIG_HWMON is not set
 CONFIG_THERMAL=y
index 2917668f0091c1042a70e512f50c12bacdb3ebb2..63de5cb28e4a56779b79f7451ea8585c5dc76eeb 100644 (file)
@@ -229,6 +229,79 @@ static struct platform_device tmu01_device = {
        .num_resources  = ARRAY_SIZE(tmu01_resources),
 };
 
+/* I2C */
+static struct resource rcar_i2c0_res[] = {
+       {
+               .start  = 0xffc70000,
+               .end    = 0xffc70fff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = gic_spi(79),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device i2c0_device = {
+       .name           = "i2c-rcar",
+       .id             = 0,
+       .resource       = rcar_i2c0_res,
+       .num_resources  = ARRAY_SIZE(rcar_i2c0_res),
+};
+
+static struct resource rcar_i2c1_res[] = {
+       {
+               .start  = 0xffc71000,
+               .end    = 0xffc71fff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = gic_spi(82),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device i2c1_device = {
+       .name           = "i2c-rcar",
+       .id             = 1,
+       .resource       = rcar_i2c1_res,
+       .num_resources  = ARRAY_SIZE(rcar_i2c1_res),
+};
+
+static struct resource rcar_i2c2_res[] = {
+       {
+               .start  = 0xffc72000,
+               .end    = 0xffc72fff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = gic_spi(80),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device i2c2_device = {
+       .name           = "i2c-rcar",
+       .id             = 2,
+       .resource       = rcar_i2c2_res,
+       .num_resources  = ARRAY_SIZE(rcar_i2c2_res),
+};
+
+static struct resource rcar_i2c3_res[] = {
+       {
+               .start  = 0xffc73000,
+               .end    = 0xffc73fff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = gic_spi(81),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device i2c3_device = {
+       .name           = "i2c-rcar",
+       .id             = 3,
+       .resource       = rcar_i2c3_res,
+       .num_resources  = ARRAY_SIZE(rcar_i2c3_res),
+};
+
 static struct platform_device *r8a7779_early_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
@@ -238,6 +311,10 @@ static struct platform_device *r8a7779_early_devices[] __initdata = {
        &scif5_device,
        &tmu00_device,
        &tmu01_device,
+       &i2c0_device,
+       &i2c1_device,
+       &i2c2_device,
+       &i2c3_device,
 };
 
 static struct platform_device *r8a7779_late_devices[] __initdata = {