Commit 92b672e217ddf87e4181454f8200f0f06139cdbc

Authored by Mark Brown
Committed by Dmitry Torokhov
1 parent 85012fff38

Input: mcs5000_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 mcs5000_ts driver over.

Compile tested only.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

Showing 1 changed file with 10 additions and 7 deletions Side-by-side Diff

drivers/input/touchscreen/mcs5000_ts.c
... ... @@ -261,25 +261,27 @@
261 261 }
262 262  
263 263 #ifdef CONFIG_PM
264   -static int mcs5000_ts_suspend(struct i2c_client *client, pm_message_t mesg)
  264 +static int mcs5000_ts_suspend(struct device *dev)
265 265 {
  266 + struct i2c_client *client = to_i2c_client(dev);
  267 +
266 268 /* Touch sleep mode */
267 269 i2c_smbus_write_byte_data(client, MCS5000_TS_OP_MODE, OP_MODE_SLEEP);
268 270  
269 271 return 0;
270 272 }
271 273  
272   -static int mcs5000_ts_resume(struct i2c_client *client)
  274 +static int mcs5000_ts_resume(struct device *dev)
273 275 {
  276 + struct i2c_client *client = to_i2c_client(dev);
274 277 struct mcs5000_ts_data *data = i2c_get_clientdata(client);
275 278  
276 279 mcs5000_ts_phys_init(data);
277 280  
278 281 return 0;
279 282 }
280   -#else
281   -#define mcs5000_ts_suspend NULL
282   -#define mcs5000_ts_resume NULL
  283 +
  284 +static SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, mcs5000_ts_suspend, mcs5000_ts_resume);
283 285 #endif
284 286  
285 287 static const struct i2c_device_id mcs5000_ts_id[] = {
286 288  
... ... @@ -291,10 +293,11 @@
291 293 static struct i2c_driver mcs5000_ts_driver = {
292 294 .probe = mcs5000_ts_probe,
293 295 .remove = __devexit_p(mcs5000_ts_remove),
294   - .suspend = mcs5000_ts_suspend,
295   - .resume = mcs5000_ts_resume,
296 296 .driver = {
297 297 .name = "mcs5000_ts",
  298 +#ifdef CONFIG_PM
  299 + .pm = &mcs5000_ts_pm,
  300 +#endif
298 301 },
299 302 .id_table = mcs5000_ts_id,
300 303 };