summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPradeep Goudagunta <pgoudagunta@nvidia.com>2011-07-08 19:28:35 +0530
committerManish Tuteja <mtuteja@nvidia.com>2011-07-15 12:03:07 -0700
commitc560574fcb4d8c58a4554021793e09358658fd4f (patch)
treef459b35eb7ccb7f9cc8d5bda59cd935f33d7c5b3
parent1e708e76d81118011d0eefa6c900923720fdd5c0 (diff)
input: tegra-kbc: Make sure KBC in wakeupmode before suspend
Making sure that keyboard controller should be in the wakeup mode before going to suspend. Doing additional check in suspend. bug 845098 Change-Id: Ia645be1881390de9d18cf03633cef47e654209e2 Reviewed-on: http://git-master/r/40221 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Victor Ryabukhin <vryabukhin@nvidia.com>
-rw-r--r--drivers/input/keyboard/tegra-kbc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index cddd9cce2b29..c9f8bd0e2020 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -539,7 +539,7 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev)
}
kbc->ncols = nc;
- for (i = 0; i < pdata->wake_key_cnt; i++)
+ for (i = 0; i < KBC_MAX_ROW; i++)
kbc->wake_enable_keys[i] = ~0u;
for (i = 0; i < pdata->wake_key_cnt; i++)
@@ -639,10 +639,21 @@ static int __devexit tegra_kbc_remove(struct platform_device *pdev)
static int tegra_kbc_suspend(struct platform_device *pdev, pm_message_t state)
{
struct tegra_kbc *kbc = platform_get_drvdata(pdev);
+ int timeout = kbc->pdata->scan_timeout_cnt/32 + 200;
+ unsigned long int_st;
dev_dbg(&pdev->dev, "KBC: tegra_kbc_suspend\n");
if (device_may_wakeup(&pdev->dev) &&
(kbc->pdata->is_wake_on_any_key || kbc->pdata->wake_key_cnt)) {
+ timeout = timeout/10;
+ while (timeout--) {
+ int_st = readl(kbc->mmio + KBC_INT_0);
+ if (int_st & 0x8) {
+ msleep(10);
+ continue;
+ }
+ break;
+ }
tegra_kbc_setup_wakekeys(kbc, true);
enable_irq_wake(kbc->irq);
/* Forcefully clear the interrupt status */