|
@@ -787,9 +787,11 @@ static int mt_touch_event(struct hid_device *hid, struct hid_field *field,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void mt_process_mt_event(struct hid_device *hid, struct hid_field *field,
|
|
static void mt_process_mt_event(struct hid_device *hid, struct hid_field *field,
|
|
|
- struct hid_usage *usage, __s32 value)
|
|
|
|
|
|
|
+ struct hid_usage *usage, __s32 value,
|
|
|
|
|
+ bool first_packet)
|
|
|
{
|
|
{
|
|
|
struct mt_device *td = hid_get_drvdata(hid);
|
|
struct mt_device *td = hid_get_drvdata(hid);
|
|
|
|
|
+ __s32 cls = td->mtclass.name;
|
|
|
__s32 quirks = td->mtclass.quirks;
|
|
__s32 quirks = td->mtclass.quirks;
|
|
|
struct input_dev *input = field->hidinput->input;
|
|
struct input_dev *input = field->hidinput->input;
|
|
|
|
|
|
|
@@ -846,6 +848,15 @@ static void mt_process_mt_event(struct hid_device *hid, struct hid_field *field,
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
default:
|
|
|
|
|
+ /*
|
|
|
|
|
+ * For Win8 PTP touchpads we should only look at
|
|
|
|
|
+ * non finger/touch events in the first_packet of
|
|
|
|
|
+ * a (possible) multi-packet frame.
|
|
|
|
|
+ */
|
|
|
|
|
+ if ((cls == MT_CLS_WIN_8 || cls == MT_CLS_WIN_8_DUAL) &&
|
|
|
|
|
+ !first_packet)
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
if (usage->type)
|
|
if (usage->type)
|
|
|
input_event(input, usage->type, usage->code,
|
|
input_event(input, usage->type, usage->code,
|
|
|
value);
|
|
value);
|
|
@@ -866,6 +877,7 @@ static void mt_touch_report(struct hid_device *hid, struct hid_report *report)
|
|
|
struct mt_device *td = hid_get_drvdata(hid);
|
|
struct mt_device *td = hid_get_drvdata(hid);
|
|
|
__s32 cls = td->mtclass.name;
|
|
__s32 cls = td->mtclass.name;
|
|
|
struct hid_field *field;
|
|
struct hid_field *field;
|
|
|
|
|
+ bool first_packet;
|
|
|
unsigned count;
|
|
unsigned count;
|
|
|
int r, n, scantime = 0;
|
|
int r, n, scantime = 0;
|
|
|
|
|
|
|
@@ -901,6 +913,7 @@ static void mt_touch_report(struct hid_device *hid, struct hid_report *report)
|
|
|
}
|
|
}
|
|
|
td->prev_scantime = scantime;
|
|
td->prev_scantime = scantime;
|
|
|
|
|
|
|
|
|
|
+ first_packet = td->num_received == 0;
|
|
|
for (r = 0; r < report->maxfield; r++) {
|
|
for (r = 0; r < report->maxfield; r++) {
|
|
|
field = report->field[r];
|
|
field = report->field[r];
|
|
|
count = field->report_count;
|
|
count = field->report_count;
|
|
@@ -910,7 +923,7 @@ static void mt_touch_report(struct hid_device *hid, struct hid_report *report)
|
|
|
|
|
|
|
|
for (n = 0; n < count; n++)
|
|
for (n = 0; n < count; n++)
|
|
|
mt_process_mt_event(hid, field, &field->usage[n],
|
|
mt_process_mt_event(hid, field, &field->usage[n],
|
|
|
- field->value[n]);
|
|
|
|
|
|
|
+ field->value[n], first_packet);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (td->num_received >= td->num_expected)
|
|
if (td->num_received >= td->num_expected)
|