@@ -271,15 +271,20 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse)
* byte 3: . . w1 w0 . . . .
*/
width = ((packet[1] & 0xf0) >> 2) | ((packet[3] & 0x30) >> 4);
- input_report_abs(dev, ABS_TOOL_WIDTH, width);
- input_report_abs(dev, ABS_X,
- ((packet[1] & 0x07) << 8) | packet[2]);
+ x1 = ((packet[1] & 0x07) << 8) | packet[2];
/*
* byte 4: . . . . . . y9 y8
* byte 5: y7 y6 y5 y4 y3 y2 y1 y0
*/
- input_report_abs(dev, ABS_Y,
- ETP_YMAX_V2 - (((packet[4] & 0x03) << 8) | packet[5]));
+ y1 = ETP_YMAX_V2 - (((packet[4] & 0x03) << 8) | packet[5]);
+ /* Multitouch */
+ input_report_abs(dev, ABS_MT_POSITION_X, x1);
+ input_report_abs(dev, ABS_MT_POSITION_Y, y1);
+ input_mt_sync(dev);
+
+ input_report_abs(dev, ABS_TOOL_WIDTH, width);
+ input_report_abs(dev, ABS_X, x1);
+ input_report_abs(dev, ABS_Y, y1);
break;
case 2:
@@ -299,6 +304,13 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse)
x2 = ((packet[3] & 0x10) << 4) | packet[4];
/* byte 5: by7 by6 by5 by4 by3 by2 by1 by0 */
y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]);
+ /* Multitouch */
+ input_report_abs(dev, ABS_MT_POSITION_X, x1 << 2);
+ input_report_abs(dev, ABS_MT_POSITION_Y, y1 << 2);
+ input_mt_sync(dev);
+ input_report_abs(dev, ABS_MT_POSITION_X, x2 << 2);
+ input_report_abs(dev, ABS_MT_POSITION_Y, y2 << 2);
+ input_mt_sync(dev);
/*
* For compatibility with the X Synaptics driver scale up
* one coordinate and report as ordinary mouse movent
@@ -483,6 +495,8 @@ static void elantech_set_input_params(struct psmouse *psmouse)
input_set_abs_params(dev, ABS_TOOL_WIDTH, ETP_WMIN_V2, ETP_WMAX_V2, 0, 0);
input_set_abs_params(dev, ABS_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0);
input_set_abs_params(dev, ABS_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0);
+ input_set_abs_params(dev, ABS_MT_POSITION_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0);
+ input_set_abs_params(dev, ABS_MT_POSITION_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0);
input_set_abs_params(dev, ABS_HAT0X, ETP_2FT_XMIN, ETP_2FT_XMAX, 0, 0);
input_set_abs_params(dev, ABS_HAT0Y, ETP_2FT_YMIN, ETP_2FT_YMAX, 0, 0);
input_set_abs_params(dev, ABS_HAT1X, ETP_2FT_XMIN, ETP_2FT_XMAX, 0, 0);