ARM: tegra: loki: enhance loki_wakeup_key
Louis Li [Tue, 3 Dec 2013 07:40:15 +0000 (15:40 +0800)]
Whether the wakeup is caused by power key or not should refer to the
GPIO_PQ0 bit not PWR_INT bit in the wake status register.

Bug 1416721

Change-Id: Iaa53a9c100ad31568fd199a8a441085e67d5f1af
Signed-off-by: Louis Li <louli@nvidia.com>
Reviewed-on: http://git-master/r/337658
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Yunfan Zhang <yunfanz@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

arch/arm/mach-tegra/board-loki-kbc.c

index bfe2ae4..d468483 100644 (file)
@@ -65,7 +65,7 @@
 static int loki_wakeup_key(void);
 
 static struct gpio_keys_button loki_int_keys[] = {
-       [0] = GPIO_IKEY(KEY_POWER, 0, 1, 10),
+       [0] = GPIO_KEY(KEY_POWER, PQ0, 1),
        [1] = {
                .code = SW_LID,
                .gpio = TEGRA_GPIO_HALL,
@@ -100,7 +100,7 @@ static int loki_wakeup_key(void)
                | (u64)readl(IO_ADDRESS(TEGRA_PMC_BASE)
                + PMC_WAKE2_STATUS) << 32;
 
-       if (status & TEGRA_WAKE_PWR_INT)
+       if (status & TEGRA_WAKE_GPIO_PQ0)
                wakeup_key = KEY_POWER;
        else if (status & (1UL << TEGRA_WAKE_GPIO_PS0))
                wakeup_key = SW_LID;
@@ -119,9 +119,6 @@ int __init loki_kbc_init(void)
        pr_info("Boardid:SKU = 0x%04x:0x%04x\n",
                        board_info.board_id, board_info.sku);
 
-       loki_int_keys[0].gpio = TEGRA_GPIO_PQ0;
-       loki_int_keys[0].active_low = 1;
-
        ret = platform_device_register(&loki_int_keys_device);
        return ret;
 }