]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Input: edt-ft5x06 - work around FT5506 firmware bug
authorFranklin S Cooper Jr <fcooper@ti.com>
Fri, 16 Oct 2015 22:34:41 +0000 (15:34 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 16 Oct 2015 23:58:45 +0000 (16:58 -0700)
In the touchscreen controller ISR, reading the tsc starting from
register 0x2 causes the tsc to infrequently update the detected
finger's x and y coordinate. The irq pin toggles at a fast rate to
indicate touch events are happening. However, the tsc on average
updates the touch point's x and y value every ~100 ms which is much
slower than the advertised rate of 100+ Hz. This leads to multiple reads
within this ~100 ms time window returning the same value.

Example:
X: 10 , Y: 30
X: 10 , Y: 30
X: 10,  Y: 30
..
// After 100 ms
X: 300, Y: 300
X: 300, y: 300
..
// After 100 ms
X: 1743, Y: 621
X: 1743, Y: 621

For some reason if instead of starting to read at register 0x2 you
start reading at register 0x0 this issue isn't seen. This seems like
a quirk only seen in the EDT FT5506 so to fix this issue simply
adjust the code to start reading from 0x0. Technically this isn't wrong
so no regressions should be seen with other touchscreen controllers
supported by this driver.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/edt-ft5x06.c

index 214d8a08a469e97e54d2f7ae68e4c948bccc460d..0b0f8c17f3f7e0f4df1e69144d693b46741f4025 100644 (file)
@@ -172,7 +172,7 @@ 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[61];
+       u8 rdbuf[63];
        int i, type, x, y, id;
        int offset, tplen, datalen, crclen;
        int error;
@@ -186,8 +186,8 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
                break;
 
        case M09:
-               cmd = 0x02;
-               offset = 1;
+               cmd = 0x0;
+               offset = 3;
                tplen = 6;
                crclen = 0;
                break;