summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-cardhu-kbc.c
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-03-08 20:47:59 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:45:40 -0800
commit29116ca2323cad2d1ed9d88fba1d10097fdad263 (patch)
tree917550a4d46c767fdb6d17946752a1cfe1966a53 /arch/arm/mach-tegra/board-cardhu-kbc.c
parentb50298a58d23fa0baff3b8b1331e77ae4c0215d9 (diff)
arm: tegra: cardhu: Registering interrupt based key support
Registering the interrupt based key driver to detect the keys directly connected to PMU interrupt lines. Original-Change-Id: Ib3380a075d6259f19884e979383cb4d5a7157005 Reviewed-on: http://git-master/r/22070 Tested-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Tested-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Original-Change-Id: Ib5f0d0d6f2ffb697a4b9ce4e683b91535529c032 Rebase-Id: Re7860f6d00e3f7a0be2e924a372f5c21a11d3696
Diffstat (limited to 'arch/arm/mach-tegra/board-cardhu-kbc.c')
-rw-r--r--arch/arm/mach-tegra/board-cardhu-kbc.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-kbc.c b/arch/arm/mach-tegra/board-cardhu-kbc.c
index 7a1e9534225a..76865b91c457 100644
--- a/arch/arm/mach-tegra/board-cardhu-kbc.c
+++ b/arch/arm/mach-tegra/board-cardhu-kbc.c
@@ -25,6 +25,8 @@
#include <linux/device.h>
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
+#include <linux/mfd/tps6591x.h>
+#include <linux/interrupt_keys.h>
#include <linux/gpio_scrollwheel.h>
#include <mach/irqs.h>
@@ -186,6 +188,34 @@ static struct platform_device cardhu_keys_e1291_device = {
},
};
+#define INT_KEY(_id, _irq, _iswake) \
+ { \
+ .code = _id, \
+ .irq = _irq, \
+ .active_low = 1, \
+ .desc = #_id, \
+ .type = EV_KEY, \
+ .wakeup = _iswake, \
+ .debounce_interval = 10, \
+ }
+static struct interrupt_keys_button cardhu_int_keys_e1291[] = {
+ [0] = INT_KEY(KEY_MENU, TPS6591X_IRQ_BASE + TPS6591X_INT_PWRON, 0),
+ [1] = INT_KEY(KEY_MENU, TPS6591X_IRQ_BASE + TPS6591X_INT_PWRON_LP, 0),
+};
+
+static struct interrupt_keys_platform_data cardhu_int_keys_e1291_pdata = {
+ .int_buttons = cardhu_int_keys_e1291,
+ .nbuttons = ARRAY_SIZE(cardhu_int_keys_e1291),
+};
+
+static struct platform_device cardhu_int_keys_e1291_device = {
+ .name = "interrupt-keys",
+ .id = 0,
+ .dev = {
+ .platform_data = &cardhu_int_keys_e1291_pdata,
+ },
+};
+
int __init cardhu_keys_init(void)
{
int i;
@@ -204,6 +234,7 @@ int __init cardhu_keys_init(void)
tegra_gpio_enable(cardhu_keys_e1291[i].gpio);
platform_device_register(&cardhu_keys_e1291_device);
+ platform_device_register(&cardhu_int_keys_e1291_device);
return 0;
}