summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2011-01-28 14:51:14 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-01-28 19:39:02 -0800
commitcb96d40b1a3665235a564e078a305d0e419266e1 (patch)
treeaad7b656068c9507107bdfe8519523e7d5fdb26a /arch/arm
parent4ff2f5a056bf5a17aac4cdb256a39b304c9a1314 (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 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>
Diffstat (limited to 'arch/arm')
-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 a225d331cd21..351f192e6e3a 100644
--- a/arch/arm/mach-tegra/board-ventana.c
+++ b/arch/arm/mach-tegra/board-ventana.c
@@ -64,6 +64,7 @@
#include "devices.h"
#include "gpio-names.h"
#include "fuse.h"
+#include "wakeups-t2.h"
static struct usb_mass_storage_platform_data tegra_usb_fsg_platform = {
.vendor = "NVIDIA",
@@ -416,9 +417,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 = {