diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-11 11:49:37 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-02-21 04:02:29 -0500 |
commit | a257090cd4e26b96667a15262f322e51f6582507 (patch) | |
tree | e06b0ee385b552e64b04d0529511f0cab755c05c /drivers/input/misc | |
parent | 6b7cfd193a00ba72efb19a05c486f96ae9297d0b (diff) |
Input: ad714x-spi - 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-spi.
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/misc')
-rw-r--r-- | drivers/input/misc/ad714x-spi.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c index 7f8dedfd1bfe..4120dd549305 100644 --- a/drivers/input/misc/ad714x-spi.c +++ b/drivers/input/misc/ad714x-spi.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/input.h> /* BUS_I2C */ | 9 | #include <linux/input.h> /* BUS_I2C */ |
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/spi/spi.h> | 11 | #include <linux/spi/spi.h> |
12 | #include <linux/pm.h> | ||
12 | #include <linux/types.h> | 13 | #include <linux/types.h> |
13 | #include "ad714x.h" | 14 | #include "ad714x.h" |
14 | 15 | ||
@@ -16,20 +17,19 @@ | |||
16 | #define AD714x_SPI_READ BIT(10) | 17 | #define AD714x_SPI_READ BIT(10) |
17 | 18 | ||
18 | #ifdef CONFIG_PM | 19 | #ifdef CONFIG_PM |
19 | static int ad714x_spi_suspend(struct spi_device *spi, pm_message_t message) | 20 | static int ad714x_spi_suspend(struct device *dev) |
20 | { | 21 | { |
21 | return ad714x_disable(spi_get_drvdata(spi)); | 22 | return ad714x_disable(spi_get_drvdata(to_spi_device(dev))); |
22 | } | 23 | } |
23 | 24 | ||
24 | static int ad714x_spi_resume(struct spi_device *spi) | 25 | static int ad714x_spi_resume(struct device *dev) |
25 | { | 26 | { |
26 | return ad714x_enable(spi_get_drvdata(spi)); | 27 | return ad714x_enable(spi_get_drvdata(to_spi_device(dev))); |
27 | } | 28 | } |
28 | #else | ||
29 | # define ad714x_spi_suspend NULL | ||
30 | # define ad714x_spi_resume NULL | ||
31 | #endif | 29 | #endif |
32 | 30 | ||
31 | static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume); | ||
32 | |||
33 | static int ad714x_spi_read(struct device *dev, unsigned short reg, | 33 | static int ad714x_spi_read(struct device *dev, unsigned short reg, |
34 | unsigned short *data) | 34 | unsigned short *data) |
35 | { | 35 | { |
@@ -79,11 +79,10 @@ static struct spi_driver ad714x_spi_driver = { | |||
79 | .driver = { | 79 | .driver = { |
80 | .name = "ad714x_captouch", | 80 | .name = "ad714x_captouch", |
81 | .owner = THIS_MODULE, | 81 | .owner = THIS_MODULE, |
82 | .pm = &ad714x_spi_pm, | ||
82 | }, | 83 | }, |
83 | .probe = ad714x_spi_probe, | 84 | .probe = ad714x_spi_probe, |
84 | .remove = __devexit_p(ad714x_spi_remove), | 85 | .remove = __devexit_p(ad714x_spi_remove), |
85 | .suspend = ad714x_spi_suspend, | ||
86 | .resume = ad714x_spi_resume, | ||
87 | }; | 86 | }; |
88 | 87 | ||
89 | static __init int ad714x_spi_init(void) | 88 | static __init int ad714x_spi_init(void) |