Commit 834c2e12b7fc2367b92e1e99f7c8ed19c1d1e477
Committed by
Sekhar Nori
1 parent
bdc73d21cb
Exists in
ti-lsk-linux-4.1.y
and in
5 other branches
Input: edt-ft5x06 - Use max support points to determine read length
Calculate the amount of data that needs to be read for 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: Sekhar Nori <nsekhar@ti.com>
Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff
drivers/input/touchscreen/edt-ft5x06.c
... | ... | @@ -180,14 +180,16 @@ |
180 | 180 | cmd = 0xf9; /* tell the controller to send touch data */ |
181 | 181 | offset = 5; /* where the actual touch data starts */ |
182 | 182 | tplen = 4; /* data comes in so called frames */ |
183 | - datalen = 26; /* how much bytes to listen for */ | |
183 | + | |
184 | + /* how many bytes to listen for */ | |
185 | + datalen = tplen * MAX_SUPPORT_POINTS + offset + 1; | |
184 | 186 | break; |
185 | 187 | |
186 | 188 | case M09: |
187 | 189 | cmd = 0x02; |
188 | 190 | offset = 1; |
189 | 191 | tplen = 6; |
190 | - datalen = 29; | |
192 | + datalen = tplen * MAX_SUPPORT_POINTS + 1 - cmd; | |
191 | 193 | break; |
192 | 194 | |
193 | 195 | default: |