arm: tegra: cardhu: pm299: Onkey support
Laxman Dewangan [Mon, 31 Oct 2011 10:08:20 +0000 (15:08 +0530)]
Enabling the onkey for pm299 based system. This
will be used to wakeup/suspend the system.

Reviewed-on: http://git-master/r/61901
(cherry picked from commit e86410259e234d0c6ab9acdab7ab0e0fa36309ca)

Change-Id: I48c1e8ad44fa1a991b357e924baf9e0b3ba74563
Reviewed-on: http://git-master/r/62914
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Lokesh Pathak <lpathak@nvidia.com>

Rebase-Id: R075c1d69a70af7d4b90a61315ed1b025528fce61

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

index 586e5ff..29e9bfc 100644 (file)
@@ -224,6 +224,10 @@ static struct interrupt_keys_button cardhu_int_keys[] = {
        [1] = INT_KEY(KEY_POWER, TPS6591X_IRQ_BASE + TPS6591X_INT_PWRON_LP, 0, 8000),
 };
 
+static struct interrupt_keys_button cardhu_pm299_int_keys[] = {
+       [0] = INT_KEY(KEY_POWER, RICOH583_IRQ_BASE + RICOH583_IRQ_ONKEY, 0, 100),
+};
+
 static struct interrupt_keys_platform_data cardhu_int_keys_pdata = {
        .int_buttons    = cardhu_int_keys,
        .nbuttons       = ARRAY_SIZE(cardhu_int_keys),
@@ -241,6 +245,7 @@ int __init cardhu_keys_init(void)
 {
        int i;
        struct board_info board_info;
+       struct board_info pmu_board_info;
 
        tegra_get_board_info(&board_info);
        if (!((board_info.board_id == BOARD_E1198) ||
@@ -268,6 +273,14 @@ int __init cardhu_keys_init(void)
        }
 
        /* Register on-key through pmu interrupt */
+       tegra_get_pmu_board_info(&pmu_board_info);
+
+       if (pmu_board_info.board_id == BOARD_PMU_PM299) {
+               cardhu_int_keys_pdata.int_buttons = cardhu_pm299_int_keys;
+               cardhu_int_keys_pdata.nbuttons =
+                                       ARRAY_SIZE(cardhu_pm299_int_keys);
+       }
+
        if ((board_info.board_id == BOARD_E1291) ||
                (board_info.board_id == BOARD_E1198) ||
                (board_info.board_id == BOARD_E1257) ||