From patchwork Sat Oct 22 20:16:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Dietrich X-Patchwork-Id: 121190 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 1F8BEB71C0 for ; Sun, 23 Oct 2011 07:18:10 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752765Ab1JVUSJ (ORCPT ); Sat, 22 Oct 2011 16:18:09 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:50405 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752449Ab1JVUSI (ORCPT ); Sat, 22 Oct 2011 16:18:08 -0400 Received: (qmail invoked by alias); 22 Oct 2011 20:18:07 -0000 Received: from pD9E5D2AA.dip0.t-ipconnect.de (EHLO localhost.localdomain) [217.229.210.170] by mail.gmx.net (mp067) with SMTP; 22 Oct 2011 22:18:07 +0200 X-Authenticated: #9962044 X-Provags-ID: V01U2FsdGVkX18LlGFPKpQLoD7CKya4Fe7g57sOuObFgybzl5scMx pDFqT29u1GhkC9 From: Marc Dietrich To: linux-tegra@vger.kernel.org Cc: Olof Johansson , Colin Cross , Marc Dietrich Subject: [PATCH 2/3] ARM: tegra: paz00: add support for wakeup gpio key Date: Sat, 22 Oct 2011 22:16:33 +0200 Message-Id: <41e637f863f255c23f6a6e4af79efeac0f81aff1.1319313020.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 | 29 ++++++++++++++++++++++++++++- arch/arm/mach-tegra/board-paz00.h | 3 +++ 2 files changed, 31 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c index 3f46b37..8a973d1 100644 --- a/arch/arm/mach-tegra/board-paz00.c +++ b/arch/arm/mach-tegra/board-paz00.c @@ -23,8 +23,11 @@ #include #include #include +#include +#include #include #include +#include #include #include @@ -36,7 +39,6 @@ #include #include #include -#include #include "board.h" #include "board-paz00.h" @@ -121,12 +123,37 @@ static struct nvec_platform_data nvec_pdata = { .gpio = TEGRA_NVEC_REQ, }; +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 7e978f3..e88f42b 100644 --- a/arch/arm/mach-tegra/board-paz00.h +++ b/arch/arm/mach-tegra/board-paz00.h @@ -35,6 +35,9 @@ /* EC */ #define TEGRA_NVEC_REQ TEGRA_GPIO_PV2 +/* WakeUp */ +#define TEGRA_GPIO_POWERKEY TEGRA_GPIO_PJ7 + void paz00_pinmux_init(void); #endif