From: Paul Cercueil <paul@crapouillou.net>
To: Bastien Nocera <hadess@hadess.net>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Paul Cercueil <paul@crapouillou.net>
Subject: [PATCH v2] input: goodix: Check the 'buffer status' bit before reading data
Date: Fri, 1 May 2015 14:40:36 +0200 [thread overview]
Message-ID: <1430484036-17541-1-git-send-email-paul@crapouillou.net> (raw)
The MSB of the first byte read via I2C at the coordinates address
indicates whether the data is valid or ready (called "buffer status" in
the datasheets) when an interrupt is raised. Previously, this bit was
ignored, which resulted in a lot of incorrect detections of "finger
removed" events.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
v2: Fix commit message
drivers/input/touchscreen/goodix.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index ca19668..9fa6c5f 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -98,6 +98,9 @@ static int goodix_ts_read_input_report(struct goodix_ts_data *ts, u8 *data)
return error;
}
+ if (!(data[0] & 0x80))
+ return -EAGAIN;
+
touch_num = data[0] & 0x0f;
if (touch_num > GOODIX_MAX_CONTACTS)
return -EPROTO;
--
2.1.4
next reply other threads:[~2015-05-01 12:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-01 12:40 Paul Cercueil [this message]
2015-05-01 14:13 ` Bastien Nocera
2015-05-06 23:54 ` Dmitry Torokhov
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=1430484036-17541-1-git-send-email-paul@crapouillou.net \
--to=paul@crapouillou.net \
--cc=dmitry.torokhov@gmail.com \
--cc=hadess@hadess.net \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®