linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Feng Tang <feng.tang@intel.com>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Clark, Joel" <joel.clark@intel.com>
Subject: Re: [PATCH 2/2] Input: tsc2007 - Add a z1_low_threshhold platform data parameter
Date: Sun, 4 Dec 2011 00:54:05 -0800	[thread overview]
Message-ID: <20111204085405.GD14593@core.coreip.homeip.net> (raw)
In-Reply-To: <20111201170455.2e8ebcfc@feng-i7>

On Thu, Dec 01, 2011 at 05:04:55PM +0800, Feng Tang wrote:
> Hi Dmitry,
> 
> 
> On Thu, 1 Dec 2011 16:45:24 +0800
> Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> 
> 
> > > > 
> > > > Even if we add the pressure threshold would not that noise cause
> > > > endless stream of interrupts?
> > > 
> > > No, there is no endless interrupts for tsc2007. Without the z1
> > > threshold, the while circle in tsc2007_soft_irq will run endlessly
> > > as the noise data will be seen as a valid data:
> > > 
> > > 		rt = tsc2007_calculate_pressure(ts, &tc);
> > > 		if (rt == 0 && !ts->get_pendown_state) {
> > > 			/*
> > > 			 * If pressure reported is 0 and we don't
> > > have
> > > 			 * callback to check pendown state, we have
> > > to
> > > 			 * assume that pen was lifted up.
> > > 			 */
> > > 			break;
> > > 		}
> > > 
> > > With the z1 threshold check, the rt will be 0 for noise data, and
> > > the code flow broke out.
> > 
> > What I meant is with the threshold check we'll break out of the ISR
> > but why won't IRQ be raised again?
> 
> The IRQ will be fired again after we exist the tsc2007_soft_irq in my
> test, as I re-enable the irq before existing the code.
> 
> > 
> > > 
> > > > 
> > > > Also, what kind of z2 is reported with low z1? And do you
> > > > implement get_pendown_state()?
> > > 
> > > z2 seems normal as some data between 3000-4000. We don't have a
> > > get_pendown_state().
> > 
> > OK, there is max_rt platform parameter. I think we should employ it
> > instead and break out if we get several incorrect samples in a row.
> > Too bad you do not have a dedicate method.
> > 
> No, the max_rt won't help here, if the rt > max_rt, it won't break the
> while loop, but just issue a warning message
> 
> 		if (rt <= ts->max_rt) {
> 			.......
> 
> 		} else {
> 			/*
> 			 * Sample found inconsistent by debouncing or pressure is
> 			 * beyond the maximum. Don't report it to user space,
> 			 * repeat at least once more the measurement.
> 			 */
> 			dev_dbg(&ts->client->dev, "ignored pressure %d\n", rt);
> 		}

What I meant that we need to ajust the logic to _exit_ the loop if we
receive several samples with rt > max_rt instead of adding a new
parameter.

Thanks.

-- 
Dmitry

  reply	other threads:[~2011-12-04  8:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29  8:12 [PATCH 1/2] Input: tsc2007 - Disable irq when the irq thread is handling data Feng Tang
2011-11-29  8:12 ` [PATCH 2/2] Input: tsc2007 - Add a z1_low_threshhold platform data parameter Feng Tang
2011-11-29  9:23   ` Dmitry Torokhov
2011-11-30  2:34     ` Feng Tang
2011-12-01  5:47       ` Dmitry Torokhov
2011-12-01  6:19         ` Feng Tang
2011-12-01  8:45           ` Dmitry Torokhov
2011-12-01  9:04             ` Feng Tang
2011-12-04  8:54               ` Dmitry Torokhov [this message]
2011-12-05  5:35                 ` Feng Tang
2011-12-26  3:16                   ` Feng Tang
2011-11-29  9:22 ` [PATCH 1/2] Input: tsc2007 - Disable irq when the irq thread is handling data Dmitry Torokhov
2011-11-30  2:08   ` Feng Tang
2011-12-01  6:10     ` Dmitry Torokhov
2011-12-01  6:30       ` Feng Tang
2011-12-01  8:48         ` Dmitry Torokhov
2011-12-01  9:00           ` Feng Tang

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=20111204085405.GD14593@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=feng.tang@intel.com \
    --cc=joel.clark@intel.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).