* [PATCH] Input: migor_ts - Convert to dev_pm_ops
@ 2011-01-05 19:10 Mark Brown
2011-01-06 5:28 ` Magnus Damm
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2011-01-05 19:10 UTC (permalink / raw)
To: Magnus Damm, Dmitry Torokhov, Magnus Damm; +Cc: linux-input, Mark Brown
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>
---
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 defe5dd..5803bd0 100644
--- a/drivers/input/touchscreen/migor_ts.c
+++ b/drivers/input/touchscreen/migor_ts.c
@@ -23,6 +23,7 @@
#include <linux/kernel.h>
#include <linux/input.h>
#include <linux/interrupt.h>
+#include <linux/pm.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <linux/i2c.h>
@@ -226,8 +227,9 @@ static int migor_ts_remove(struct i2c_client *client)
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);
if (device_may_wakeup(&client->dev))
@@ -236,8 +238,9 @@ static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg)
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);
if (device_may_wakeup(&client->dev))
@@ -246,6 +249,8 @@ static int migor_ts_resume(struct i2c_client *client)
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[] = {
{ "migor_ts", 0 },
{ }
@@ -255,11 +260,10 @@ MODULE_DEVICE_TABLE(i2c, migor_ts);
static struct i2c_driver migor_ts_driver = {
.driver = {
.name = "migor_ts",
+ .pm = &migor_ts_pm,
},
.probe = migor_ts_probe,
.remove = migor_ts_remove,
- .suspend = migor_ts_suspend,
- .resume = migor_ts_resume,
.id_table = migor_ts_id,
};
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Input: migor_ts - Convert to dev_pm_ops
2011-01-05 19:10 [PATCH] Input: migor_ts - Convert to dev_pm_ops Mark Brown
@ 2011-01-06 5:28 ` Magnus Damm
0 siblings, 0 replies; 2+ messages in thread
From: Magnus Damm @ 2011-01-06 5:28 UTC (permalink / raw)
To: Mark Brown; +Cc: Dmitry Torokhov, Magnus Damm, linux-input
On Thu, Jan 6, 2011 at 4:10 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> 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>
Great, thank you!
Acked-by: Magnus Damm <damm@opensource.se>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-06 5:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 19:10 [PATCH] Input: migor_ts - Convert to dev_pm_ops Mark Brown
2011-01-06 5:28 ` Magnus Damm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).