From patchwork Tue May 17 08:56:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 790992 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4H8uIRG027039 for ; Tue, 17 May 2011 08:56:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752303Ab1EQI4R (ORCPT ); Tue, 17 May 2011 04:56:17 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:51567 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752084Ab1EQI4R (ORCPT ); Tue, 17 May 2011 04:56:17 -0400 Received: from localhost (p548E0077.dip0.t-ipconnect.de [84.142.0.119]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0LjdQ8-1PpOEA2dGS-00c1hw; Tue, 17 May 2011 10:56:14 +0200 From: Thierry Reding To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Kwangwoo Lee Subject: [PATCH v2 3/5] tsc2007: Add poll_delay parameter to platform data. Date: Tue, 17 May 2011 10:56:10 +0200 Message-Id: <1305622572-3154-3-git-send-email-thierry.reding@avionic-design.de> X-Mailer: git-send-email 1.7.5.1 X-Provags-ID: V02:K0:7k+xjBKzpxyLkioW9Iff2KBYgYG7qZUCMf8wnP7+4ge lBR3NN8lfdbzzAHajf/WFyjKv+lotpj+G6PJYR7L6Ih2et/o8K MkUYTUOKzNYXCHn80OQ/E3T797SzVc+vc5hvx9euzPlR7mu5gm W91z23d+m4pHdjNTpFn1L0rleCsjEN5hIToAd1kdY/7SadpLAC d0VNJtuf0GPp3rMvLowU5w+R+TlqTKMLNT1c4eYV4YZ8AUzrJS qyZTyNMPF/kjf 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 (demeter2.kernel.org [140.211.167.43]); Tue, 17 May 2011 08:56:19 +0000 (UTC) Depending on the quality of the touch panel, the time for the X-, X+, Y- and Y+ inputs to settle may vary. The poll_delay parameter can be used to override the default of 1 millisecond. Changes in v2: - Move poll_delay parameter to platform data. Cc: Dmitry Torokhov Cc: Kwangwoo Lee Signed-off-by: Thierry Reding --- drivers/input/touchscreen/tsc2007.c | 5 +++-- include/linux/i2c/tsc2007.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index 8c48a91..faa82dd 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c @@ -27,7 +27,6 @@ #include #include -#define TS_POLL_DELAY 1 /* ms delay between samples */ #define TS_POLL_PERIOD 1 /* ms delay between samples */ #define TSC2007_MEASURE_TEMP0 (0x0 << 4) @@ -76,6 +75,7 @@ struct tsc2007 { u16 model; u16 x_plate_ohms; u16 max_rt; + unsigned long poll_delay; bool pendown; int irq; @@ -242,7 +242,7 @@ static irqreturn_t tsc2007_irq(int irq, void *handle) if (!ts->get_pendown_state || likely(ts->get_pendown_state())) { disable_irq_nosync(ts->irq); schedule_delayed_work(&ts->work, - msecs_to_jiffies(TS_POLL_DELAY)); + msecs_to_jiffies(ts->poll_delay)); } if (ts->clear_penirq) @@ -296,6 +296,7 @@ static int __devinit tsc2007_probe(struct i2c_client *client, ts->model = pdata->model; ts->x_plate_ohms = pdata->x_plate_ohms; ts->max_rt = pdata->max_rt ? : MAX_12BIT; + ts->poll_delay = pdata->poll_delay ? : 1; ts->get_pendown_state = pdata->get_pendown_state; ts->clear_penirq = pdata->clear_penirq; diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h index d95f113..342b130 100644 --- a/include/linux/i2c/tsc2007.h +++ b/include/linux/i2c/tsc2007.h @@ -7,6 +7,8 @@ struct tsc2007_platform_data { u16 model; /* 2007. */ u16 x_plate_ohms; u16 max_rt; /* max. resistance above which samples are ignored */ + unsigned long poll_delay; /* delay (in ms) after pen-down event + before polling starts */ int (*get_pendown_state)(void); void (*clear_penirq)(void); /* If needed, clear 2nd level