summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-cardhu-kbc.c
diff options
context:
space:
mode:
authorvikasr <vikasr@nvidia.com>2011-05-13 17:32:49 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2012-03-23 19:57:08 -0700
commita5beb70b78f1648bf27a568a73755149e0038d26 (patch)
tree708812582ea8a45537ccbc54d452d9439bd2473b /arch/arm/mach-tegra/board-cardhu-kbc.c
parentaa02644e024370d50a024cae3e1c572a232a0c4b (diff)
ARM: tegra: cardhu: Power button to unlock screen
Made changes in the code to include PM269's power button to lock and unlock the screen. Bug 824765 Original-Change-Id: I6cead8cfd2a84ffa6ba5ef654e690f2f675a3c77 Reviewed-on: http://git-master/r/31607 Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com> Tested-by: Vikas Ramesh Kedigehalli <vikasr@nvidia.com> Rebase-Id: R46af0c6c7b5baff9e72fe144eaa0127a05fa9de8
Diffstat (limited to 'arch/arm/mach-tegra/board-cardhu-kbc.c')
-rw-r--r--arch/arm/mach-tegra/board-cardhu-kbc.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-kbc.c b/arch/arm/mach-tegra/board-cardhu-kbc.c
index 42b74cde6d8a..d5b5fbb2114b 100644
--- a/arch/arm/mach-tegra/board-cardhu-kbc.c
+++ b/arch/arm/mach-tegra/board-cardhu-kbc.c
@@ -136,6 +136,23 @@ int __init cardhu_scroll_init(void)
.debounce_interval = 10, \
}
+static struct gpio_keys_button cardhu_keys_pm269[] = {
+ [0] = GPIO_KEY(KEY_POWER, PV0, 1),
+};
+
+static struct gpio_keys_platform_data cardhu_keys_pm269_platform_data = {
+ .buttons = cardhu_keys_pm269,
+ .nbuttons = ARRAY_SIZE(cardhu_keys_pm269),
+};
+
+static struct platform_device cardhu_keys_pm269_device = {
+ .name = "gpio-keys",
+ .id = 0,
+ .dev = {
+ .platform_data = &cardhu_keys_pm269_platform_data,
+ },
+};
+
static struct gpio_keys_button cardhu_keys_e1198[] = {
[0] = GPIO_KEY(KEY_HOME, PQ0, 0),
[1] = GPIO_KEY(KEY_BACK, PQ1, 0),
@@ -148,7 +165,7 @@ static struct gpio_keys_button cardhu_keys_e1198[] = {
static struct gpio_keys_platform_data cardhu_keys_e1198_platform_data = {
.buttons = cardhu_keys_e1198,
- .nbuttons = ARRAY_SIZE(cardhu_keys_e1198),
+ .nbuttons = ARRAY_SIZE(cardhu_keys_e1198),
};
static struct platform_device cardhu_keys_e1198_device = {
@@ -170,7 +187,7 @@ static struct gpio_keys_button cardhu_keys_e1291[] = {
static struct gpio_keys_platform_data cardhu_keys_e1291_platform_data = {
.buttons = cardhu_keys_e1291,
- .nbuttons = ARRAY_SIZE(cardhu_keys_e1291),
+ .nbuttons = ARRAY_SIZE(cardhu_keys_e1291),
};
static struct platform_device cardhu_keys_e1291_device = {
@@ -216,7 +233,8 @@ int __init cardhu_keys_init(void)
tegra_get_board_info(&board_info);
if (!((board_info.board_id == BOARD_E1198) ||
- (board_info.board_id == BOARD_E1291)))
+ (board_info.board_id == BOARD_E1291) ||
+ (board_info.board_id == BOARD_PM269)))
return 0;
pr_info("Registering gpio keys\n");
@@ -228,13 +246,17 @@ int __init cardhu_keys_init(void)
platform_device_register(&cardhu_keys_e1291_device);
platform_device_register(&cardhu_int_keys_e1291_device);
- return 0;
- }
+ } else if (board_info.board_id == BOARD_PM269) {
+ for (i = 0; i < ARRAY_SIZE(cardhu_keys_pm269); i++)
+ tegra_gpio_enable(cardhu_keys_pm269[i].gpio);
- /* 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_pm269_device);
+ } else {
+ /* 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);
+ platform_device_register(&cardhu_keys_e1198_device);
+ }
return 0;
}