summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPradeep Goudagunta <pgoudagunta@nvidia.com>2011-07-08 19:28:35 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-08-16 17:49:11 -0700
commit786f9429a1a207fbc34c362430ba0a976157074c (patch)
tree9fa3bbebde7c5f85ac26173b5020deaf603705f0 /drivers
parent14c59d805740d594d012c7a5288c14b4c4bcdb05 (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 Reviewed-on: http://git-master/r/40221 (cherry picked from commit c560574fcb4d8c58a4554021793e09358658fd4f) Change-Id: Ie7c9807e3a98165352d5a8ead363b3ec964ad753 Reviewed-on: http://git-master/r/41528 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Pradeep Goudagunta <pgoudagunta@nvidia.com>
Diffstat (limited to 'drivers')
-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 e86046fbffc9..469c53115af0 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 */