From patchwork Tue Oct 8 03:39:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 3000231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 860539F243 for ; Tue, 8 Oct 2013 03:41:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0B8C2011E for ; Tue, 8 Oct 2013 03:41:43 +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 BF00220113 for ; Tue, 8 Oct 2013 03:41:42 +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 1VTO9Y-0004kn-12; Tue, 08 Oct 2013 03:40:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTO93-0008My-92; Tue, 08 Oct 2013 03:39:37 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTO90-0008L0-4K for linux-arm-kernel@lists.infradead.org; Tue, 08 Oct 2013 03:39:34 +0000 Received: by mail-pa0-f41.google.com with SMTP id bj1so8249714pad.0 for ; Mon, 07 Oct 2013 20:39:12 -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=jqqmIDMx/cVV0LZ1pi/Z4V3Pn2duOyqK3lroi8827y0=; b=az2ipfcPM10uqXbQ14bVi4WSeSoKY/gDelUl3FeSEgHiJ1fGWIeklDOIkhFJpPW1m0 d+UE/GxGIbvGwvanHuZw8/rRNNUEDKhD8EAkQpIQRlsDhl1twuoiw1GXcV2ivVmNz8E6 SSTB7ayMl7PUsvZ/JogrXKWCPR1GJsBc/xO63Ild5ToA3ko8bEqCGJ1YWZ/FhuGJ4bcC BhFxGc/3/tQDCvVdQn75oxuLDYEUsewEfnkkE3tIXKLL5lkHgayBoYfOqijeTVlciAY7 hYNM+bWDk2LX8cJ5ujOqktXfCue+OrWAGqSsH8Lqs2Vvim+W9QmdJ5Ht4yAYZuUgmOna hIqQ== X-Received: by 10.66.152.102 with SMTP id ux6mr916649pab.79.1381203552388; Mon, 07 Oct 2013 20:39:12 -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 fl3sm43610067pad.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 20:39:11 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Tue, 08 Oct 2013 12:39:39 +0900 Message-Id: <20131008033939.20455.66118.sendpatchset@w520> In-Reply-To: <20131008033851.20455.68845.sendpatchset@w520> References: <20131008033851.20455.68845.sendpatchset@w520> Subject: [PATCH 05/08] ARM: shmobile: r8a7791 GPIO platform device support X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131007_233934_337432_0086CAF6 X-CRM114-Status: UNSURE ( 9.00 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) 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=-4.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 GPIO controller platform devices for the r8a7791 SoC. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/setup-r8a7791.c | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) --- 0003/arch/arm/mach-shmobile/setup-r8a7791.c +++ work/arch/arm/mach-shmobile/setup-r8a7791.c 2013-10-04 18:55:09.000000000 +0900 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -39,9 +40,48 @@ static const struct resource pfc_resourc platform_device_register_simple("pfc-r8a7791", -1, pfc_resources, \ ARRAY_SIZE(pfc_resources)) +#define R8A7791_GPIO(idx, base, nr) \ +static const struct resource r8a7791_gpio##idx##_resources[] __initconst = { \ + DEFINE_RES_MEM((base), 0x50), \ + DEFINE_RES_IRQ(gic_spi(4 + (idx))), \ +}; \ + \ +static const struct gpio_rcar_config \ +r8a7791_gpio##idx##_platform_data __initconst = { \ + .gpio_base = 32 * (idx), \ + .irq_base = 0, \ + .number_of_pins = (nr), \ + .pctl_name = "pfc-r8a7791", \ + .has_both_edge_trigger = 1, \ +}; \ + +R8A7791_GPIO(0, 0xe6050000, 32); +R8A7791_GPIO(1, 0xe6051000, 32); +R8A7791_GPIO(2, 0xe6052000, 32); +R8A7791_GPIO(3, 0xe6053000, 32); +R8A7791_GPIO(4, 0xe6054000, 32); +R8A7791_GPIO(5, 0xe6055000, 32); +R8A7791_GPIO(6, 0xe6055400, 32); +R8A7791_GPIO(7, 0xe6055800, 26); + +#define r8a7791_register_gpio(idx) \ + platform_device_register_resndata(&platform_bus, "gpio_rcar", idx, \ + r8a7791_gpio##idx##_resources, \ + ARRAY_SIZE(r8a7791_gpio##idx##_resources), \ + &r8a7791_gpio##idx##_platform_data, \ + sizeof(r8a7791_gpio##idx##_platform_data)) + void __init r8a7791_pinmux_init(void) { r8a7791_register_pfc(); + r8a7791_register_gpio(0); + r8a7791_register_gpio(1); + r8a7791_register_gpio(2); + r8a7791_register_gpio(3); + r8a7791_register_gpio(4); + r8a7791_register_gpio(5); + r8a7791_register_gpio(6); + r8a7791_register_gpio(7); } #define SCIF_COMMON(scif_type, baseaddr, irq) \