diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-08-30 18:52:18 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-09-01 21:10:00 -0700 |
commit | e353bff76aed0c79e7d27d989da597acdfe48b63 (patch) | |
tree | 6ffebad697da2b4599e3ebed6c207e90055ca24a | |
parent | c5a6bce1959c8f2aff90b197624f4584356638e8 (diff) |
arm: tegra: cardhu: KEY_POWER event through ONKEY
Generating the KEY_POWER event from the on-key. On-key
is connected through the pmu's PWRON interrupt.
bug 869948
Change-Id: Id57642dfc8529606300ba572106fb75c79e859fb
Reviewed-on: http://git-master/r/49856
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com>
Tested-by: Anshul Jain (SW) <anshulj@nvidia.com>
Reviewed-by: Narendra Damahe <ndamahe@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-kbc.c | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-kbc.c b/arch/arm/mach-tegra/board-cardhu-kbc.c index e91a9102815f..dada17b7fe41 100644 --- a/arch/arm/mach-tegra/board-cardhu-kbc.c +++ b/arch/arm/mach-tegra/board-cardhu-kbc.c @@ -179,7 +179,7 @@ static struct platform_device cardhu_keys_e1198_device = { }; static struct gpio_keys_button cardhu_keys_e1291[] = { - [0] = GPIO_KEY(KEY_POWER, PR0, 0), + [0] = GPIO_KEY(KEY_MENU, PR0, 0), [1] = GPIO_KEY(KEY_BACK, PR1, 0), [2] = GPIO_KEY(KEY_HOME, PR2, 0), [3] = GPIO_KEY(KEY_SEARCH, PQ3, 0), @@ -210,39 +210,21 @@ static struct platform_device cardhu_keys_e1291_device = { .wakeup = _iswake, \ .debounce_interval = _deb_int, \ } -static struct interrupt_keys_button cardhu_int_keys_e1291[] = { - [0] = INT_KEY(KEY_MENU, TPS6591X_IRQ_BASE + TPS6591X_INT_PWRON, 0, 100), - [1] = INT_KEY(KEY_POWER, TPS6591X_IRQ_BASE + TPS6591X_INT_PWRON_LP, 0, 8000), -}; - -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, - }, -}; - -static struct interrupt_keys_button cardhu_int_keys_pm269[] = { +static struct interrupt_keys_button cardhu_int_keys[] = { [0] = INT_KEY(KEY_POWER, TPS6591X_IRQ_BASE + TPS6591X_INT_PWRON, 0, 100), [1] = INT_KEY(KEY_POWER, TPS6591X_IRQ_BASE + TPS6591X_INT_PWRON_LP, 0, 8000), }; -static struct interrupt_keys_platform_data cardhu_int_keys_pm269_pdata = { - .int_buttons = cardhu_int_keys_pm269, - .nbuttons = ARRAY_SIZE(cardhu_int_keys_pm269), +static struct interrupt_keys_platform_data cardhu_int_keys_pdata = { + .int_buttons = cardhu_int_keys, + .nbuttons = ARRAY_SIZE(cardhu_int_keys), }; -static struct platform_device cardhu_int_keys_pm269_device = { +static struct platform_device cardhu_int_keys_device = { .name = "interrupt-keys", .id = 0, .dev = { - .platform_data = &cardhu_int_keys_pm269_pdata, + .platform_data = &cardhu_int_keys_pdata, }, }; @@ -266,16 +248,18 @@ 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); - } else if ((board_info.board_id == BOARD_PM269) || - (board_info.board_id == BOARD_PM305)) { - platform_device_register(&cardhu_int_keys_pm269_device); - } else { + } else if (board_info.board_id == BOARD_E1198) { /* For E1198 */ for (i = 0; i < ARRAY_SIZE(cardhu_keys_e1198); i++) tegra_gpio_enable(cardhu_keys_e1198[i].gpio); platform_device_register(&cardhu_keys_e1198_device); } + + /* Register on-key through pmu interrupt */ + if ((board_info.board_id == BOARD_E1291) || + (board_info.board_id == BOARD_PM305) || + (board_info.board_id == BOARD_PM269)) + platform_device_register(&cardhu_int_keys_device); return 0; } |