From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Patil, Rachna" <rachna@ti.com>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Subject: Re: [PATCH v2] input: add support for TI Touchscreen controller
Date: Sun, 4 Mar 2012 08:03:17 -0800 [thread overview]
Message-ID: <20120304160317.GC27647@core.coreip.homeip.net> (raw)
In-Reply-To: <4CE347531D4CA947960AF71FF095B93201B58E@DBDE01.ent.ti.com>
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
next prev parent reply other threads:[~2012-03-04 22:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-09 11:29 [PATCH v2] input: add support for TI Touchscreen controller Patil, Rachna
2011-12-30 3:55 ` Dmitry Torokhov
2012-01-02 12:21 ` Patil, Rachna
2012-01-03 6:43 ` Patil, Rachna
2012-01-05 5:50 ` Patil, Rachna
2012-03-04 16:03 ` Dmitry Torokhov [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-07-14 5:02 [PATCH V2] " Patil, Rachna
2011-07-20 13:12 ` Patil, Rachna
2011-07-22 6:35 ` Dmitry Torokhov
2011-07-22 9:12 ` Patil, Rachna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120304160317.GC27647@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=rachna@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).