Commit d72e64ec authored by Mark Brown's avatar Mark Brown Committed by Dmitry Torokhov

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarMagnus Damm <damm@opensource.se>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 92b672e2
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pm.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/io.h> #include <asm/io.h>
#include <linux/i2c.h> #include <linux/i2c.h>
...@@ -226,8 +227,9 @@ static int migor_ts_remove(struct i2c_client *client) ...@@ -226,8 +227,9 @@ static int migor_ts_remove(struct i2c_client *client)
return 0; return 0;
} }
static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg) static int migor_ts_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); struct migor_ts_priv *priv = dev_get_drvdata(&client->dev);
if (device_may_wakeup(&client->dev)) if (device_may_wakeup(&client->dev))
...@@ -236,8 +238,9 @@ static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg) ...@@ -236,8 +238,9 @@ static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg)
return 0; return 0;
} }
static int migor_ts_resume(struct i2c_client *client) static int migor_ts_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); struct migor_ts_priv *priv = dev_get_drvdata(&client->dev);
if (device_may_wakeup(&client->dev)) if (device_may_wakeup(&client->dev))
...@@ -246,6 +249,8 @@ static int migor_ts_resume(struct i2c_client *client) ...@@ -246,6 +249,8 @@ static int migor_ts_resume(struct i2c_client *client)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume);
static const struct i2c_device_id migor_ts_id[] = { static const struct i2c_device_id migor_ts_id[] = {
{ "migor_ts", 0 }, { "migor_ts", 0 },
{ } { }
...@@ -255,11 +260,10 @@ MODULE_DEVICE_TABLE(i2c, migor_ts); ...@@ -255,11 +260,10 @@ MODULE_DEVICE_TABLE(i2c, migor_ts);
static struct i2c_driver migor_ts_driver = { static struct i2c_driver migor_ts_driver = {
.driver = { .driver = {
.name = "migor_ts", .name = "migor_ts",
.pm = &migor_ts_pm,
}, },
.probe = migor_ts_probe, .probe = migor_ts_probe,
.remove = migor_ts_remove, .remove = migor_ts_remove,
.suspend = migor_ts_suspend,
.resume = migor_ts_resume,
.id_table = migor_ts_id, .id_table = migor_ts_id,
}; };
......
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