From: Franklin S Cooper Jr <fcooper@ti.com>
To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, maxime.ripard@free-electrons.com,
LW@KARO-electronics.de, jg1.han@samsung.com,
asaf.vertz@tandemg.com
Cc: Franklin S Cooper Jr <fcooper@ti.com>
Subject: [PATCH 1/4] Input: edt-ft5x06 - Use max support points to determine how much to read
Date: Fri, 16 Oct 2015 09:14:26 -0500 [thread overview]
Message-ID: <1445004869-31986-2-git-send-email-fcooper@ti.com> (raw)
In-Reply-To: <1445004869-31986-1-git-send-email-fcooper@ti.com>
Calculate the amount of data that needs to be read for the specified max
number of support points. If the maximum number of support points changes
then the amount that is read from the touch screen controller should
reflect this.
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
---
Changes since RFC:
Added crclen variable
Simplified datalen algorithm
drivers/input/touchscreen/edt-ft5x06.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index a8640c7..e5b0b5d 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -168,9 +168,9 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
struct edt_ft5x06_ts_data *tsdata = dev_id;
struct device *dev = &tsdata->client->dev;
u8 cmd;
- u8 rdbuf[29];
+ u8 rdbuf[31];
int i, type, x, y, id;
- int offset, tplen, datalen;
+ int offset, tplen, datalen, crclen;
int error;
switch (tsdata->version) {
@@ -178,14 +178,18 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
cmd = 0xf9; /* tell the controller to send touch data */
offset = 5; /* where the actual touch data starts */
tplen = 4; /* data comes in so called frames */
- datalen = 26; /* how much bytes to listen for */
+ crclen = 1; /* length of the crc data */
+
+ /* how many bytes to listen for */
+ datalen = tplen * MAX_SUPPORT_POINTS + offset + crclen;
break;
case M09:
cmd = 0x02;
offset = 1;
tplen = 6;
- datalen = 29;
+ crclen = 0;
+ datalen = tplen * MAX_SUPPORT_POINTS + offset + crclen;
break;
default:
--
2.6.1
next prev parent reply other threads:[~2015-10-16 14:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 14:14 [PATCH 0/4] Input: edt-ft5506 - Adding support for FT5506 Franklin S Cooper Jr
2015-10-16 14:14 ` Franklin S Cooper Jr [this message]
2015-10-16 14:14 ` [PATCH 2/4] Input: edt-ft5x06 - Add support for different max support points Franklin S Cooper Jr
2015-10-16 14:14 ` [PATCH 3/4] Input: edt-ft5x06 - Add support for FT5506 Franklin S Cooper Jr
2015-10-16 14:14 ` [PATCH 4/4] Input: edt-ft5x06 - Work around FT5506 firmware bug Franklin S Cooper Jr
2015-10-17 16:30 ` [PATCH 0/4] Input: edt-ft5506 - Adding support for FT5506 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=1445004869-31986-2-git-send-email-fcooper@ti.com \
--to=fcooper@ti.com \
--cc=LW@KARO-electronics.de \
--cc=asaf.vertz@tandemg.com \
--cc=dmitry.torokhov@gmail.com \
--cc=jg1.han@samsung.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
/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).