diff mbox series

[v2,2/2] input: touch: eeti: read hardware state once after wakeup

Message ID 20190428195057.9627-2-daniel@zonque.org (mailing list archive)
State Superseded
Headers show
Series [v2,1/2] input: touch: eeti: move ISR code to own function | expand

Commit Message

Daniel Mack April 28, 2019, 7:50 p.m. UTC
For systems in which the touch IRQ is acting as wakeup source, the interrupt
controller might not latch the GPIO IRQ during sleep. In such cases, the
interrupt will never occur again after resume, hence the touch screen
appears dead.

To fix this, call into eeti_ts_read() once to read the hardware status and
to arm the IRQ again. Do that before enabling the IRQ so we don't race
against the ISR.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Reported-by: Sven Neumann <Sven.Neumann@teufel.de>
---
v2: swap the order of eeti_ts_read() and enable_irq() to address a
potential race.

 drivers/input/touchscreen/eeti_ts.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index f5724aaa815b..e2d10febbcf1 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -116,6 +116,7 @@  static void eeti_ts_start(struct eeti_ts *eeti)
 {
 	eeti->running = true;
 	wmb();
+	eeti_ts_read(eeti);
 	enable_irq(eeti->client->irq);
 }