From patchwork Thu Apr 16 04:16:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 18460 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3G4GBUL015148 for ; Thu, 16 Apr 2009 04:16:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750914AbZDPEQK (ORCPT ); Thu, 16 Apr 2009 00:16:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750944AbZDPEQK (ORCPT ); Thu, 16 Apr 2009 00:16:10 -0400 Received: from mail.renesas.com ([202.234.163.13]:38503 "EHLO mail04.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750914AbZDPEQJ (ORCPT ); Thu, 16 Apr 2009 00:16:09 -0400 X-AuditID: ac140387-00000004000005fd-df-49e6b1077299 Received: from guardian01.idc.renesas.com ([172.20.8.200]) by mail04.idc.renesas.com (sendmail) with ESMTP id n3G4G73F023201; Thu, 16 Apr 2009 13:16:07 +0900 (JST) Received: (from root@localhost) by guardian01.idc.renesas.com with id n3G4G79x015899; Thu, 16 Apr 2009 13:16:07 +0900 (JST) Received: from mta04.idc.renesas.com (localhost [127.0.0.1]) by mta04.idc.renesas.com with ESMTP id n3G4G50g013234; Thu, 16 Apr 2009 13:16:05 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KI6008E0EIVXY@ims05.idc.renesas.com>; Thu, 16 Apr 2009 13:16:07 +0900 (JST) Date: Thu, 16 Apr 2009 13:16:07 +0900 From: Kuninori Morimoto Subject: [PATCH 4/6 v2] Add I2C support for SH7724 To: Paul Mundt Cc: SH-Linux Message-id: MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.1 (i386-mingw-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU) X-Brightmail-Tracker: AAAAAA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Signed-off-by: Kuninori Morimoto --- v1 -> v2 o fixed end of address in iicX_resource. o iicX_device and iicX_resource order was changed. arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 46 ++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index 471a736..a89a2bc 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c @@ -125,10 +125,56 @@ static struct platform_device usb0_device = { .resource = usb0_host_resources, }; +/* I2C0 */ +static struct resource iic0_resources[] = { + [0] = { + .name = "IIC0", + .start = 0x04470000, + .end = 0x04470018 - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 96, + .end = 99, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device iic0_device = { + .name = "i2c-sh_mobile", + .id = 0, /* "i2c0" clock */ + .num_resources = ARRAY_SIZE(iic0_resources), + .resource = iic0_resources, +}; + +/* I2C1 */ +static struct resource iic1_resources[] = { + [0] = { + .name = "IIC1", + .start = 0x04750000, + .end = 0x04750018 - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 92, + .end = 95, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device iic1_device = { + .name = "i2c-sh_mobile", + .id = 1, /* "i2c1" clock */ + .num_resources = ARRAY_SIZE(iic1_resources), + .resource = iic1_resources, +}; + static struct platform_device *sh7724_devices[] __initdata = { &sci_device, &rtc_device, &usb0_device, + &iic0_device, + &iic1_device, }; #define UPONCR0 0xa40501d4