Skip to content

Commit 4685042

Browse files
grygoriySdtor
authored andcommitted
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 <[email protected]> Signed-off-by: Vignesh R <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 38ba34a commit 4685042

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/input/touchscreen/ti_am335x_tsc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#define SEQ_SETTLE 275
3535
#define MAX_12BIT ((1 << 12) - 1)
3636

37+
#define TSC_IRQENB_MASK (IRQENB_FIFO0THRES | IRQENB_EOS | IRQENB_HW_PEN)
38+
3739
static const int config_pins[] = {
3840
STEPCONFIG_XPP,
3941
STEPCONFIG_XNN,
@@ -432,6 +434,7 @@ static int titsc_probe(struct platform_device *pdev)
432434
goto err_free_mem;
433435
}
434436

437+
titsc_writel(ts_dev, REG_IRQSTATUS, TSC_IRQENB_MASK);
435438
titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES);
436439
titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_EOS);
437440
err = titsc_config_wires(ts_dev);
@@ -495,6 +498,7 @@ static int __maybe_unused titsc_suspend(struct device *dev)
495498

496499
tscadc_dev = ti_tscadc_dev_get(to_platform_device(dev));
497500
if (device_may_wakeup(tscadc_dev->dev)) {
501+
titsc_writel(ts_dev, REG_IRQSTATUS, TSC_IRQENB_MASK);
498502
idle = titsc_readl(ts_dev, REG_IRQENABLE);
499503
titsc_writel(ts_dev, REG_IRQENABLE,
500504
(idle | IRQENB_HW_PEN));

0 commit comments

Comments
 (0)