Commit 87b2c7df authored by Mark Brown's avatar Mark Brown Committed by Dmitry Torokhov

Input: synaptics_i2c - convert to dev_pm_ops

There is a general move to convert drivers to dev_pm_ops rather than bus
specific PM ops in order to facilitate core development. Do this converison
for synaptics-i2c.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 3dcab3bd
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pm.h>
#define DRIVER_NAME "synaptics_i2c" #define DRIVER_NAME "synaptics_i2c"
/* maximum product id is 15 characters */ /* maximum product id is 15 characters */
...@@ -619,8 +620,9 @@ static int __devexit synaptics_i2c_remove(struct i2c_client *client) ...@@ -619,8 +620,9 @@ static int __devexit synaptics_i2c_remove(struct i2c_client *client)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int synaptics_i2c_suspend(struct i2c_client *client, pm_message_t mesg) static int synaptics_i2c_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct synaptics_i2c *touch = i2c_get_clientdata(client); struct synaptics_i2c *touch = i2c_get_clientdata(client);
cancel_delayed_work_sync(&touch->dwork); cancel_delayed_work_sync(&touch->dwork);
...@@ -631,9 +633,10 @@ static int synaptics_i2c_suspend(struct i2c_client *client, pm_message_t mesg) ...@@ -631,9 +633,10 @@ static int synaptics_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
return 0; return 0;
} }
static int synaptics_i2c_resume(struct i2c_client *client) static int synaptics_i2c_resume(struct device *dev)
{ {
int ret; int ret;
struct i2c_client *client = to_i2c_client(dev);
struct synaptics_i2c *touch = i2c_get_clientdata(client); struct synaptics_i2c *touch = i2c_get_clientdata(client);
ret = synaptics_i2c_reset_config(client); ret = synaptics_i2c_reset_config(client);
...@@ -645,11 +648,11 @@ static int synaptics_i2c_resume(struct i2c_client *client) ...@@ -645,11 +648,11 @@ static int synaptics_i2c_resume(struct i2c_client *client)
return 0; return 0;
} }
#else
#define synaptics_i2c_suspend NULL
#define synaptics_i2c_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend,
synaptics_i2c_resume);
static const struct i2c_device_id synaptics_i2c_id_table[] = { static const struct i2c_device_id synaptics_i2c_id_table[] = {
{ "synaptics_i2c", 0 }, { "synaptics_i2c", 0 },
{ }, { },
...@@ -660,13 +663,12 @@ static struct i2c_driver synaptics_i2c_driver = { ...@@ -660,13 +663,12 @@ static struct i2c_driver synaptics_i2c_driver = {
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &synaptics_i2c_pm,
}, },
.probe = synaptics_i2c_probe, .probe = synaptics_i2c_probe,
.remove = __devexit_p(synaptics_i2c_remove), .remove = __devexit_p(synaptics_i2c_remove),
.suspend = synaptics_i2c_suspend,
.resume = synaptics_i2c_resume,
.id_table = synaptics_i2c_id_table, .id_table = synaptics_i2c_id_table,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment