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 53382b6..f79b55c 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 2917668..63de5cb 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 = {