diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-01-07 02:01:03 -0500 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-01-07 02:03:07 -0500 |
| commit | d72e64ec0b134d26a89c736394ee0b638513bed8 (patch) | |
| tree | ab0cda857daefef74e53e40185a375aed530be1c /drivers/input | |
| parent | 92b672e217ddf87e4181454f8200f0f06139cdbc (diff) | |
Input: migor_ts - convert to dev_pm_ops
There is a general move towards the use of dev_pm_ops rather than
bus specific suspend APIs as this simplifies both the bus and PM core
implementations. Convert the migor_ts driver over.
Compile tested only.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/touchscreen/migor_ts.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/migor_ts.c b/drivers/input/touchscreen/migor_ts.c index defe5dd3627c..5803bd0c1cca 100644 --- a/drivers/input/touchscreen/migor_ts.c +++ b/drivers/input/touchscreen/migor_ts.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
| 24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
| 25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
| 26 | #include <linux/pm.h> | ||
| 26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
| 27 | #include <asm/io.h> | 28 | #include <asm/io.h> |
| 28 | #include <linux/i2c.h> | 29 | #include <linux/i2c.h> |
| @@ -226,8 +227,9 @@ static int migor_ts_remove(struct i2c_client *client) | |||
| 226 | return 0; | 227 | return 0; |
| 227 | } | 228 | } |
| 228 | 229 | ||
| 229 | static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg) | 230 | static int migor_ts_suspend(struct device *dev) |
| 230 | { | 231 | { |
| 232 | struct i2c_client *client = to_i2c_client(dev); | ||
| 231 | struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); | 233 | struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); |
| 232 | 234 | ||
| 233 | if (device_may_wakeup(&client->dev)) | 235 | if (device_may_wakeup(&client->dev)) |
| @@ -236,8 +238,9 @@ static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg) | |||
| 236 | return 0; | 238 | return 0; |
| 237 | } | 239 | } |
| 238 | 240 | ||
| 239 | static int migor_ts_resume(struct i2c_client *client) | 241 | static int migor_ts_resume(struct device *dev) |
| 240 | { | 242 | { |
| 243 | struct i2c_client *client = to_i2c_client(dev); | ||
| 241 | struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); | 244 | struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); |
| 242 | 245 | ||
| 243 | if (device_may_wakeup(&client->dev)) | 246 | if (device_may_wakeup(&client->dev)) |
| @@ -246,6 +249,8 @@ static int migor_ts_resume(struct i2c_client *client) | |||
| 246 | return 0; | 249 | return 0; |
| 247 | } | 250 | } |
| 248 | 251 | ||
| 252 | static SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume); | ||
| 253 | |||
| 249 | static const struct i2c_device_id migor_ts_id[] = { | 254 | static const struct i2c_device_id migor_ts_id[] = { |
| 250 | { "migor_ts", 0 }, | 255 | { "migor_ts", 0 }, |
| 251 | { } | 256 | { } |
| @@ -255,11 +260,10 @@ MODULE_DEVICE_TABLE(i2c, migor_ts); | |||
| 255 | static struct i2c_driver migor_ts_driver = { | 260 | static struct i2c_driver migor_ts_driver = { |
| 256 | .driver = { | 261 | .driver = { |
| 257 | .name = "migor_ts", | 262 | .name = "migor_ts", |
| 263 | .pm = &migor_ts_pm, | ||
| 258 | }, | 264 | }, |
| 259 | .probe = migor_ts_probe, | 265 | .probe = migor_ts_probe, |
| 260 | .remove = migor_ts_remove, | 266 | .remove = migor_ts_remove, |
| 261 | .suspend = migor_ts_suspend, | ||
| 262 | .resume = migor_ts_resume, | ||
| 263 | .id_table = migor_ts_id, | 267 | .id_table = migor_ts_id, |
| 264 | }; | 268 | }; |
| 265 | 269 | ||
