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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:
> > -
> > -		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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux