aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2018-05-30 17:23:15 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-05-30 19:42:12 -0400
commit46850420e5e2330781aae5ff30cf19392d49979e (patch)
tree8ce656efe379b9f382f38a1565f8bfd099294b8a
parent38ba34a43dbc00c87d13d1c4b6d0719a2ac87b2e (diff)
Input: ti_am335x_tsc - ack pending IRQs at probe and before suspend
It is seen that just enabling the TSC module triggers a HW_PEN IRQ without any interaction with touchscreen by user. This results in first suspend/resume sequence to fail as system immediately wakes up from suspend as soon as HW_PEN IRQ is enabled in suspend handler due to the pending IRQ. Therefore clear all IRQs at probe and also in suspend callback for sanity. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/touchscreen/ti_am335x_tsc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index f1043ae71dcc..a8c828de723c 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -34,6 +34,8 @@
34#define SEQ_SETTLE 275 34#define SEQ_SETTLE 275
35#define MAX_12BIT ((1 << 12) - 1) 35#define MAX_12BIT ((1 << 12) - 1)
36 36
37#define TSC_IRQENB_MASK (IRQENB_FIFO0THRES | IRQENB_EOS | IRQENB_HW_PEN)
38
37static const int config_pins[] = { 39static const int config_pins[] = {
38 STEPCONFIG_XPP, 40 STEPCONFIG_XPP,
39 STEPCONFIG_XNN, 41 STEPCONFIG_XNN,
@@ -432,6 +434,7 @@ static int titsc_probe(struct platform_device *pdev)
432 goto err_free_mem; 434 goto err_free_mem;
433 } 435 }
434 436
437 titsc_writel(ts_dev, REG_IRQSTATUS, TSC_IRQENB_MASK);
435 titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES); 438 titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES);
436 titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_EOS); 439 titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_EOS);
437 err = titsc_config_wires(ts_dev); 440 err = titsc_config_wires(ts_dev);
@@ -495,6 +498,7 @@ static int __maybe_unused titsc_suspend(struct device *dev)
495 498
496 tscadc_dev = ti_tscadc_dev_get(to_platform_device(dev)); 499 tscadc_dev = ti_tscadc_dev_get(to_platform_device(dev));
497 if (device_may_wakeup(tscadc_dev->dev)) { 500 if (device_may_wakeup(tscadc_dev->dev)) {
501 titsc_writel(ts_dev, REG_IRQSTATUS, TSC_IRQENB_MASK);
498 idle = titsc_readl(ts_dev, REG_IRQENABLE); 502 idle = titsc_readl(ts_dev, REG_IRQENABLE);
499 titsc_writel(ts_dev, REG_IRQENABLE, 503 titsc_writel(ts_dev, REG_IRQENABLE,
500 (idle | IRQENB_HW_PEN)); 504 (idle | IRQENB_HW_PEN));