diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-03-19 02:38:50 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-03-19 02:38:50 -0400 |
commit | 97eb3f24352ec6632c2127b35d8087d2a809a9b9 (patch) | |
tree | 722948059bbd325bbca232269490124231df80d4 /drivers/input/touchscreen/ads7846.c | |
parent | 439581ec07fa9cf3f519dd461a2cf41cfd3adcb4 (diff) | |
parent | def179c271ac9b5020deca798470521f14d11edd (diff) |
Merge branch 'next' into for-linus
Diffstat (limited to 'drivers/input/touchscreen/ads7846.c')
-rw-r--r-- | drivers/input/touchscreen/ads7846.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 4bf2316e3284..c24946f51256 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/input.h> | 26 | #include <linux/input.h> |
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/pm.h> | ||
29 | #include <linux/gpio.h> | 30 | #include <linux/gpio.h> |
30 | #include <linux/spi/spi.h> | 31 | #include <linux/spi/spi.h> |
31 | #include <linux/spi/ads7846.h> | 32 | #include <linux/spi/ads7846.h> |
@@ -892,9 +893,10 @@ static irqreturn_t ads7846_irq(int irq, void *handle) | |||
892 | return IRQ_HANDLED; | 893 | return IRQ_HANDLED; |
893 | } | 894 | } |
894 | 895 | ||
895 | static int ads7846_suspend(struct spi_device *spi, pm_message_t message) | 896 | #ifdef CONFIG_PM_SLEEP |
897 | static int ads7846_suspend(struct device *dev) | ||
896 | { | 898 | { |
897 | struct ads7846 *ts = dev_get_drvdata(&spi->dev); | 899 | struct ads7846 *ts = dev_get_drvdata(dev); |
898 | 900 | ||
899 | mutex_lock(&ts->lock); | 901 | mutex_lock(&ts->lock); |
900 | 902 | ||
@@ -914,9 +916,9 @@ static int ads7846_suspend(struct spi_device *spi, pm_message_t message) | |||
914 | return 0; | 916 | return 0; |
915 | } | 917 | } |
916 | 918 | ||
917 | static int ads7846_resume(struct spi_device *spi) | 919 | static int ads7846_resume(struct device *dev) |
918 | { | 920 | { |
919 | struct ads7846 *ts = dev_get_drvdata(&spi->dev); | 921 | struct ads7846 *ts = dev_get_drvdata(dev); |
920 | 922 | ||
921 | mutex_lock(&ts->lock); | 923 | mutex_lock(&ts->lock); |
922 | 924 | ||
@@ -935,6 +937,9 @@ static int ads7846_resume(struct spi_device *spi) | |||
935 | 937 | ||
936 | return 0; | 938 | return 0; |
937 | } | 939 | } |
940 | #endif | ||
941 | |||
942 | static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); | ||
938 | 943 | ||
939 | static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads7846 *ts) | 944 | static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads7846 *ts) |
940 | { | 945 | { |
@@ -1408,11 +1413,10 @@ static struct spi_driver ads7846_driver = { | |||
1408 | .name = "ads7846", | 1413 | .name = "ads7846", |
1409 | .bus = &spi_bus_type, | 1414 | .bus = &spi_bus_type, |
1410 | .owner = THIS_MODULE, | 1415 | .owner = THIS_MODULE, |
1416 | .pm = &ads7846_pm, | ||
1411 | }, | 1417 | }, |
1412 | .probe = ads7846_probe, | 1418 | .probe = ads7846_probe, |
1413 | .remove = __devexit_p(ads7846_remove), | 1419 | .remove = __devexit_p(ads7846_remove), |
1414 | .suspend = ads7846_suspend, | ||
1415 | .resume = ads7846_resume, | ||
1416 | }; | 1420 | }; |
1417 | 1421 | ||
1418 | static int __init ads7846_init(void) | 1422 | static int __init ads7846_init(void) |