summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/board-ventana.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c
index 4240f2804fb1..7e586302867b 100644
--- a/arch/arm/mach-tegra/board-ventana.c
+++ b/arch/arm/mach-tegra/board-ventana.c
@@ -52,6 +52,7 @@
#include "board-ventana.h"
#include "devices.h"
#include "gpio-names.h"
+#include "wakeups-t2.h"
static struct plat_serial8250_port debug_uart_platform_data[] = {
{
@@ -228,9 +229,20 @@ static struct gpio_keys_button ventana_keys[] = {
[6] = GPIO_KEY(KEY_MENU, PC7, 0),
};
+#define PMC_WAKE_STATUS 0x14
+
+static int ventana_wakeup_key(void)
+{
+ unsigned long status =
+ readl(IO_ADDRESS(TEGRA_PMC_BASE) + PMC_WAKE_STATUS);
+
+ return status & TEGRA_WAKE_GPIO_PV2 ? KEY_POWER : KEY_RESERVED;
+}
+
static struct gpio_keys_platform_data ventana_keys_platform_data = {
.buttons = ventana_keys,
.nbuttons = ARRAY_SIZE(ventana_keys),
+ .wakeup_key = ventana_wakeup_key,
};
static struct platform_device ventana_keys_device = {