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>
This commit is contained in:
committed by
Dmitry Torokhov
parent
85012fff38
commit
92b672e217
@@ -261,25 +261,27 @@ static int __devexit mcs5000_ts_remove(struct i2c_client *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
static int mcs5000_ts_suspend(struct i2c_client *client, pm_message_t mesg)
|
static int mcs5000_ts_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
|
struct i2c_client *client = to_i2c_client(dev);
|
||||||
|
|
||||||
/* Touch sleep mode */
|
/* Touch sleep mode */
|
||||||
i2c_smbus_write_byte_data(client, MCS5000_TS_OP_MODE, OP_MODE_SLEEP);
|
i2c_smbus_write_byte_data(client, MCS5000_TS_OP_MODE, OP_MODE_SLEEP);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mcs5000_ts_resume(struct i2c_client *client)
|
static int mcs5000_ts_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
|
struct i2c_client *client = to_i2c_client(dev);
|
||||||
struct mcs5000_ts_data *data = i2c_get_clientdata(client);
|
struct mcs5000_ts_data *data = i2c_get_clientdata(client);
|
||||||
|
|
||||||
mcs5000_ts_phys_init(data);
|
mcs5000_ts_phys_init(data);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define mcs5000_ts_suspend NULL
|
static SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, mcs5000_ts_suspend, mcs5000_ts_resume);
|
||||||
#define mcs5000_ts_resume NULL
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct i2c_device_id mcs5000_ts_id[] = {
|
static const struct i2c_device_id mcs5000_ts_id[] = {
|
||||||
@@ -291,10 +293,11 @@ MODULE_DEVICE_TABLE(i2c, mcs5000_ts_id);
|
|||||||
static struct i2c_driver mcs5000_ts_driver = {
|
static struct i2c_driver mcs5000_ts_driver = {
|
||||||
.probe = mcs5000_ts_probe,
|
.probe = mcs5000_ts_probe,
|
||||||
.remove = __devexit_p(mcs5000_ts_remove),
|
.remove = __devexit_p(mcs5000_ts_remove),
|
||||||
.suspend = mcs5000_ts_suspend,
|
|
||||||
.resume = mcs5000_ts_resume,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "mcs5000_ts",
|
.name = "mcs5000_ts",
|
||||||
|
#ifdef CONFIG_PM
|
||||||
|
.pm = &mcs5000_ts_pm,
|
||||||
|
#endif
|
||||||
},
|
},
|
||||||
.id_table = mcs5000_ts_id,
|
.id_table = mcs5000_ts_id,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user