summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-ventana.c
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2011-01-28 14:51:14 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:46:12 -0800
commit86013b648ff99c90346f0379c4ffb6f5b17eecd2 (patch)
tree973fbf7a269feb629ce311b72830e6680028361c /arch/arm/mach-tegra/board-ventana.c
parent6611c2002e7d6c3240cb082cea6e6c7921e0f008 (diff)
tegra: ventana: add wakeup_key for gpio-keys
Checks if wake up source is a wake key using PMC's wake status register. BUG 745149 Original-Change-Id: Ib3684163f3e9913c2aab814db8c1904899bc9819 Reviewed-on: http://git-master/r/17456 Tested-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: R27747fdaeb169df8baeabf0c825845ab140a261e
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana.c')
-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 = {