linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: eeti_ts: cancel pending work when going to suspend
@ 2010-04-13 18:31 Daniel Mack
  2010-04-14 18:14 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Mack @ 2010-04-13 18:31 UTC (permalink / raw)
  To: linux-input; +Cc: Daniel Mack, Dmitry Torokhov

This fixes a race between the suspend code and input events.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/eeti_ts.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 204b8a1..2a01695 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -250,6 +250,9 @@ static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg)
 	if (device_may_wakeup(&client->dev))
 		enable_irq_wake(priv->irq);
 
+	disable_irq(priv->irq);
+	cancel_work_sync(&priv->work);
+
 	return 0;
 }
 
@@ -260,6 +263,10 @@ static int eeti_ts_resume(struct i2c_client *client)
 	if (device_may_wakeup(&client->dev))
 		disable_irq_wake(priv->irq);
 
+	/* If we have active users, read the events once to arm the IRQ */
+	if (priv->input->users)
+		eeti_ts_read(&priv->work);
+
 	return 0;
 }
 #else
-- 
1.7.0.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-19 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-13 18:31 [PATCH] input: eeti_ts: cancel pending work when going to suspend Daniel Mack
2010-04-14 18:14 ` Dmitry Torokhov
2010-04-19 14:15   ` Daniel Mack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).