From patchwork Thu May 13 01:07:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 99164 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4D181Bc031775 for ; Thu, 13 May 2010 01:08:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757874Ab0EMBIB (ORCPT ); Wed, 12 May 2010 21:08:01 -0400 Received: from mail.renesas.com ([202.234.163.13]:61052 "EHLO mail07.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757839Ab0EMBIA (ORCPT ); Wed, 12 May 2010 21:08:00 -0400 X-AuditID: ac14038b-0000000900000202-47-4beb50ea7987 Received: from guardian02.idc.renesas.com ([172.20.8.201]) by mail07.idc.renesas.com (sendmail) with ESMTP id o4D17s1H016057; Thu, 13 May 2010 10:07:54 +0900 (JST) Received: (from root@localhost) by guardian02.idc.renesas.com with id o4D17rMW021830; Thu, 13 May 2010 10:07:53 +0900 (JST) Received: from mta06.idc.renesas.com (localhost [127.0.0.1]) by mta06.idc.renesas.com with ESMTP id o4D17sv1029951; Thu, 13 May 2010 10:07:54 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0L2C0033H356HK@ims05.idc.renesas.com>; Thu, 13 May 2010 10:07:54 +0900 (JST) Date: Thu, 13 May 2010 10:07:54 +0900 (JST) Date-warning: Date header was inserted by ims05.idc.renesas.com From: Kuninori Morimoto Subject: [PATCH] ARM: mach-shmobile: g3evm: Add IrDA support To: Paul Mundt Cc: Linux-SH 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.3 (i386-msvc-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.02-dev (RINDOU) (2009-06-17 Rev.4261) X-Brightmail-Tracker: AAAAAA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 13 May 2010 01:08:02 +0000 (UTC) diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c index 9247503..19b3bf3 100644 --- a/arch/arm/mach-shmobile/board-g3evm.c +++ b/arch/arm/mach-shmobile/board-g3evm.c @@ -38,6 +38,14 @@ #include #include +/* + * IrDA + * + * S67: 5bit : ON power + * : 6bit : ON remote control + * OFF IrDA + */ + static struct mtd_partition nor_flash_partitions[] = { { .name = "loader", @@ -209,11 +217,30 @@ static struct platform_device nand_flash_device = { }, }; +static struct resource irda_resources[] = { + [0] = { + .start = 0xE6D00000, + .end = 0xE6D01FD4 - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 20, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device irda_device = { + .name = "sh_irda", + .resource = irda_resources, + .num_resources = ARRAY_SIZE(irda_resources), +}; + static struct platform_device *g3evm_devices[] __initdata = { &nor_flash_device, &usb_host_device, &keysc_device, &nand_flash_device, + &irda_device, }; static struct map_desc g3evm_io_desc[] __initdata = { @@ -318,6 +345,12 @@ static void __init g3evm_init(void) /* FOE, FCDE, FSC on dedicated pins */ __raw_writel(__raw_readl(0xe6158048) & ~(1 << 15), 0xe6158048); + /* IrDA */ + gpio_request(GPIO_FN_IRDA_OUT, NULL); + gpio_request(GPIO_FN_IRDA_IN, NULL); + gpio_request(GPIO_FN_IRDA_FIRSEL, NULL); + set_irq_type(20, IRQ_TYPE_LEVEL_LOW); + sh7367_add_standard_devices(); platform_add_devices(g3evm_devices, ARRAY_SIZE(g3evm_devices));