aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ad7877.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/ad7877.c')
-rw-r--r--drivers/input/touchscreen/ad7877.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c
index a1952fcc083e..714d4e0f9f95 100644
--- a/drivers/input/touchscreen/ad7877.c
+++ b/drivers/input/touchscreen/ad7877.c
@@ -41,6 +41,7 @@
41#include <linux/delay.h> 41#include <linux/delay.h>
42#include <linux/input.h> 42#include <linux/input.h>
43#include <linux/interrupt.h> 43#include <linux/interrupt.h>
44#include <linux/pm.h>
44#include <linux/slab.h> 45#include <linux/slab.h>
45#include <linux/spi/spi.h> 46#include <linux/spi/spi.h>
46#include <linux/spi/ad7877.h> 47#include <linux/spi/ad7877.h>
@@ -826,39 +827,37 @@ static int __devexit ad7877_remove(struct spi_device *spi)
826 return 0; 827 return 0;
827} 828}
828 829
829#ifdef CONFIG_PM 830#ifdef CONFIG_PM_SLEEP
830static int ad7877_suspend(struct spi_device *spi, pm_message_t message) 831static int ad7877_suspend(struct device *dev)
831{ 832{
832 struct ad7877 *ts = dev_get_drvdata(&spi->dev); 833 struct ad7877 *ts = dev_get_drvdata(dev);
833 834
834 ad7877_disable(ts); 835 ad7877_disable(ts);
835 836
836 return 0; 837 return 0;
837} 838}
838 839
839static int ad7877_resume(struct spi_device *spi) 840static int ad7877_resume(struct device *dev)
840{ 841{
841 struct ad7877 *ts = dev_get_drvdata(&spi->dev); 842 struct ad7877 *ts = dev_get_drvdata(dev);
842 843
843 ad7877_enable(ts); 844 ad7877_enable(ts);
844 845
845 return 0; 846 return 0;
846} 847}
847#else
848#define ad7877_suspend NULL
849#define ad7877_resume NULL
850#endif 848#endif
851 849
850static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);
851
852static struct spi_driver ad7877_driver = { 852static struct spi_driver ad7877_driver = {
853 .driver = { 853 .driver = {
854 .name = "ad7877", 854 .name = "ad7877",
855 .bus = &spi_bus_type, 855 .bus = &spi_bus_type,
856 .owner = THIS_MODULE, 856 .owner = THIS_MODULE,
857 .pm = &ad7877_pm,
857 }, 858 },
858 .probe = ad7877_probe, 859 .probe = ad7877_probe,
859 .remove = __devexit_p(ad7877_remove), 860 .remove = __devexit_p(ad7877_remove),
860 .suspend = ad7877_suspend,
861 .resume = ad7877_resume,
862}; 861};
863 862
864static int __init ad7877_init(void) 863static int __init ad7877_init(void)