Thread (6 messages) flat view 6 messages, 2 authors, 2012-03-04

Re: [PATCH v2] input: add support for TI Touchscreen controller

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2012-03-04 22:09:39

Hi Rachna,

Sorry for not replying earlier.

On Mon, Jan 02, 2012 at 12:21:59PM +0000, Patil, Rachna wrote:
On Fri, Dec 30, 2011 at 09:25:21, Dmitry Torokhov wrote:
quoted
-
-		if (ts_dev->pen == 0) {
-			if ((z1 != 0) && (z2 != 0)) {
-				/* cal pressure using formula
-				 * Resistance(touch) = x plate resistance *
-				 * x postion/4096 * ((z2 / z1) - 1)
-				 */
-				z = z2 - z1;
-				z *= val_x;
-				z *= ts_dev->x_plate_resistance;
-				z /= z1;
-				z = (z + 2047) >> 12;
-
-				if ((diffx < 15) && (diffy < 15)
-						&& (z <= MAX_12BIT)) {
Using defuzz alone does not solve the problem. I am trying to
filter out odd random values from the ADC that are incorrect
(Not only noise). Hence as explained I am using delta algorithm.
As a part of this algorithm I am checking for value being less than 15.
Ah, yes, I misread the original code. But would not that mean that quick
gestures across the screen (resulting in delta being greater than 15)
would be refused as invalid?

Anyway, tslib (the library that is normally used to interface with
touchscreens) has, among many other useful thngs, a 'variance' filter
that should implement what you are trying to do in kernel. What I am
going to do is apply the version of the driver that does not do the
variance filtering (but still has the delta filtering of data in FIFO
queue). We can revisit doing variance (in kernel or elsewhere) if tslib
is not working fot you at a later time.

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help