Skip to content

Commit 22a844b

Browse files
grygoriySdtor
authored andcommitted
Input: ti_am335x_tsc - prevent system suspend when TSC is in use
Prevent system suspend while user has finger on touch screen, because TSC is wakeup source and suspending device while in use will result in failure to disable the module. This patch uses pm_stay_awake() and pm_relax() APIs to prevent and resume system suspend as required. Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Vignesh R <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 4685042 commit 22a844b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/input/touchscreen/ti_am335x_tsc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ static irqreturn_t titsc_irq(int irq, void *dev)
276276
if (status & IRQENB_HW_PEN) {
277277
ts_dev->pen_down = true;
278278
irqclr |= IRQENB_HW_PEN;
279+
pm_stay_awake(ts_dev->mfd_tscadc->dev);
279280
}
280281

281282
if (status & IRQENB_PENUP) {
@@ -285,6 +286,7 @@ static irqreturn_t titsc_irq(int irq, void *dev)
285286
input_report_key(input_dev, BTN_TOUCH, 0);
286287
input_report_abs(input_dev, ABS_PRESSURE, 0);
287288
input_sync(input_dev);
289+
pm_relax(ts_dev->mfd_tscadc->dev);
288290
} else {
289291
ts_dev->pen_down = true;
290292
}
@@ -517,6 +519,7 @@ static int __maybe_unused titsc_resume(struct device *dev)
517519
titsc_writel(ts_dev, REG_IRQWAKEUP,
518520
0x00);
519521
titsc_writel(ts_dev, REG_IRQCLR, IRQENB_HW_PEN);
522+
pm_relax(ts_dev->mfd_tscadc->dev);
520523
}
521524
titsc_step_config(ts_dev);
522525
titsc_writel(ts_dev, REG_FIFO0THR,

0 commit comments

Comments
 (0)