aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/ad714x-spi.c17
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
19static int ad714x_spi_suspend(struct spi_device *spi, pm_message_t message) 20static 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
24static int ad714x_spi_resume(struct spi_device *spi) 25static 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
31static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume);
32
33static int ad714x_spi_read(struct device *dev, unsigned short reg, 33static 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
89static __init int ad714x_spi_init(void) 88static __init int ad714x_spi_init(void)