summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorvikasr <vikasr@nvidia.com>2011-05-13 17:32:49 -0700
committerNiket Sirsi <nsirsi@nvidia.com>2011-06-02 22:52:27 -0700
commitc8d283eabbf585a3482ec3bfaf6da6b9d36f3f5b (patch)
treedd22b0df1971a6f6faf2398d2c6b982d30d75091 /arch
parent906797d1d6924782eeb6fc7564e71421cd72a67c (diff)
ARM: tegra: cardhu: Power button to unlock screentegra-AP30.ER6
Made changes in the code to include PM269's power button to lock and unlock the screen. Bug 824765 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>
Diffstat (limited to 'arch')
-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;
}