aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ads7846.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/ads7846.c')
-rw-r--r--drivers/input/touchscreen/ads7846.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 8b05d8e97543..532279cda0e4 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -36,6 +36,7 @@
36 * TSC2046 is just newer ads7846 silicon. 36 * TSC2046 is just newer ads7846 silicon.
37 * Support for ads7843 tested on Atmel at91sam926x-EK. 37 * Support for ads7843 tested on Atmel at91sam926x-EK.
38 * Support for ads7845 has only been stubbed in. 38 * Support for ads7845 has only been stubbed in.
39 * Support for Analog Devices AD7873 and AD7843 tested.
39 * 40 *
40 * IRQ handling needs a workaround because of a shortcoming in handling 41 * IRQ handling needs a workaround because of a shortcoming in handling
41 * edge triggered IRQs on some platforms like the OMAP1/2. These 42 * edge triggered IRQs on some platforms like the OMAP1/2. These
@@ -821,6 +822,9 @@ static int ads7846_suspend(struct spi_device *spi, pm_message_t message)
821 822
822 spin_unlock_irq(&ts->lock); 823 spin_unlock_irq(&ts->lock);
823 824
825 if (device_may_wakeup(&ts->spi->dev))
826 enable_irq_wake(ts->spi->irq);
827
824 return 0; 828 return 0;
825 829
826} 830}
@@ -829,6 +833,9 @@ static int ads7846_resume(struct spi_device *spi)
829{ 833{
830 struct ads7846 *ts = dev_get_drvdata(&spi->dev); 834 struct ads7846 *ts = dev_get_drvdata(&spi->dev);
831 835
836 if (device_may_wakeup(&ts->spi->dev))
837 disable_irq_wake(ts->spi->irq);
838
832 spin_lock_irq(&ts->lock); 839 spin_lock_irq(&ts->lock);
833 840
834 ts->is_suspended = 0; 841 ts->is_suspended = 0;
@@ -984,6 +991,15 @@ static int __devinit ads7846_probe(struct spi_device *spi)
984 991
985 vref = pdata->keep_vref_on; 992 vref = pdata->keep_vref_on;
986 993
994 if (ts->model == 7873) {
995 /* The AD7873 is almost identical to the ADS7846
996 * keep VREF off during differential/ratiometric
997 * conversion modes
998 */
999 ts->model = 7846;
1000 vref = 0;
1001 }
1002
987 /* set up the transfers to read touchscreen state; this assumes we 1003 /* set up the transfers to read touchscreen state; this assumes we
988 * use formula #2 for pressure, not #3. 1004 * use formula #2 for pressure, not #3.
989 */ 1005 */
@@ -1191,6 +1207,8 @@ static int __devinit ads7846_probe(struct spi_device *spi)
1191 if (err) 1207 if (err)
1192 goto err_remove_attr_group; 1208 goto err_remove_attr_group;
1193 1209
1210 device_init_wakeup(&spi->dev, pdata->wakeup);
1211
1194 return 0; 1212 return 0;
1195 1213
1196 err_remove_attr_group: 1214 err_remove_attr_group:
@@ -1220,6 +1238,8 @@ static int __devexit ads7846_remove(struct spi_device *spi)
1220{ 1238{
1221 struct ads7846 *ts = dev_get_drvdata(&spi->dev); 1239 struct ads7846 *ts = dev_get_drvdata(&spi->dev);
1222 1240
1241 device_init_wakeup(&spi->dev, false);
1242
1223 ads784x_hwmon_unregister(spi, ts); 1243 ads784x_hwmon_unregister(spi, ts);
1224 input_unregister_device(ts->input); 1244 input_unregister_device(ts->input);
1225 1245