]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00239187 input: novatek_ts: fix some point not release issue.
authorZhang Jiejing <jiejing.zhang@freescale.com>
Tue, 8 Jan 2013 04:42:15 +0000 (12:42 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:50 +0000 (08:35 +0200)
This issue is caused by Touch Screen F/W, and it will report a
full package with 0xFF * 6 to notice the point was release.

Add this workaround to fix this issue, fixup the wrong finger id.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
drivers/input/touchscreen/novatek_ts.c

index 84c773225ed444c3d7bfa1c3d08c168100980666..84b1024a78d4cfead7ae54a175f60f3251e43387 100644 (file)
@@ -2,7 +2,7 @@
  * Driver for Novatek NT11003 Multiple Touch Controller
  *
  * Copyright (C) 2012 Novatek Ltd.
- * Copyright (C) 2012 Freescale Semiconductor, Inc.
+ * Copyright (C) 2012-2013 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -30,6 +30,7 @@
 
 #define NOVATEK_MAX_X          1280
 #define NOVATEK_MAX_Y          800
+#define NT_QUIRK_ID            ((0xFF >> 3) - 1)
 
 struct tp_event {
        u16 x;
@@ -118,7 +119,15 @@ static irqreturn_t novatek_ts_threaded_irq_handler(int irq, void *dev_id)
                memset(&event, 0, sizeof(event));
                parser_finger_events(&buffer[i * FINGER_EVENT_LEN], &event);
 
-               if (event.status == 0 /* || event.id > MAX_SUPPORT_POINTS */)
+               /* workaround FW sometime report touch up is not
+                * corrent, but report all 0xFF package, so it lost
+                * track of ID, so workaround by add a touch ID by the
+                * parser id. */
+               if (ts->fingers[i] == FINGER_MOVE && event.status == FINGER_UP
+                   && event.id == NT_QUIRK_ID)
+                       event.id = i;
+
+               if (event.status == 0)
                        continue;
 
                /* ignore the event already up. */