diff mbox

[1/3] ARM: tegra: paz00: add support for wakeup gpio key

Message ID 36b0283d86591d2bc64fe454676ae214732cdb54.1320088857.git.marvin24@gmx.de
State Superseded, archived
Headers show

Commit Message

Marc Dietrich Oct. 31, 2011, 7:58 p.m. UTC
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 <marvin24@gmx.de>
---
 arch/arm/mach-tegra/board-paz00.c |   27 +++++++++++++++++++++++++++
 arch/arm/mach-tegra/board-paz00.h |    3 +++
 2 files changed, 30 insertions(+), 0 deletions(-)

Comments

Stephen Warren Oct. 31, 2011, 8:13 p.m. UTC | #1
Marc Dietrich wrote at Monday, October 31, 2011 1:59 PM:
> 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 <marvin24@gmx.de>

Acked-by: Stephen Warren <swarren@nvidia.com>

(Feel free to include that tag in any future postings unless there are
significant changes that would merit my reviewing it again)
Marc Dietrich Oct. 31, 2011, 9:36 p.m. UTC | #2
On Monday 31 October 2011 13:13:15 Stephen Warren wrote:
> Marc Dietrich wrote at Monday, October 31, 2011 1:59 PM:
> > 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 <marvin24@gmx.de>
> 
> Acked-by: Stephen Warren <swarren@nvidia.com>
> 
> (Feel free to include that tag in any future postings unless there are
> significant changes that would merit my reviewing it again)

ok, will do for v4 ;-)

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 <linux/serial_8250.h>
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
+#include <linux/gpio_keys.h>
 #include <linux/pda_power.h>
 #include <linux/io.h>
+#include <linux/input.h>
 #include <linux/i2c.h>
 #include <linux/gpio.h>
 #include <linux/rfkill-gpio.h>
@@ -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