input: eeti_egalax_i2c: never report ABS_MT_TOUCH_MAJOR with 0
author黄涛 <huangtao@rock-chips.com>
Wed, 30 Nov 2011 11:41:47 +0000 (19:41 +0800)
committer黄涛 <huangtao@rock-chips.com>
Wed, 30 Nov 2011 11:42:51 +0000 (19:42 +0800)
drivers/input/touchscreen/eeti_egalax_i2c.c

index af0c5f0ed8e440275d9224161d164d145c7d29e0..8177406c93731cd83ebd3f2ce4e02118e93db112 100755 (executable)
@@ -371,21 +371,20 @@ static void ProcessReport(unsigned char *buf, int buflen)
        {
                for(i=0; i<MAX_SUPPORT_POINT;i++)
                {
-                       if(PointBuf[i].Status >= 0)
+                       if(PointBuf[i].Status > 0)
                        {
                                input_mt_slot(input_dev, i);
                                input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, true);
                                input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, PointBuf[i].Status);
                                input_report_abs(input_dev, ABS_MT_POSITION_X, PointBuf[i].X);
                                input_report_abs(input_dev, ABS_MT_POSITION_Y, PointBuf[i].Y);
-
-                               if(PointBuf[i].Status == 0)
-                                       PointBuf[i].Status--;
+                               PointBuf[i].Status = 0;
                        }
-                       else
+                       else if (PointBuf[i].Status == 0)
                        {
                                input_mt_slot(input_dev, i);
                                input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, false);
+                               PointBuf[i].Status = -1;
                        }
                }
                input_sync(input_dev);
@@ -505,10 +504,11 @@ static void egalax_i2c_wq(struct work_struct *work)
                                input_report_abs(input_dev, ABS_MT_POSITION_Y, PointBuf[i].Y);
                                PointBuf[i].Status = 0;
                        }
-                       else
+                       else if (PointBuf[i].Status == 0)
                        {
                                input_mt_slot(input_dev, i);
                                input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, false);
+                               PointBuf[i].Status = -1;
                        }
                }
                input_sync(input_dev);