From: <michael.hennerich@analog.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org,
device-drivers-devel@blackfin.uclinux.org, drivers@analog.com,
Michael Hennerich <michael.hennerich@analog.com>
Subject: [PATCH 3/3] Input: touchscreen: ad7877 filter events where pressure is beyond the maximum
Date: Fri, 15 Oct 2010 12:40:50 +0200 [thread overview]
Message-ID: <1287139250-24777-3-git-send-email-michael.hennerich@analog.com> (raw)
In-Reply-To: <1287139250-24777-1-git-send-email-michael.hennerich@analog.com>
From: Michael Hennerich <michael.hennerich@analog.com>
Suppress events where pressure > pressure_max.
These events come typically along with inaccurate X and Y samples.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
drivers/input/touchscreen/ad7877.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c
index 96c0a0d..e6917db 100644
--- a/drivers/input/touchscreen/ad7877.c
+++ b/drivers/input/touchscreen/ad7877.c
@@ -360,6 +360,13 @@ static int ad7877_rx(struct ad7877 *ts)
Rt /= z1;
Rt = (Rt + 2047) >> 12;
+ /*
+ * Sample found inconsistent, pressure is beyond
+ * the maximum. Don't report it to user space.
+ */
+ if (Rt > ts->pressure_max)
+ return -EINVAL;
+
if (!timer_pending(&ts->timer))
input_report_key(input_dev, BTN_TOUCH, 1);
--
1.6.0.2
next prev parent reply other threads:[~2010-10-15 10:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-15 10:40 [PATCH 1/3] Input: touchscreen: ad7877 implement specified chip select behavior michael.hennerich
2010-10-15 10:40 ` [PATCH 2/3] Input: touchscreen: ad7877 implement EV_KEY:BTN_TOUCH reporting michael.hennerich
2010-10-15 10:40 ` michael.hennerich [this message]
2010-10-16 1:51 ` [Device-drivers-devel] [PATCH 3/3] Input: touchscreen: ad7877 filter events where pressure is beyond the maximum Mike Frysinger
2010-10-18 4:08 ` Dmitry Torokhov
2010-10-18 4:24 ` Dmitry Torokhov
2010-10-18 4:25 ` Dmitry Torokhov
2010-10-18 8:13 ` Hennerich, Michael
2010-10-18 8:22 ` Dmitry Torokhov
2010-10-18 8:12 ` Hennerich, Michael
2010-10-15 16:56 ` [PATCH 1/3] Input: touchscreen: ad7877 implement specified chip select behavior Dmitry Torokhov
-- strict thread matches above, loose matches on Subject: below --
2010-10-15 10:36 michael.hennerich
2010-10-15 10:36 ` [PATCH 3/3] Input: touchscreen: ad7877 filter events where pressure is beyond the maximum michael.hennerich
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=1287139250-24777-3-git-send-email-michael.hennerich@analog.com \
--to=michael.hennerich@analog.com \
--cc=device-drivers-devel@blackfin.uclinux.org \
--cc=dmitry.torokhov@gmail.com \
--cc=drivers@analog.com \
--cc=linux-input@vger.kernel.org \
/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).