From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH 2/2] Input: tsc2007 - Add a z1_low_threshhold platform data parameter Date: Thu, 1 Dec 2011 00:45:24 -0800 Message-ID: <20111201084524.GB31610@core.coreip.homeip.net> References: <1322554378-348-1-git-send-email-feng.tang@intel.com> <1322554378-348-2-git-send-email-feng.tang@intel.com> <20111129092310.GB21758@core.coreip.homeip.net> <20111130103418.4514b630@feng-i7> <20111201054726.GC16816@core.coreip.homeip.net> <20111201141948.13162071@feng-i7> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-iy0-f174.google.com ([209.85.210.174]:56229 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753218Ab1LAIpa (ORCPT ); Thu, 1 Dec 2011 03:45:30 -0500 Content-Disposition: inline In-Reply-To: <20111201141948.13162071@feng-i7> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Feng Tang Cc: "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Clark, Joel" On Thu, Dec 01, 2011 at 02:19:48PM +0800, Feng Tang wrote: > On Thu, 1 Dec 2011 13:47:26 +0800 > Dmitry Torokhov wrote: > > > On Wed, Nov 30, 2011 at 10:34:18AM +0800, Feng Tang wrote: > > > On Tue, 29 Nov 2011 17:23:10 +0800 > > > Dmitry Torokhov wrote: > > > > > > > On Tue, Nov 29, 2011 at 04:12:58PM +0800, Feng Tang wrote: > > > > > This originates from a patch in Meego IVI kernel with the name > > > > > linux-2.6.37-connext-0027-tsc2007.patch > > > > > There is no author info excepte a line "From MeeGo > > > > > " > > > > > > > > > > When integrating tsc2007 on Intel IVI platform, there are a lot > > > > > of noise data whose z1 value is around 10 which is not a sane > > > > > "z1". So add a "z1_low_threshhold" to filter those nosie data, > > > > > to make the device work properly. > > > > > > > > Sounds like a task for userspace to ignore pressure that is too > > > > low. Bonus points for making it configurable so user can adjust > > > > sensitivity. > > > > > > Actually, there is one more point :), without this patch, the > > > driver won't work on our platforms. > > > > > > The tsc2007_soft_irq will keep reading the input data unless there > > > is no valid pressure data. In our case, those noise data will be > > > seen as valid data during tsc2007_calculate_pressure(), and the > > > tsc2007_soft_irq will run endlessly. > > > > 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? > > > > > 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. -- Dmitry