summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2010-10-04 20:06:25 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2010-10-07 01:57:50 -0700
commit7e5b6efc908c372352f724499848957893422f0e (patch)
tree76b9af08ed49ac9faa4ae2ff06619a0a195f069e /drivers
parent8eaa0afc05248d324ec8d46a557740a043d8e641 (diff)
[arm/tegra] kbc: Keep KBC to wake mode before LP0 entry
KBC does not behave properly after resume from LP0 if KBC is in continuous mode before entering into LP0. So making sure that KBC should be in wakeup mode before entering to LP0. bug 740263 Change-Id: Ia882dfb034bd9ab87811855f2ac20d26fc9581d8 Reviewed-on: http://git-master/r/7756 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rwxr-xr-xdrivers/input/keyboard/tegra-kbc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 2c69cf710259..692ca225ea7e 100755
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -78,13 +78,26 @@ static void tegra_kbc_setup_wakekeys(struct tegra_kbc *kbc, bool filter);
static int tegra_kbc_suspend(struct platform_device *pdev, pm_message_t state)
{
struct tegra_kbc *kbc = platform_get_drvdata(pdev);
+ unsigned long flags;
+ unsigned long val;
if (device_may_wakeup(&pdev->dev) && kbc->pdata->wake_cnt) {
+ spin_lock_irqsave(&kbc->lock, flags);
+ /* Disable the kbc to stop key scanning */
+ val = readl(kbc->mmio + KBC_CONTROL_0);
+ val &= ~1;
+ writel(val, kbc->mmio + KBC_CONTROL_0);
+
tegra_kbc_setup_wakekeys(kbc, true);
enable_irq_wake(kbc->irq);
tegra_configure_dpd_kbc(kbc->wake_enable_rows, kbc->wake_enable_cols);
/* Forcefully clear the interrupt status */
writel(0x7, kbc->mmio + KBC_INT_0);
+
+ /* Enable the kbc to wakeup from key event */
+ val |= 1;
+ writel(val, kbc->mmio + KBC_CONTROL_0);
+ spin_unlock_irqrestore(&kbc->lock, flags);
msleep(30);
} else {
tegra_kbc_close(kbc->idev);