From: Chung-yih Wang <cywang@chromium.org>
To: Alessandro Rubini <rubini@ipvvis.unipv.it>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
djkurtz@chromium.org, Chung-yih Wang <cywang@chromium.org>
Subject: [PATCH] CHROMIUM: Input: synaptics - filter out the events with low z values
Date: Wed, 22 Feb 2012 15:41:43 +0800 [thread overview]
Message-ID: <1329896503-28394-1-git-send-email-cywang@chromium.org> (raw)
The single touch path imposes a minimum z value (with hysterisis) before
registering BTN_TOUCH. Apply the same (hard coded) threshold when
deciding how many fingers to report in the semi-mt path.
This patch improves performance of the Google Cr-48 chromebook's
extremely sensitive Synaptics profile sensor touchpad by filtering out
touch events for hovering fingers.
Note: We continue to use the same hard coded threshold value used in the
single touch case as it appears this works just as well on these
multitouch profile sensor pads as on whatever pads it was originally
discovered.
Signed-off-by: Chung-Yih Wang <cywang@chromium.org>
---
drivers/input/mouse/synaptics.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 8081a0a..746dbcc 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -568,17 +568,22 @@ static void synaptics_report_semi_mt_slot(struct input_dev *dev, int slot,
}
}
+static bool finger_touched(const struct synaptics_hw_state *hw)
+{
+ return (hw->z > 30);
+}
+
static void synaptics_report_semi_mt_data(struct input_dev *dev,
const struct synaptics_hw_state *a,
const struct synaptics_hw_state *b,
int num_fingers)
{
- if (num_fingers >= 2) {
+ if ((num_fingers >= 2) && finger_touched(a) && finger_touched(b)) {
synaptics_report_semi_mt_slot(dev, 0, true, min(a->x, b->x),
min(a->y, b->y));
synaptics_report_semi_mt_slot(dev, 1, true, max(a->x, b->x),
max(a->y, b->y));
- } else if (num_fingers == 1) {
+ } else if ((num_fingers == 1) && finger_touched(a)) {
synaptics_report_semi_mt_slot(dev, 0, true, a->x, a->y);
synaptics_report_semi_mt_slot(dev, 1, false, 0, 0);
} else {
@@ -1040,8 +1045,10 @@ static void synaptics_process_packet(struct psmouse *psmouse)
* BTN_TOUCH has to be first as mousedev relies on it when doing
* absolute -> relative conversion
*/
- if (hw.z > 30) input_report_key(dev, BTN_TOUCH, 1);
- if (hw.z < 25) input_report_key(dev, BTN_TOUCH, 0);
+ if (finger_touched(&hw))
+ input_report_key(dev, BTN_TOUCH, 1);
+ if (hw.z < 25)
+ input_report_key(dev, BTN_TOUCH, 0);
if (num_fingers > 0) {
input_report_abs(dev, ABS_X, hw.x);
--
1.7.7.3
next reply other threads:[~2012-02-22 7:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-22 7:41 Chung-yih Wang [this message]
2012-02-22 8:38 ` [PATCH] CHROMIUM: Input: synaptics - filter out the events with low z values Henrik Rydberg
2012-02-22 10:26 ` Daniel Kurtz
2012-02-22 11:04 ` Henrik Rydberg
2012-02-22 13:12 ` Daniel Kurtz
2012-02-22 15:24 ` Henrik Rydberg
2012-02-24 8:27 ` Dmitry Torokhov
2012-02-24 9:08 ` Henrik Rydberg
2012-02-24 9:14 ` Dmitry Torokhov
2012-02-24 9:16 ` Dmitry Torokhov
2012-02-24 9:23 ` Henrik Rydberg
-- strict thread matches above, loose matches on Subject: below --
2012-02-21 15:07 Chung-yih Wang
2012-02-21 16:35 ` Daniel Kurtz
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=1329896503-28394-1-git-send-email-cywang@chromium.org \
--to=cywang@chromium.org \
--cc=djkurtz@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rubini@ipvvis.unipv.it \
/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).