aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranklin S Cooper Jr <fcooper@ti.com>2015-10-16 18:34:05 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-10-16 19:58:44 -0400
commitc789f1fb07e7c5acc04342cb2e2412aa71cd6c18 (patch)
tree302ae1444ca7d407bfff760c16d61e647c5bcf68
parent3a341a4c30d427fd05617087db1564a595f65093 (diff)
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: Franklin S Cooper Jr <fcooper@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/touchscreen/edt-ft5x06.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index a8640c7b6713..a76bc486936c 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)
168 struct edt_ft5x06_ts_data *tsdata = dev_id; 168 struct edt_ft5x06_ts_data *tsdata = dev_id;
169 struct device *dev = &tsdata->client->dev; 169 struct device *dev = &tsdata->client->dev;
170 u8 cmd; 170 u8 cmd;
171 u8 rdbuf[29]; 171 u8 rdbuf[31];
172 int i, type, x, y, id; 172 int i, type, x, y, id;
173 int offset, tplen, datalen; 173 int offset, tplen, datalen, crclen;
174 int error; 174 int error;
175 175
176 switch (tsdata->version) { 176 switch (tsdata->version) {
@@ -178,14 +178,14 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
178 cmd = 0xf9; /* tell the controller to send touch data */ 178 cmd = 0xf9; /* tell the controller to send touch data */
179 offset = 5; /* where the actual touch data starts */ 179 offset = 5; /* where the actual touch data starts */
180 tplen = 4; /* data comes in so called frames */ 180 tplen = 4; /* data comes in so called frames */
181 datalen = 26; /* how much bytes to listen for */ 181 crclen = 1; /* length of the crc data */
182 break; 182 break;
183 183
184 case M09: 184 case M09:
185 cmd = 0x02; 185 cmd = 0x02;
186 offset = 1; 186 offset = 1;
187 tplen = 6; 187 tplen = 6;
188 datalen = 29; 188 crclen = 0;
189 break; 189 break;
190 190
191 default: 191 default:
@@ -193,6 +193,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
193 } 193 }
194 194
195 memset(rdbuf, 0, sizeof(rdbuf)); 195 memset(rdbuf, 0, sizeof(rdbuf));
196 datalen = tplen * MAX_SUPPORT_POINTS + offset + crclen;
196 197
197 error = edt_ft5x06_ts_readwrite(tsdata->client, 198 error = edt_ft5x06_ts_readwrite(tsdata->client,
198 sizeof(cmd), &cmd, 199 sizeof(cmd), &cmd,