diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-04-01 10:49:41 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-01 22:21:40 -0400 |
commit | 0935ade0bf6baf9c5f23024102737bdaf7075abc (patch) | |
tree | 3f748643e4d4e3c0c556a3e184ea5fa51dada3f3 /drivers/input/touchscreen | |
parent | faa9fa8e448ba4c0a9d61778fd3cda1313bf1533 (diff) |
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.c | 23 |
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, | |||
198 | goto err2; | 198 | goto err2; |
199 | } | 199 | } |
200 | 200 | ||
201 | device_init_wakeup(&client->dev, 1); | ||
201 | return 0; | 202 | return 0; |
202 | 203 | ||
203 | err2: | 204 | err2: |
@@ -224,6 +225,26 @@ static int migor_ts_remove(struct i2c_client *client) | |||
224 | return 0; | 225 | return 0; |
225 | } | 226 | } |
226 | 227 | ||
228 | static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg) | ||
229 | { | ||
230 | struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); | ||
231 | |||
232 | if (device_may_wakeup(&client->dev)) | ||
233 | enable_irq_wake(priv->irq); | ||
234 | |||
235 | return 0; | ||
236 | } | ||
237 | |||
238 | static int migor_ts_resume(struct i2c_client *client) | ||
239 | { | ||
240 | struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); | ||
241 | |||
242 | if (device_may_wakeup(&client->dev)) | ||
243 | disable_irq_wake(priv->irq); | ||
244 | |||
245 | return 0; | ||
246 | } | ||
247 | |||
227 | static const struct i2c_device_id migor_ts_id[] = { | 248 | static const struct i2c_device_id migor_ts_id[] = { |
228 | { "migor_ts", 0 }, | 249 | { "migor_ts", 0 }, |
229 | { } | 250 | { } |
@@ -236,6 +257,8 @@ static struct i2c_driver migor_ts_driver = { | |||
236 | }, | 257 | }, |
237 | .probe = migor_ts_probe, | 258 | .probe = migor_ts_probe, |
238 | .remove = migor_ts_remove, | 259 | .remove = migor_ts_remove, |
260 | .suspend = migor_ts_suspend, | ||
261 | .resume = migor_ts_resume, | ||
239 | .id_table = migor_ts_id, | 262 | .id_table = migor_ts_id, |
240 | }; | 263 | }; |
241 | 264 | ||