Skip to contentSkip to conversation

ads7846 sample settling

PATCH RESEND In review David Brownell 2 participants 3 messages Jul 13, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/2 ads7846 sample settling

From: Semih Hazar <[email protected]>

The ads7846 driver has support for filtering, but when the chip gets deselected between samples this causes noise. This patch adds support for an optional settling delay time, so that two consecutive samples will be taken with the specified delay time apart. This ensures that the chip won't be deselected, so the noise won't appear.

Filtering can still be done, but will have less work to do since each time a new sample is taken the same delay applies.

---
Still applies fine against 2.6.22-git ... this should be in 2.6.23

 drivers/input/touchscreen/ads7846.c |   65 +++++++++++++++++++++++++++++++++++-
 include/linux/spi/ads7846.h         |    8 ++++
 2 files changed, 72 insertions(+), 1 deletion(-)
include/linux/spi/ads7846.h +8 -0
@@ -16,6 +16,14 @@ struct ads7846_platform_data {
 	u16	vref_delay_usecs;	/* 0 for external vref; etc */
 	int	keep_vref_on:1;		/* set to keep vref on for differential
 					 * measurements as well */
+
+	/* Settling time of the analog signals; a function of Vcc and the
+	 * capacitance on the X/Y drivers.  If set to non-zero, two samples
+	 * are taken with settle_delay us apart, and the second one is used.
+	 * ~150 uSec with 0.01uF caps.
+	 */
+	u16	settle_delay_usecs;
+
 	u16	x_plate_ohms;
 	u16	y_plate_ohms;
 
drivers/input/touchscreen/ads7846.c +64 -1

95 lines not on this page · raw message

maintainer
#1 lore raw

HI David,

Quoted 8 lines · David Brownell

From: Semih Hazar <[email protected]>

The ads7846 driver has support for filtering, but when the chip gets deselected between samples this causes noise. This patch adds support for an optional settling delay time, so that two consecutive samples will be taken with the specified delay time apart. This ensures that the chip won't be deselected, so the noise won't appear.

Sorry for being unresponsive. I have both patches in my tree and I will push them to Linus with my next batch for 2.6.23-pre-rc1.

Signature · 1 line
Dmitry
#2 lore raw
Quoted 13 lines · Dmitry Torokhov

HI David,

Quoted 8 lines · David Brownell

From: Semih Hazar <[email protected]>

The ads7846 driver has support for filtering, but when the chip gets deselected between samples this causes noise. This patch adds support for an optional settling delay time, so that two consecutive samples will be taken with the specified delay time apart. This ensures that the chip won't be deselected, so the noise won't appear.

Quoted 1 line

Sorry for being unresponsive.

It happens to all of us sometimes! No real problem.

Quoted 2 lines

I have both patches in my tree and I
will push them to Linus with my next batch for 2.6.23-pre-rc1.

Great, that's what I wanted to see happen.

Watching this touchscreen driver evolve has been interesting; I hadn't realized it took quite so much work to get accurate measurements! Some touchscreen controllers seem to do the sample quality improvement in hardware (or firmware), but this seems to be the only driver doing this much of the work itself.

- Dave