diff options
author | Rakesh Iyer <riyer@nvidia.com> | 2011-05-11 17:24:10 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-05-11 17:31:09 -0400 |
commit | baafb435372dd48e3854028aec669effae957c9e (patch) | |
tree | c60f5ce6257a8dec7aaeddfcecdc1cbcef73f6a4 /drivers/input | |
parent | 7388754e0399d341e6d02fc7394b3727cad57371 (diff) |
Input: tegra-kbc - change wakeup logic to be all or nothing
Tegra hardware design cannot reliably support an arbitrary set of keys
waking up the system. Modify wakeup logic so either any key wakes the
system up or none will do.
Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/tegra-kbc.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 5fb4b972f205..2b3b73ec6689 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c | |||
@@ -66,8 +66,6 @@ struct tegra_kbc { | |||
66 | void __iomem *mmio; | 66 | void __iomem *mmio; |
67 | struct input_dev *idev; | 67 | struct input_dev *idev; |
68 | unsigned int irq; | 68 | unsigned int irq; |
69 | unsigned int wake_enable_rows; | ||
70 | unsigned int wake_enable_cols; | ||
71 | spinlock_t lock; | 69 | spinlock_t lock; |
72 | unsigned int repoll_dly; | 70 | unsigned int repoll_dly; |
73 | unsigned long cp_dly_jiffies; | 71 | unsigned long cp_dly_jiffies; |
@@ -418,21 +416,11 @@ static void tegra_kbc_setup_wakekeys(struct tegra_kbc *kbc, bool filter) | |||
418 | int i; | 416 | int i; |
419 | unsigned int rst_val; | 417 | unsigned int rst_val; |
420 | 418 | ||
421 | BUG_ON(pdata->wake_cnt > KBC_MAX_KEY); | 419 | /* Either mask all keys or none. */ |
422 | rst_val = (filter && pdata->wake_cnt) ? ~0 : 0; | 420 | rst_val = (filter && !pdata->wakeup) ? ~0 : 0; |
423 | 421 | ||
424 | for (i = 0; i < KBC_MAX_ROW; i++) | 422 | for (i = 0; i < KBC_MAX_ROW; i++) |
425 | writel(rst_val, kbc->mmio + KBC_ROW0_MASK_0 + i * 4); | 423 | writel(rst_val, kbc->mmio + KBC_ROW0_MASK_0 + i * 4); |
426 | |||
427 | if (filter) { | ||
428 | for (i = 0; i < pdata->wake_cnt; i++) { | ||
429 | u32 val, addr; | ||
430 | addr = pdata->wake_cfg[i].row * 4 + KBC_ROW0_MASK_0; | ||
431 | val = readl(kbc->mmio + addr); | ||
432 | val &= ~(1 << pdata->wake_cfg[i].col); | ||
433 | writel(val, kbc->mmio + addr); | ||
434 | } | ||
435 | } | ||
436 | } | 424 | } |
437 | 425 | ||
438 | static void tegra_kbc_config_pins(struct tegra_kbc *kbc) | 426 | static void tegra_kbc_config_pins(struct tegra_kbc *kbc) |
@@ -594,7 +582,6 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev) | |||
594 | struct resource *res; | 582 | struct resource *res; |
595 | int irq; | 583 | int irq; |
596 | int err; | 584 | int err; |
597 | int i; | ||
598 | int num_rows = 0; | 585 | int num_rows = 0; |
599 | unsigned int debounce_cnt; | 586 | unsigned int debounce_cnt; |
600 | unsigned int scan_time_rows; | 587 | unsigned int scan_time_rows; |
@@ -651,13 +638,6 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev) | |||
651 | goto err_iounmap; | 638 | goto err_iounmap; |
652 | } | 639 | } |
653 | 640 | ||
654 | kbc->wake_enable_rows = 0; | ||
655 | kbc->wake_enable_cols = 0; | ||
656 | for (i = 0; i < pdata->wake_cnt; i++) { | ||
657 | kbc->wake_enable_rows |= (1 << pdata->wake_cfg[i].row); | ||
658 | kbc->wake_enable_cols |= (1 << pdata->wake_cfg[i].col); | ||
659 | } | ||
660 | |||
661 | /* | 641 | /* |
662 | * The time delay between two consecutive reads of the FIFO is | 642 | * The time delay between two consecutive reads of the FIFO is |
663 | * the sum of the repeat time and the time taken for scanning | 643 | * the sum of the repeat time and the time taken for scanning |