From 0d7a21782edbf4fb48b120df9bf64118dde6ad18 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Tue, 30 Aug 2011 18:52:18 +0530 Subject: 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 Original-Change-Id: Id57642dfc8529606300ba572106fb75c79e859fb Reviewed-on: http://git-master/r/49856 Reviewed-by: Laxman Dewangan Tested-by: Laxman Dewangan Reviewed-by: Anshul Jain (SW) Tested-by: Anshul Jain (SW) Reviewed-by: Narendra Damahe Rebase-Id: Rf9240bc354915cf97e69853da4b10ac096dfbc14 --- arch/arm/mach-tegra/board-cardhu-kbc.c | 44 +++++++++++----------------------- 1 file changed, 14 insertions(+), 30 deletions(-) (limited to 'arch/arm/mach-tegra/board-cardhu-kbc.c') diff --git a/arch/arm/mach-tegra/board-cardhu-kbc.c b/arch/arm/mach-tegra/board-cardhu-kbc.c index 88ea6f96aa9c..666850368e28 100644 --- a/arch/arm/mach-tegra/board-cardhu-kbc.c +++ b/arch/arm/mach-tegra/board-cardhu-kbc.c @@ -186,7 +186,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), @@ -217,39 +217,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, }, }; @@ -273,16 +255,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; } -- cgit v1.2.3