From patchwork Mon May 16 08:32:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 787162 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4G8X92C005946 for ; Mon, 16 May 2011 08:33:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752587Ab1EPIdI (ORCPT ); Mon, 16 May 2011 04:33:08 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:57431 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752339Ab1EPIdH (ORCPT ); Mon, 16 May 2011 04:33:07 -0400 Received: from localhost (p548E0028.dip0.t-ipconnect.de [84.142.0.40]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MbcUz-1Q5bGu0yYP-00IsHh; Mon, 16 May 2011 10:33:05 +0200 From: Thierry Reding To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Kwangwoo Lee Subject: [PATCH 1/5] tsc2007: Debounce pressure measurement. Date: Mon, 16 May 2011 10:32:59 +0200 Message-Id: <1305534783-4917-1-git-send-email-thierry.reding@avionic-design.de> X-Mailer: git-send-email 1.7.5.1 X-Provags-ID: V02:K0:vVxdep5tw8oWcihCx+IH63WxNRIHnmw+XzaMj0lHdCD jT2yss6KLelVKicnamD0Up50djxix+YryfCicaIj3Z+uVlM/zM DVmUke3PNAAiac4bYYMMOtN6XZnpW7GeMvzSV+dxkbE0KZoStj g4DdhFiMo+3yfWUheAv5PGcLLq0uckCOgSHCBtbXzxHh9JWlxH SWRMN9ljhjgo/DDQfmi/N5liqhK3yIHCAtjL53Uck8= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 16 May 2011 08:33:09 +0000 (UTC) When the controller signals a pen-down event via the platform-specific GPIO, while the sample values indicate an invalid measurement, the measurement needs to be repeated. Cc: Dmitry Torokhov Cc: Kwangwoo Lee Signed-off-by: Thierry Reding --- drivers/input/touchscreen/tsc2007.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index 80467f2..df4ae35 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c @@ -156,6 +156,7 @@ static void tsc2007_work(struct work_struct *work) { struct tsc2007 *ts = container_of(to_delayed_work(work), struct tsc2007, work); + bool debounced = false; struct ts_event tc; u32 rt; @@ -191,6 +192,7 @@ static void tsc2007_work(struct work_struct *work) * repeat at least once more the measurement. */ dev_dbg(&ts->client->dev, "ignored pressure %d\n", rt); + debounced = true; goto out; } @@ -225,7 +227,7 @@ static void tsc2007_work(struct work_struct *work) } out: - if (ts->pendown) + if (ts->pendown || debounced) schedule_delayed_work(&ts->work, msecs_to_jiffies(TS_POLL_PERIOD)); else