From patchwork Tue Oct 1 08:12:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2968781 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0A551BFF0B for ; Tue, 1 Oct 2013 08:14:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE907203DD for ; Tue, 1 Oct 2013 08:14:23 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FB2420303 for ; Tue, 1 Oct 2013 08:14:19 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VQv4Z-0002e3-9k; Tue, 01 Oct 2013 08:12:48 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VQv4G-0002ii-2x; Tue, 01 Oct 2013 08:12:28 +0000 Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VQv43-0002el-K0 for linux-arm-kernel@lists.infradead.org; Tue, 01 Oct 2013 08:12:16 +0000 Received: by mail-pd0-f171.google.com with SMTP id g10so6856169pdj.2 for ; Tue, 01 Oct 2013 01:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=kwAeakZUokFOHageKY0wQld1K3T3KXW2YFZj6OUOpNI=; b=pZdqQtKlNFHXGm9wPiN6F0KGQ+R5R/I32fAWYPIXmgjwCzk7pC7xB5wSQjkA2fnAdT +A50G9NuROk+MxGRt2XjynJO03FdpMSrtuZRHwGdQ+KhDr99BymuFByF8BWZRn1srRvs vQt3ljSppa1I6Gs+8bY2/OC0MXBXEZbt2ynuiujnN56odWHMCFeoCLrSpvXgnXlUXctH 6yi8LgV4B3TMxhl33AzFxXFJKpPW69k1gSIl/IMJZ9BSzggI5SM/YdS+lZ7E/fq5Wq/S TZJ2pbt+bsbDLiBd7nTKofvdDZZ97VOD3RxKEd0RpsdqWqoV1vZwhw7LXWBfQ1rxGM1j BZhQ== X-Received: by 10.66.250.47 with SMTP id yz15mr7495886pac.154.1380615114147; Tue, 01 Oct 2013 01:11:54 -0700 (PDT) Received: from [127.0.0.1] (ac230065.ppp.asahi-net.or.jp. [183.77.230.65]) by mx.google.com with ESMTPSA id ia5sm5266888pbc.42.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Oct 2013 01:11:53 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Tue, 01 Oct 2013 17:12:19 +0900 Message-Id: <20131001081219.4136.26850.sendpatchset@w520> In-Reply-To: <20131001081143.4136.46925.sendpatchset@w520> References: <20131001081143.4136.46925.sendpatchset@w520> Subject: [PATCH 03/10] ARM: shmobile: r8a7791 IRQC platform device support X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131001_041215_783694_5B8F0917 X-CRM114-Status: GOOD ( 10.91 ) X-Spam-Score: 1.4 (+) Cc: ryo.kataoka.wt@renesas.com, kuninori.morimoto.gx@renesas.com, arnd@arndb.de, Magnus Damm , hisashi.nakamura.ak@renesas.com, horms@verge.net.au, yoshikazu.fujikawa.ue@renesas.com, olof@lixom.net, khilman@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Add a platform device for the r8a7791 IRQC hardware driving IRQ pins IRQ0 to IRQ9. The Linux interrupt number is statically assigned to allow board code written in C to make use of static interrupt numbers. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/setup-r8a7791.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) --- 0002/arch/arm/mach-shmobile/setup-r8a7791.c +++ work/arch/arm/mach-shmobile/setup-r8a7791.c 2013-10-01 16:45:32.000000000 +0900 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -109,6 +110,31 @@ static const struct resource cmt00_resou &cmt##idx##_platform_data, \ sizeof(struct sh_timer_config)) +static struct renesas_irqc_config irqc0_data = { + .irq_base = irq_pin(0), /* IRQ0 -> IRQ9 */ +}; + +static struct resource irqc0_resources[] = { + DEFINE_RES_MEM(0xe61c0000, 0x200), /* IRQC Event Detector Block_0 */ + DEFINE_RES_IRQ(gic_spi(0)), /* IRQ0 */ + DEFINE_RES_IRQ(gic_spi(1)), /* IRQ1 */ + DEFINE_RES_IRQ(gic_spi(2)), /* IRQ2 */ + DEFINE_RES_IRQ(gic_spi(3)), /* IRQ3 */ + DEFINE_RES_IRQ(gic_spi(12)), /* IRQ4 */ + DEFINE_RES_IRQ(gic_spi(13)), /* IRQ5 */ + DEFINE_RES_IRQ(gic_spi(14)), /* IRQ6 */ + DEFINE_RES_IRQ(gic_spi(15)), /* IRQ7 */ + DEFINE_RES_IRQ(gic_spi(16)), /* IRQ8 */ + DEFINE_RES_IRQ(gic_spi(17)), /* IRQ9 */ +}; + +#define r8a7791_register_irqc(idx) \ + platform_device_register_resndata(&platform_bus, "renesas_irqc", \ + idx, irqc##idx##_resources, \ + ARRAY_SIZE(irqc##idx##_resources), \ + &irqc##idx##_data, \ + sizeof(struct renesas_irqc_config)) + void __init r8a7791_add_dt_devices(void) { r8a7791_register_scif(SCIFA0); @@ -132,6 +158,7 @@ void __init r8a7791_add_dt_devices(void) void __init r8a7791_add_standard_devices(void) { r8a7791_add_dt_devices(); + r8a7791_register_irqc(0); } void __init r8a7791_init_early(void)