aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-04-01 14:49:41 +0000
committerPaul Mundt <lethal@linux-sh.org>2009-04-02 11:21:40 +0900
commit0935ade0bf6baf9c5f23024102737bdaf7075abc (patch)
tree3f748643e4d4e3c0c556a3e184ea5fa51dada3f3 /drivers/input/touchscreen
parentrtc: rtc-sh: use set_irq_wake() (diff)
downloadlinux-dev-0935ade0bf6baf9c5f23024102737bdaf7075abc.tar.xz
linux-dev-0935ade0bf6baf9c5f23024102737bdaf7075abc.zip
input: migor_ts: add wakeup support
Add wakeup support to the migor_ts driver. If user space has enabled wakeup, use set_irq_wake() during suspend and resume. With this patch the migor_ts driver can be used to wake the system from suspend. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/migor_ts.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/migor_ts.c b/drivers/input/touchscreen/migor_ts.c
index 504ca11749a1..141dd584330e 100644
--- a/drivers/input/touchscreen/migor_ts.c
+++ b/drivers/input/touchscreen/migor_ts.c
@@ -198,6 +198,7 @@ static int migor_ts_probe(struct i2c_client *client,
goto err2;
}
+ device_init_wakeup(&client->dev, 1);
return 0;
err2:
@@ -224,6 +225,26 @@ static int migor_ts_remove(struct i2c_client *client)
return 0;
}
+static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg)
+{
+ struct migor_ts_priv *priv = dev_get_drvdata(&client->dev);
+
+ if (device_may_wakeup(&client->dev))
+ enable_irq_wake(priv->irq);
+
+ return 0;
+}
+
+static int migor_ts_resume(struct i2c_client *client)
+{
+ struct migor_ts_priv *priv = dev_get_drvdata(&client->dev);
+
+ if (device_may_wakeup(&client->dev))
+ disable_irq_wake(priv->irq);
+
+ return 0;
+}
+
static const struct i2c_device_id migor_ts_id[] = {
{ "migor_ts", 0 },
{ }
@@ -236,6 +257,8 @@ static struct i2c_driver migor_ts_driver = {
},
.probe = migor_ts_probe,
.remove = migor_ts_remove,
+ .suspend = migor_ts_suspend,
+ .resume = migor_ts_resume,
.id_table = migor_ts_id,
};