Title: [8275] trunk: [#5865] Enable ad7843 and ad7873 in current ads7846 driver
Revision
8275
Author
hennerich
Date
2010-02-04 09:37:32 -0500 (Thu, 04 Feb 2010)

Log Message

[#5865] Enable ad7843 and ad7873 in current ads7846 driver
The AD7873 is almost identical to the ADS7846, there is only one
difference related to the Power Management bits PD0 and PD1.
This results in a slightly different PENIRQ enable behavior. For the
AD7873 VREF should turned off during differential measurements.
Add the AD7873/43 to the list of driver supported devices, and prevent
VREF usage during differential/ratiometric conversion modes.

Modified Paths

Diff

Modified: trunk/drivers/input/touchscreen/Kconfig (8274 => 8275)


--- trunk/drivers/input/touchscreen/Kconfig	2010-02-04 09:51:07 UTC (rev 8274)
+++ trunk/drivers/input/touchscreen/Kconfig	2010-02-04 14:37:32 UTC (rev 8275)
@@ -12,17 +12,18 @@
 if INPUT_TOUCHSCREEN
 
 config TOUCHSCREEN_ADS7846
-	tristate "ADS7846/TSC2046 and ADS7843 based touchscreens"
+	tristate "ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens"
 	depends on SPI_MASTER
 	depends on HWMON = n || HWMON
 	help
 	  Say Y here if you have a touchscreen interface using the
-	  ADS7846/TSC2046 or ADS7843 controller, and your board-specific
-	  setup code includes that in its table of SPI devices.
+	  ADS7846/TSC2046/AD7873 or ADS7843/AD7843 controller,
+	  and your board-specific setup code includes that in its
+	  table of SPI devices.
 
 	  If HWMON is selected, and the driver is told the reference voltage
 	  on your board, you will also get hwmon interfaces for the voltage
-	  (and on ads7846/tsc2046, temperature) sensors of this chip.
+	  (and on ads7846/tsc2046/ad7873, temperature) sensors of this chip.
 
 	  If unsure, say N (but it's safe to say "Y").
 

Modified: trunk/drivers/input/touchscreen/ads7846.c (8274 => 8275)


--- trunk/drivers/input/touchscreen/ads7846.c	2010-02-04 09:51:07 UTC (rev 8274)
+++ trunk/drivers/input/touchscreen/ads7846.c	2010-02-04 14:37:32 UTC (rev 8275)
@@ -36,6 +36,7 @@
  * TSC2046 is just newer ads7846 silicon.
  * Support for ads7843 tested on Atmel at91sam926x-EK.
  * Support for ads7845 has only been stubbed in.
+ * Support for Analog Devices AD7873 and AD7843 tested.
  *
  * IRQ handling needs a workaround because of a shortcoming in handling
  * edge triggered IRQs on some platforms like the OMAP1/2. These
@@ -987,6 +988,15 @@
 
 	vref = pdata->keep_vref_on;
 
+	if (ts->model == 7873) {
+		/* The AD7873 is almost identical to the ADS7846
+		 * keep VREF off during differential/ratiometric
+		 * conversion modes
+		 */
+		ts->model = 7846;
+		vref = 0;
+	}
+
 	/* set up the transfers to read touchscreen state; this assumes we
 	 * use formula #2 for pressure, not #3.
 	 */

Modified: trunk/include/linux/spi/ads7846.h (8274 => 8275)


--- trunk/include/linux/spi/ads7846.h	2010-02-04 09:51:07 UTC (rev 8274)
+++ trunk/include/linux/spi/ads7846.h	2010-02-04 14:37:32 UTC (rev 8275)
@@ -12,7 +12,7 @@
 };
 
 struct ads7846_platform_data {
-	u16	model;			/* 7843, 7845, 7846. */
+	u16	model;			/* 7843, 7845, 7846, 7873. */
 	u16	vref_delay_usecs;	/* 0 for external vref; etc */
 	u16	vref_mv;		/* external vref value, milliVolts */
 	bool	keep_vref_on;		/* set to keep vref on for differential
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to