[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111205133541.74b72788@feng-i7>
Date: Mon, 5 Dec 2011 13:35:41 +0800
From: Feng Tang <feng.tang@...el.com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
CC: "linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Clark, Joel" <joel.clark@...el.com>
Subject: Re: [PATCH 2/2] Input: tsc2007 - Add a z1_low_threshhold platform
data parameter
Hi Dmitry,
On Sun, 4 Dec 2011 16:54:05 +0800
Dmitry Torokhov <dmitry.torokhov@...il.com> wrote:
> 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@...il.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.
Yes, I did try a similar way to set a retry limit which also works
basically, code is like this
@@ -169,6 +169,7 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
struct tsc2007 *ts = handle;
struct input_dev *input = ts->input;
struct ts_event tc;
+ u32 max_retry = 2;
u32 rt;
while (!ts->stopped && tsc2007_is_pen_down(ts)) {
@@ -206,6 +207,8 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
* repeat at least once more the measurement.
*/
dev_dbg(&ts->client->dev, "ignored pressure %d\n", rt);
+ if (!--max_retry)
+ break;
}
But I still have some concerns:
1. How many retries should we try? the tsc2007_read_values() will take about 70 ms
on our platform, plus the "poll_period", one retry will take about 100ms.
2. I checked the noise data, its z1 value is always in a range from 9 to 13, while
the real data's z1 is always bigger than 300. So I think there is a very clear gap
to tell the noise data from valid data by z1 value.
How do you think about it?
Thanks,
Feng
>
> Thanks.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists