diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-11 11:49:05 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-02-21 04:02:29 -0500 |
commit | 6b7cfd193a00ba72efb19a05c486f96ae9297d0b (patch) | |
tree | 9a46c5aff13d2ea5a1b2a76e6bf2e8c9d634b320 /drivers/input | |
parent | 4dfcc271d587465f0d181c7636453ba4d0ec8acc (diff) |
Input: ad714x-i2c - convert to dev_pm_ops
There is a general move to convert drivers to use dev_pm_ops rather than
bus specific PM operations in order to facilitate core work. Do this
conversion for ad714x-i2c.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/ad714x-i2c.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c index 2bef8fa56c94..e21deb1baa8a 100644 --- a/drivers/input/misc/ad714x-i2c.c +++ b/drivers/input/misc/ad714x-i2c.c | |||
@@ -10,23 +10,23 @@ | |||
10 | #include <linux/i2c.h> | 10 | #include <linux/i2c.h> |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/pm.h> | ||
13 | #include "ad714x.h" | 14 | #include "ad714x.h" |
14 | 15 | ||
15 | #ifdef CONFIG_PM | 16 | #ifdef CONFIG_PM |
16 | static int ad714x_i2c_suspend(struct i2c_client *client, pm_message_t message) | 17 | static int ad714x_i2c_suspend(struct device *dev) |
17 | { | 18 | { |
18 | return ad714x_disable(i2c_get_clientdata(client)); | 19 | return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev))); |
19 | } | 20 | } |
20 | 21 | ||
21 | static int ad714x_i2c_resume(struct i2c_client *client) | 22 | static int ad714x_i2c_resume(struct device *dev) |
22 | { | 23 | { |
23 | return ad714x_enable(i2c_get_clientdata(client)); | 24 | return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev))); |
24 | } | 25 | } |
25 | #else | ||
26 | # define ad714x_i2c_suspend NULL | ||
27 | # define ad714x_i2c_resume NULL | ||
28 | #endif | 26 | #endif |
29 | 27 | ||
28 | static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume); | ||
29 | |||
30 | static int ad714x_i2c_write(struct device *dev, unsigned short reg, | 30 | static int ad714x_i2c_write(struct device *dev, unsigned short reg, |
31 | unsigned short data) | 31 | unsigned short data) |
32 | { | 32 | { |
@@ -114,11 +114,10 @@ MODULE_DEVICE_TABLE(i2c, ad714x_id); | |||
114 | static struct i2c_driver ad714x_i2c_driver = { | 114 | static struct i2c_driver ad714x_i2c_driver = { |
115 | .driver = { | 115 | .driver = { |
116 | .name = "ad714x_captouch", | 116 | .name = "ad714x_captouch", |
117 | .pm = &ad714x_i2c_pm, | ||
117 | }, | 118 | }, |
118 | .probe = ad714x_i2c_probe, | 119 | .probe = ad714x_i2c_probe, |
119 | .remove = __devexit_p(ad714x_i2c_remove), | 120 | .remove = __devexit_p(ad714x_i2c_remove), |
120 | .suspend = ad714x_i2c_suspend, | ||
121 | .resume = ad714x_i2c_resume, | ||
122 | .id_table = ad714x_id, | 121 | .id_table = ad714x_id, |
123 | }; | 122 | }; |
124 | 123 | ||