From patchwork Mon Oct 31 19:58:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Dietrich X-Patchwork-Id: 122931 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 02F8DB6F88 for ; Tue, 1 Nov 2011 06:59:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751695Ab1JaT73 (ORCPT ); Mon, 31 Oct 2011 15:59:29 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:37825 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755164Ab1JaT72 (ORCPT ); Mon, 31 Oct 2011 15:59:28 -0400 Received: (qmail invoked by alias); 31 Oct 2011 19:59:27 -0000 Received: from pD9E5C411.dip0.t-ipconnect.de (EHLO localhost.localdomain) [217.229.196.17] by mail.gmx.net (mp049) with SMTP; 31 Oct 2011 20:59:27 +0100 X-Authenticated: #9962044 X-Provags-ID: V01U2FsdGVkX19/eJBOypd/YNy1BZp/CT41NsSu/GgS9kMWV+vbDn WX7QJxNgt8tzdq From: Marc Dietrich To: linux-tegra@vger.kernel.org Cc: Olof Johansson , Colin Cross , Stephen Warren , linux-arm-kernel , Marc Dietrich Subject: [PATCH 1/3] ARM: tegra: paz00: add support for wakeup gpio key Date: Mon, 31 Oct 2011 20:58:53 +0100 Message-Id: <36b0283d86591d2bc64fe454676ae214732cdb54.1320088857.git.marvin24@gmx.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: References: In-Reply-To: References: X-Y-GMX-Trusted: 0 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org This adds support for a wakeup gpio which is connected to the embedded controller. This will be used later on for wakeup from suspend. Signed-off-by: Marc Dietrich Acked-by: Stephen Warren --- arch/arm/mach-tegra/board-paz00.c | 27 +++++++++++++++++++++++++++ arch/arm/mach-tegra/board-paz00.h | 3 +++ 2 files changed, 30 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c index 55c55ba..799e420 100644 --- a/arch/arm/mach-tegra/board-paz00.c +++ b/arch/arm/mach-tegra/board-paz00.c @@ -23,8 +23,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -114,12 +116,37 @@ static struct platform_device leds_gpio = { }, }; +static struct gpio_keys_button paz00_gpio_keys_buttons[] = { + { + .code = KEY_POWER, + .gpio = TEGRA_GPIO_POWERKEY, + .active_low = 1, + .desc = "Power", + .type = EV_KEY, + .wakeup = 1, + }, +}; + +static struct gpio_keys_platform_data paz00_gpio_keys = { + .buttons = paz00_gpio_keys_buttons, + .nbuttons = ARRAY_SIZE(paz00_gpio_keys_buttons), +}; + +static struct platform_device gpio_keys_device = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = &paz00_gpio_keys, + }, +}; + static struct platform_device *paz00_devices[] __initdata = { &debug_uart, &tegra_sdhci_device4, &tegra_sdhci_device1, &wifi_rfkill_device, &leds_gpio, + &gpio_keys_device, }; static void paz00_i2c_init(void) diff --git a/arch/arm/mach-tegra/board-paz00.h b/arch/arm/mach-tegra/board-paz00.h index 8aff06e..ffa83f5 100644 --- a/arch/arm/mach-tegra/board-paz00.h +++ b/arch/arm/mach-tegra/board-paz00.h @@ -32,6 +32,9 @@ #define TEGRA_WIFI_RST TEGRA_GPIO_PD1 #define TEGRA_WIFI_LED TEGRA_GPIO_PD0 +/* WakeUp */ +#define TEGRA_GPIO_POWERKEY TEGRA_GPIO_PJ7 + void paz00_pinmux_init(void); #endif