From patchwork Tue Oct 8 03:40:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 3000241 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 0EAF5BF924 for ; Tue, 8 Oct 2013 03:42:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F7042018C for ; Tue, 8 Oct 2013 03:42:53 +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 2D78A201BA for ; Tue, 8 Oct 2013 03:42:52 +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 1VTOAA-0005A2-Lr; Tue, 08 Oct 2013 03:40:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTO9W-0008Pk-Jb; Tue, 08 Oct 2013 03:40:06 +0000 Received: from mail-pb0-x22b.google.com ([2607:f8b0:400e:c01::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTO9S-0008NF-QL for linux-arm-kernel@lists.infradead.org; Tue, 08 Oct 2013 03:40:03 +0000 Received: by mail-pb0-f43.google.com with SMTP id md4so7981574pbc.16 for ; Mon, 07 Oct 2013 20:39:41 -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=0FiJR5+1snhr9AJCsqabKSe42uslkqpoOCxPv3y4wqY=; b=lUSbqzZDc7VMFqcHaHzm+WAaEPy7ieYYTAglxMMp1931rnLQRuOPBDTmkVFv7eqaEM +uKJQk0A+qy+4btey3414XSRwn/MsANMnU7BFnmXMIFhxvqMfyN3FYg3PvBqNl7lIpeU DhO5ZWpGrLfou6RXPPB1UQPpUh8yicZpNeiygWHEesZP4Cs9xPAcXRG9ToNfuN6Jr6sk cvD4xXQf/TmJSd+w43VOnFDY3syFKbOgaJvMuhkSrDpuX2GHBWXRtzfUI9WlSasf67S+ /PHxh006HQDK5dmwoy1BUZCWFrFICkwlXmdvzXyXwnyKlg/rqD8P3m3bs3hqiUmOcO6J ymJQ== X-Received: by 10.68.223.161 with SMTP id qv1mr34792718pbc.79.1381203581256; Mon, 07 Oct 2013 20:39:41 -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 j9sm43581474paj.18.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 20:39:40 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Tue, 08 Oct 2013 12:40:08 +0900 Message-Id: <20131008034008.20455.77595.sendpatchset@w520> In-Reply-To: <20131008033851.20455.68845.sendpatchset@w520> References: <20131008033851.20455.68845.sendpatchset@w520> Subject: [PATCH 08/08] ARM: shmobile: Add Koelsch SW2 support X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131007_234003_045074_5C123D6D X-CRM114-Status: UNSURE ( 9.41 ) 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, linux-arm-kernel@lists.infradead.org, olof@lixom.net, khilman@linaro.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 Enable Koelsch GPIO switch for GPIO input and IRQ testing purpose. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/board-koelsch.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) --- 0012/arch/arm/mach-shmobile/board-koelsch.c +++ work/arch/arm/mach-shmobile/board-koelsch.c 2013-10-07 14:05:22.000000000 +0900 @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include +#include #include #include #include @@ -51,6 +54,22 @@ static const struct gpio_led_platform_da .num_leds = ARRAY_SIZE(koelsch_leds), }; +/* GPIO KEY */ +#define GPIO_KEY(c, g, d, ...) \ + { .code = c, .gpio = g, .desc = d, .active_low = 1 } + +static struct gpio_keys_button gpio_buttons[] = { + GPIO_KEY(KEY_4, RCAR_GP_PIN(5, 3), "SW2-pin4"), + GPIO_KEY(KEY_3, RCAR_GP_PIN(5, 2), "SW2-pin3"), + GPIO_KEY(KEY_2, RCAR_GP_PIN(5, 1), "SW2-pin2"), + GPIO_KEY(KEY_1, RCAR_GP_PIN(5, 0), "SW2-pin1"), +}; + +static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = { + .buttons = gpio_buttons, + .nbuttons = ARRAY_SIZE(gpio_buttons), +}; + static void __init koelsch_add_standard_devices(void) { r8a7791_clock_init(); @@ -59,6 +78,9 @@ static void __init koelsch_add_standard_ platform_device_register_data(&platform_bus, "leds-gpio", -1, &koelsch_leds_pdata, sizeof(koelsch_leds_pdata)); + platform_device_register_data(&platform_bus, "gpio-keys", -1, + &koelsch_keys_pdata, + sizeof(koelsch_keys_pdata)); } static const char * const koelsch_boards_compat_dt[] __initconst = {