From patchwork Wed Mar 9 20:20:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 622441 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 p29KLam7011347 for ; Wed, 9 Mar 2011 20:21:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751583Ab1CIUVr (ORCPT ); Wed, 9 Mar 2011 15:21:47 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:45276 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750818Ab1CIUVq (ORCPT ); Wed, 9 Mar 2011 15:21:46 -0500 Received: by mail-fx0-f46.google.com with SMTP id 17so872047fxm.19 for ; Wed, 09 Mar 2011 12:21:46 -0800 (PST) Received: by 10.223.95.199 with SMTP id e7mr5812643fan.82.1299702072161; Wed, 09 Mar 2011 12:21:12 -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 n15sm1131692fam.12.2011.03.09.12.21.09 (version=SSLv3 cipher=OTHER); Wed, 09 Mar 2011 12:21:11 -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 2/2] OMAP: Add gpio-keys support for Overo Date: Wed, 9 Mar 2011 12:20:55 -0800 Message-Id: <1299702055-12480-3-git-send-email-steve@sakoman.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1299702055-12480-1-git-send-email-steve@sakoman.com> References: <1299702055-12480-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]); Wed, 09 Mar 2011 20:21:48 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index adc204b..f39d983 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) { @@ -699,6 +740,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);