From patchwork Thu Mar 10 00:08:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 622871 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2A08WVm001983 for ; Thu, 10 Mar 2011 00:08:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753167Ab1CJAIW (ORCPT ); Wed, 9 Mar 2011 19:08:22 -0500 Received: from mail-vw0-f46.google.com ([209.85.212.46]:65211 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753046Ab1CJAIU (ORCPT ); Wed, 9 Mar 2011 19:08:20 -0500 Received: by mail-vw0-f46.google.com with SMTP id 12so1043567vws.19 for ; Wed, 09 Mar 2011 16:08:19 -0800 (PST) Received: by 10.52.68.18 with SMTP id r18mr8054272vdt.82.1299715699034; Wed, 09 Mar 2011 16:08:19 -0800 (PST) Received: from localhost.localdomain (static-74-41-60-154.dsl1.pco.ca.frontiernet.net [74.41.60.154]) by mx.google.com with ESMTPS id bl17sm490623vdb.24.2011.03.09.16.08.17 (version=SSLv3 cipher=OTHER); Wed, 09 Mar 2011 16:08:18 -0800 (PST) From: Steve Sakoman To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: tomi.valkeinen@ti.com, Steve Sakoman Subject: [PATCH v2 2/2] OMAP: Add gpio-keys support for Overo Date: Wed, 9 Mar 2011 16:08:06 -0800 Message-Id: <1299715686-3920-3-git-send-email-steve@sakoman.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1299715686-3920-1-git-send-email-steve@sakoman.com> References: <1299715686-3920-1-git-send-email-steve@sakoman.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 10 Mar 2011 00:08:33 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index e694ebd..1e17061 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -519,6 +519,47 @@ static void __init overo_init_led(void) static inline void __init overo_init_led(void) { return; } #endif +#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) +#include +#include + +static struct gpio_keys_button gpio_buttons[] = { + { + .code = BTN_0, + .gpio = 23, + .desc = "button0", + .wakeup = 1, + }, + { + .code = BTN_1, + .gpio = 14, + .desc = "button1", + .wakeup = 1, + }, +}; + +static struct gpio_keys_platform_data gpio_keys_pdata = { + .buttons = gpio_buttons, + .nbuttons = ARRAY_SIZE(gpio_buttons), +}; + +static struct platform_device gpio_keys_device = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = &gpio_keys_pdata, + }, +}; + +static void __init overo_init_keys(void) +{ + platform_device_register(&gpio_keys_device); +} + +#else +static inline void __init overo_init_keys(void) { return; } +#endif + static int overo_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { @@ -701,6 +742,7 @@ static void __init overo_init(void) overo_init_smsc911x(); overo_display_init(); overo_init_led(); + overo_init_keys(); /* Ensure SDRC pins are mux'd for self-refresh */ omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);