Commit c789f1fb authored by Franklin S Cooper Jr's avatar Franklin S Cooper Jr Committed by Dmitry Torokhov

Input: edt-ft5x06 - use max support points to determine how much to read

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: default avatarFranklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 3a341a4c
...@@ -168,9 +168,9 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) ...@@ -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 edt_ft5x06_ts_data *tsdata = dev_id;
struct device *dev = &tsdata->client->dev; struct device *dev = &tsdata->client->dev;
u8 cmd; u8 cmd;
u8 rdbuf[29]; u8 rdbuf[31];
int i, type, x, y, id; int i, type, x, y, id;
int offset, tplen, datalen; int offset, tplen, datalen, crclen;
int error; int error;
switch (tsdata->version) { switch (tsdata->version) {
...@@ -178,14 +178,14 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) ...@@ -178,14 +178,14 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
cmd = 0xf9; /* tell the controller to send touch data */ cmd = 0xf9; /* tell the controller to send touch data */
offset = 5; /* where the actual touch data starts */ offset = 5; /* where the actual touch data starts */
tplen = 4; /* data comes in so called frames */ tplen = 4; /* data comes in so called frames */
datalen = 26; /* how much bytes to listen for */ crclen = 1; /* length of the crc data */
break; break;
case M09: case M09:
cmd = 0x02; cmd = 0x02;
offset = 1; offset = 1;
tplen = 6; tplen = 6;
datalen = 29; crclen = 0;
break; break;
default: default:
...@@ -193,6 +193,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) ...@@ -193,6 +193,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
} }
memset(rdbuf, 0, sizeof(rdbuf)); memset(rdbuf, 0, sizeof(rdbuf));
datalen = tplen * MAX_SUPPORT_POINTS + offset + crclen;
error = edt_ft5x06_ts_readwrite(tsdata->client, error = edt_ft5x06_ts_readwrite(tsdata->client,
sizeof(cmd), &cmd, sizeof(cmd), &cmd,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment