summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/setup-r8a7778.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-06-03 22:11:58 -0700
committerSimon Horman <horms+renesas@verge.net.au>2013-06-11 17:32:23 +0900
commit46b9a092dacea4f30dbdfc58ca2c1ac4e97f6255 (patch)
tree18e04c64e2358a7ec4534cb037b79cc388847609 /arch/arm/mach-shmobile/setup-r8a7778.c
parent2ad3c8eb17ac7aed7fad870ba85acd4639cc8cdf (diff)
downloadop-kernel-dev-46b9a092dacea4f30dbdfc58ca2c1ac4e97f6255.zip
op-kernel-dev-46b9a092dacea4f30dbdfc58ca2c1ac4e97f6255.tar.gz
ARM: shmobile: r8a7778: add support I2C driver
Add a platform device for the r8a7778 I2C. Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r8a7778.c')
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7778.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index ce44fbb..6625a38 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -126,6 +126,31 @@ void __init r8a7778_sdhi_init(int id,
info, sizeof(*info));
}
+/* I2C */
+static struct resource i2c_resources[] __initdata = {
+ /* I2C0 */
+ DEFINE_RES_MEM(0xffc70000, 0x1000),
+ DEFINE_RES_IRQ(gic_iid(0x63)),
+ /* I2C1 */
+ DEFINE_RES_MEM(0xffc71000, 0x1000),
+ DEFINE_RES_IRQ(gic_iid(0x6e)),
+ /* I2C2 */
+ DEFINE_RES_MEM(0xffc72000, 0x1000),
+ DEFINE_RES_IRQ(gic_iid(0x6c)),
+ /* I2C3 */
+ DEFINE_RES_MEM(0xffc73000, 0x1000),
+ DEFINE_RES_IRQ(gic_iid(0x6d)),
+};
+
+void __init r8a7778_add_i2c_device(int id)
+{
+ BUG_ON(id < 0 || id > 3);
+
+ platform_device_register_simple(
+ "i2c-rcar", id,
+ i2c_resources + (2 * id), 2);
+}
+
void __init r8a7778_add_standard_devices(void)
{
int i;
OpenPOWER on IntegriCloud