* [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch
@ 2013-01-25 13:22 Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 01/25] HID: break out hid_extract_field Benjamin Tissoires
` (25 more replies)
0 siblings, 26 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Hi guys,
finally, I managed to send a new bunch of patches. Sorry for the delay from the
previous version, but meanwhile, I implemented an automatic regressions tests
for hid device [1].
So this series seems pretty big, but it does not break any known devices (I ran
40 successful tests for this series)[2].
To sum up:
- Nexio devices were problematic in the sense they use out of range values for
some of the fields, and consider that the driver won't treat the extra touches
based on the reported contact count.
- fortunately, this behavior (relying on contact count) is compatible with all
the devices I know, which leads to think that this is how the Windows 7/8 driver
manage to handle such a different bunch of devices.
- thanks to the automatic testing, I was able to fix broken devices
(Sharp LC-20FE1-W screen 04dd:9681, Sitronix 1403:5001 and Cando 2087:0a02)
and optimize many others. In order to allow a bisection to be done, I split
the patches in many different ones, one per device type.
- finally, I changed the default class in order to handle the new devices in a
better way.
Cheers,
Benjamin
[1] https://github.com/bentiss/hid-test
[2] https://github.com/bentiss/hid-devices
Benjamin Tissoires (25):
HID: break out hid_extract_field
HID: multitouch: add support for Nexio 42" panel
HID: multitouch: fix Win8 protocol for Sharp like devices
HID: multitouch: ensure that serial devices make no use of contact count
HID: multitouch: fix protocol for Sitronix 1403:5001
HID: multitouch: optimize FlatFrog panels
HID: multitouch: optimize 3M panels
HID: multitouch: optimize Cypress panels
HID: multitouch: optimize eGalax panels
HID: multitouch: optimize Stantum panels
HID: multitouch: optimize Quanta panels
HID: multitouch: optimize Lumio panels
HID: multitouch: optimize MosArt panels
HID: multitouch: optimize Elo panels
HID: multitouch: optimize Hanvon panels
HID: multitouch: optimize IRTouch panels
HID: multitouch: fix protocol for Cando 2087:0a02
HID: multitouch: optimize Cando panels
HID: multitouch: optimize ActionStar panels
HID: multitouch: optimize Atmel panels
HID: multitouch: optimize Ideacom panels
HID: multitouch: optimize LG panels
HID: multitouch: optimize Nexio panels
HID: multitouch: remove useless DUAL_NSMU_CONTACTID class
HID: multitouch: make MT_CLS_ALWAYS_TRUE the new default class
drivers/hid/hid-core.c | 60 +++++++++----
drivers/hid/hid-ids.h | 3 +
drivers/hid/hid-multitouch.c | 206 ++++++++++++++++++++++++++++++-------------
include/linux/hid.h | 1 +
4 files changed, 189 insertions(+), 81 deletions(-)
--
1.8.1
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH 01/25] HID: break out hid_extract_field
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-28 15:04 ` Henrik Rydberg
2013-01-25 13:22 ` [PATCH 02/25] HID: multitouch: add support for Nexio 42" panel Benjamin Tissoires
` (24 subsequent siblings)
25 siblings, 1 reply; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Breaking out this function allows third parties hid drivers to retrieve
the data fields of a hid report in the raw_event callback.
No functional changes, only exports the function.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-core.c | 60 ++++++++++++++++++++++++++++++++++----------------
include/linux/hid.h | 1 +
2 files changed, 42 insertions(+), 19 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 5ae2cb1..ea478f5 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -962,6 +962,45 @@ static void implement(const struct hid_device *hid, __u8 *report,
}
/*
+ * Extract and allocate a data field from a little endian report (bit array).
+ */
+
+s32 *hid_extract_field(const struct hid_device *hid, struct hid_field *field,
+ __u8 *data)
+{
+ unsigned n;
+ unsigned count = field->report_count;
+ unsigned offset = field->report_offset;
+ unsigned size = field->report_size;
+ __s32 min = field->logical_minimum;
+ __s32 max = field->logical_maximum;
+ __s32 *value;
+
+ value = kmalloc(sizeof(__s32) * count, GFP_ATOMIC);
+ if (!value)
+ return value;
+
+ for (n = 0; n < count; n++) {
+
+ value[n] = min < 0 ?
+ snto32(extract(hid, data, offset + n * size, size),
+ size) :
+ extract(hid, data, offset + n * size, size);
+
+ /* Ignore report if ErrorRollOver */
+ if (!(field->flags & HID_MAIN_ITEM_VARIABLE) &&
+ value[n] >= min && value[n] <= max &&
+ field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1) {
+ kfree(value);
+ return NULL;
+ }
+ }
+
+ return value;
+}
+EXPORT_SYMBOL_GPL(hid_extract_field);
+
+/*
* Search an array for a value.
*/
@@ -1059,32 +1098,15 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field,
{
unsigned n;
unsigned count = field->report_count;
- unsigned offset = field->report_offset;
- unsigned size = field->report_size;
__s32 min = field->logical_minimum;
__s32 max = field->logical_maximum;
- __s32 *value;
+ __s32 *value = hid_extract_field(hid, field, data);
- value = kmalloc(sizeof(__s32) * count, GFP_ATOMIC);
if (!value)
return;
for (n = 0; n < count; n++) {
- value[n] = min < 0 ?
- snto32(extract(hid, data, offset + n * size, size),
- size) :
- extract(hid, data, offset + n * size, size);
-
- /* Ignore report if ErrorRollOver */
- if (!(field->flags & HID_MAIN_ITEM_VARIABLE) &&
- value[n] >= min && value[n] <= max &&
- field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1)
- goto exit;
- }
-
- for (n = 0; n < count; n++) {
-
if (HID_MAIN_ITEM_VARIABLE & field->flags) {
hid_process_event(hid, field, &field->usage[n], value[n], interrupt);
continue;
@@ -1102,7 +1124,7 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field,
}
memcpy(field->value, value, count * sizeof(__s32));
-exit:
+
kfree(value);
}
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 828726c..91bfee4 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -718,6 +718,7 @@ extern int hidinput_connect(struct hid_device *hid, unsigned int force);
extern void hidinput_disconnect(struct hid_device *);
int hid_set_field(struct hid_field *, unsigned, __s32);
+s32 *hid_extract_field(const struct hid_device *, struct hid_field *, __u8 *);
int hid_input_report(struct hid_device *, int type, u8 *, int, int);
int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
struct hid_field *hidinput_get_led_field(struct hid_device *hid);
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 02/25] HID: multitouch: add support for Nexio 42" panel
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 01/25] HID: break out hid_extract_field Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-28 15:01 ` Henrik Rydberg
2013-01-25 13:22 ` [PATCH 03/25] HID: multitouch: fix Win8 protocol for Sharp like devices Benjamin Tissoires
` (23 subsequent siblings)
25 siblings, 1 reply; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
This device is the worst device I saw. It keeps TipSwitch and InRange
at 1 for fingers that are not touching the panel.
The solution is to rely on the field ContactCount, which is accurate
as the correct information are packed at the begining of the frame.
Unfortunately, CountactCount is most of the time at the end of the report.
The solution is to pick it when we have the whole report in raw_event.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-ids.h | 3 ++
drivers/hid/hid-multitouch.c | 91 ++++++++++++++++++++++++++++++++++++--------
2 files changed, 78 insertions(+), 16 deletions(-)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index dad56aa..0935012 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -597,6 +597,9 @@
#define USB_VENDOR_ID_NEC 0x073e
#define USB_DEVICE_ID_NEC_USB_GAME_PAD 0x0301
+#define USB_VENDOR_ID_NEXIO 0x1870
+#define USB_DEVICE_ID_NEXIO_MULTITOUCH_420 0x010d
+
#define USB_VENDOR_ID_NEXTWINDOW 0x1926
#define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 46d8136..c4acdd0 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -32,6 +32,8 @@
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/input/mt.h>
+#include <asm/unaligned.h>
+#include <asm/byteorder.h>
#include "usbhid/usbhid.h"
@@ -54,6 +56,7 @@ MODULE_LICENSE("GPL");
#define MT_QUIRK_NO_AREA (1 << 9)
#define MT_QUIRK_IGNORE_DUPLICATES (1 << 10)
#define MT_QUIRK_HOVERING (1 << 11)
+#define MT_QUIRK_CONTACT_CNT_ACCURATE (1 << 12)
struct mt_slot {
__s32 x, y, cx, cy, p, w, h;
@@ -83,6 +86,10 @@ struct mt_device {
struct mt_class mtclass; /* our mt device class */
struct mt_fields *fields; /* temporary placeholder for storing the
multitouch fields */
+ struct hid_field *contactcount; /* the hid_field contact count that
+ will be picked in mt_raw_event */
+ __s8 contactcount_index; /* the index of the usage contact count
+ in its hid_field. */
unsigned last_field_index; /* last field index of the report */
unsigned last_slot_field; /* the last field of a slot */
__s8 inputmode; /* InputMode HID feature, -1 if non-existent */
@@ -111,6 +118,7 @@ struct mt_device {
#define MT_CLS_DUAL_INRANGE_CONTACTNUMBER 0x0007
#define MT_CLS_DUAL_NSMU_CONTACTID 0x0008
#define MT_CLS_INRANGE_CONTACTNUMBER 0x0009
+#define MT_CLS_ALWAYS_TRUE 0x000a
/* vendor specific classes */
#define MT_CLS_3M 0x0101
@@ -170,6 +178,9 @@ static struct mt_class mt_classes[] = {
{ .name = MT_CLS_INRANGE_CONTACTNUMBER,
.quirks = MT_QUIRK_VALID_IS_INRANGE |
MT_QUIRK_SLOT_IS_CONTACTNUMBER },
+ { .name = MT_CLS_ALWAYS_TRUE,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_CONTACT_CNT_ACCURATE },
/*
* vendor specific classes
@@ -250,6 +261,9 @@ static ssize_t mt_set_quirks(struct device *dev,
td->mtclass.quirks = val;
+ if (!td->contactcount)
+ td->mtclass.quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE;
+
return count;
}
@@ -264,24 +278,26 @@ static struct attribute_group mt_attribute_group = {
.attrs = sysfs_attrs
};
+static int mt_find_usage_index(struct hid_field *field, struct hid_usage *usage)
+{
+ int i;
+ for (i = 0; i < field->maxusage; i++) {
+ if (field->usage[i].hid == usage->hid)
+ return i;
+ }
+ return -1;
+}
+
static void mt_feature_mapping(struct hid_device *hdev,
struct hid_field *field, struct hid_usage *usage)
{
struct mt_device *td = hid_get_drvdata(hdev);
- int i;
switch (usage->hid) {
case HID_DG_INPUTMODE:
td->inputmode = field->report->id;
- td->inputmode_index = 0; /* has to be updated below */
-
- for (i=0; i < field->maxusage; i++) {
- if (field->usage[i].hid == usage->hid) {
- td->inputmode_index = i;
- break;
- }
- }
-
+ td->inputmode_index = mt_find_usage_index(field, usage);
+ /* inputmode_index can't be set at -1 */
break;
case HID_DG_CONTACTMAX:
td->maxcontact_report_id = field->report->id;
@@ -459,6 +475,10 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
td->last_field_index = field->index;
return 1;
case HID_DG_CONTACTCOUNT:
+ td->contactcount = field;
+ td->contactcount_index = mt_find_usage_index(field,
+ usage);
+ /* contactcount_index can't be set at -1 */
td->last_field_index = field->index;
return 1;
case HID_DG_CONTACTMAX:
@@ -523,6 +543,10 @@ static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
*/
static void mt_complete_slot(struct mt_device *td, struct input_dev *input)
{
+ if ((td->mtclass.quirks & MT_QUIRK_CONTACT_CNT_ACCURATE) &&
+ td->num_received >= td->num_expected)
+ return;
+
if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) {
int slotnum = mt_compute_slot(td, input);
struct mt_slot *s = &td->curdata;
@@ -623,12 +647,6 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
td->curdata.h = value;
break;
case HID_DG_CONTACTCOUNT:
- /*
- * Includes multi-packet support where subsequent
- * packets are sent with zero contactcount.
- */
- if (value)
- td->num_expected = value;
break;
case HID_DG_TOUCH:
/* do nothing */
@@ -658,6 +676,37 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
return 1;
}
+static int mt_raw_event(struct hid_device *hid, struct hid_report *report,
+ u8 *data, int size)
+{
+ struct mt_device *td = hid_get_drvdata(hid);
+ struct hid_field *field = td->contactcount;
+ s32 *value;
+
+ if (field && report->id == field->report->id) {
+ /*
+ * Pick in advance the field HID_DG_CONTACTCOUNT as it is
+ * often placed at the end of the report.
+ */
+ if (report->id)
+ data++;
+
+ value = hid_extract_field(hid, field, data);
+ if (!value)
+ return 0;
+
+ /*
+ * Includes multi-packet support where subsequent
+ * packets are sent with zero contactcount.
+ */
+ if (value[td->contactcount_index])
+ td->num_expected = value[td->contactcount_index];
+
+ kfree(value);
+ }
+ return 0;
+}
+
static void mt_set_input_mode(struct hid_device *hdev)
{
struct mt_device *td = hid_get_drvdata(hdev);
@@ -719,11 +768,15 @@ static void mt_post_parse_default_settings(struct mt_device *td)
static void mt_post_parse(struct mt_device *td)
{
struct mt_fields *f = td->fields;
+ struct mt_class *cls = &td->mtclass;
if (td->touches_by_report > 0) {
int field_count_per_touch = f->length / td->touches_by_report;
td->last_slot_field = f->usages[field_count_per_touch - 1];
}
+
+ if (!td->contactcount)
+ cls->quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE;
}
static void mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
@@ -1056,6 +1109,11 @@ static const struct hid_device_id mt_devices[] = {
MT_USB_DEVICE(USB_VENDOR_ID_TURBOX,
USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) },
+ /* Nexio panels */
+ { .driver_data = MT_CLS_ALWAYS_TRUE,
+ MT_USB_DEVICE(USB_VENDOR_ID_NEXIO,
+ USB_DEVICE_ID_NEXIO_MULTITOUCH_420)},
+
/* Panasonic panels */
{ .driver_data = MT_CLS_PANASONIC,
MT_USB_DEVICE(USB_VENDOR_ID_PANASONIC,
@@ -1193,6 +1251,7 @@ static struct hid_driver mt_driver = {
.feature_mapping = mt_feature_mapping,
.usage_table = mt_grabbed_usages,
.event = mt_event,
+ .raw_event = mt_raw_event,
#ifdef CONFIG_PM
.reset_resume = mt_reset_resume,
.resume = mt_resume,
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 03/25] HID: multitouch: fix Win8 protocol for Sharp like devices
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 01/25] HID: break out hid_extract_field Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 02/25] HID: multitouch: add support for Nexio 42" panel Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 04/25] HID: multitouch: ensure that serial devices make no use of contact count Benjamin Tissoires
` (22 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
The Sharp LC-20FE1-W screen (04dd:9681) behaves like the Nexio 42".
It may report out of ranges values that are filtered out by relying
on the Contact Count HID field.
Adding the quirk MT_QUIRK_CONTACT_CNT_ACCURATE makes hid-multitouch
strongest against this kind of device, without breaking the current
devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index c4acdd0..8d0a9f9 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -317,6 +317,7 @@ static void mt_feature_mapping(struct hid_device *hdev,
*quirks |= MT_QUIRK_ALWAYS_VALID;
*quirks |= MT_QUIRK_IGNORE_DUPLICATES;
*quirks |= MT_QUIRK_HOVERING;
+ *quirks |= MT_QUIRK_CONTACT_CNT_ACCURATE;
*quirks &= ~MT_QUIRK_NOT_SEEN_MEANS_UP;
*quirks &= ~MT_QUIRK_VALID_IS_INRANGE;
*quirks &= ~MT_QUIRK_VALID_IS_CONFIDENCE;
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 04/25] HID: multitouch: ensure that serial devices make no use of contact count
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (2 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 03/25] HID: multitouch: fix Win8 protocol for Sharp like devices Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 05/25] HID: multitouch: fix protocol for Sitronix 1403:5001 Benjamin Tissoires
` (21 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
The serial protocol makes contact count a redondant information, and
sometimes it is not reliable (TRS-Star are in this case).
Disabling the use of contact count for these devices is thus safer.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 8d0a9f9..0566fd4 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -761,6 +761,7 @@ static void mt_post_parse_default_settings(struct mt_device *td)
quirks &= ~MT_QUIRK_NOT_SEEN_MEANS_UP;
quirks &= ~MT_QUIRK_VALID_IS_INRANGE;
quirks &= ~MT_QUIRK_VALID_IS_CONFIDENCE;
+ quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE;
}
td->mtclass.quirks = quirks;
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 05/25] HID: multitouch: fix protocol for Sitronix 1403:5001
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (3 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 04/25] HID: multitouch: ensure that serial devices make no use of contact count Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 06/25] HID: multitouch: optimize FlatFrog panels Benjamin Tissoires
` (20 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Since the inclusion of this device in hid-multitouch, the device
did not forward any events. Using the serial class makes it working
again.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 0566fd4..5a886bd 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1171,7 +1171,7 @@ static const struct hid_device_id mt_devices[] = {
{ .driver_data = MT_CLS_CONFIDENCE,
MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM,
USB_DEVICE_ID_MTP_STM)},
- { .driver_data = MT_CLS_CONFIDENCE,
+ { .driver_data = MT_CLS_ALWAYS_TRUE,
MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_SITRONIX,
USB_DEVICE_ID_MTP_SITRONIX)},
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 06/25] HID: multitouch: optimize FlatFrog panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (4 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 05/25] HID: multitouch: fix protocol for Sitronix 1403:5001 Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-28 15:10 ` Henrik Rydberg
2013-01-25 13:22 ` [PATCH 07/25] HID: multitouch: optimize 3M panels Benjamin Tissoires
` (19 subsequent siblings)
25 siblings, 1 reply; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Relying on ALWAYS_VALID enhance a little the processing time of
the events.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 5a886bd..7dfe891 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -229,8 +229,9 @@ static struct mt_class mt_classes[] = {
},
{ .name = MT_CLS_FLATFROG,
- .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
- MT_QUIRK_NO_AREA,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_NO_AREA |
+ MT_QUIRK_CONTACT_CNT_ACCURATE,
.sn_move = 2048,
.maxcontacts = 40,
},
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 07/25] HID: multitouch: optimize 3M panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (5 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 06/25] HID: multitouch: optimize FlatFrog panels Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 08/25] HID: multitouch: optimize Cypress panels Benjamin Tissoires
` (18 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Not very different in terms of processing time. However, this
uniformizes the handling of devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 7dfe891..199e320 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -186,7 +186,8 @@ static struct mt_class mt_classes[] = {
* vendor specific classes
*/
{ .name = MT_CLS_3M,
- .quirks = MT_QUIRK_VALID_IS_CONFIDENCE |
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_CONTACT_CNT_ACCURATE |
MT_QUIRK_SLOT_IS_CONTACTID,
.sn_move = 2048,
.sn_width = 128,
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 08/25] HID: multitouch: optimize Cypress panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (6 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 07/25] HID: multitouch: optimize 3M panels Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 09/25] HID: multitouch: optimize eGalax panels Benjamin Tissoires
` (17 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Relying on ALWAYS_VALID enhance a little the processing time of
the events.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 199e320..c15b588 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -195,7 +195,8 @@ static struct mt_class mt_classes[] = {
.maxcontacts = 60,
},
{ .name = MT_CLS_CYPRESS,
- .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_CONTACT_CNT_ACCURATE |
MT_QUIRK_CYPRESS,
.maxcontacts = 10 },
{ .name = MT_CLS_EGALAX,
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 09/25] HID: multitouch: optimize eGalax panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (7 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 08/25] HID: multitouch: optimize Cypress panels Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 10/25] HID: multitouch: optimize Stantum panels Benjamin Tissoires
` (16 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Relying on ALWAYS_VALID enhance a little the processing time of
the events. So using MT_CLS_EGALAX_SERIAL is better than using
MT_CLS_EGALAX.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index c15b588..f715045 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1014,7 +1014,7 @@ static const struct hid_device_id mt_devices[] = {
{ .driver_data = MT_CLS_EGALAX_SERIAL,
MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_72AA) },
- { .driver_data = MT_CLS_EGALAX,
+ { .driver_data = MT_CLS_EGALAX_SERIAL,
MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_72FA) },
{ .driver_data = MT_CLS_EGALAX,
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 10/25] HID: multitouch: optimize Stantum panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (8 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 09/25] HID: multitouch: optimize eGalax panels Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 11/25] HID: multitouch: optimize Quanta panels Benjamin Tissoires
` (15 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Not very different in terms of processing time. However, this
uniformizes the handling of devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index f715045..0c62f90 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1168,7 +1168,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008) },
/* Stantum panels */
- { .driver_data = MT_CLS_CONFIDENCE,
+ { .driver_data = MT_CLS_ALWAYS_TRUE,
MT_USB_DEVICE(USB_VENDOR_ID_STANTUM,
USB_DEVICE_ID_MTP)},
{ .driver_data = MT_CLS_CONFIDENCE,
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 11/25] HID: multitouch: optimize Quanta panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (9 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 10/25] HID: multitouch: optimize Stantum panels Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 12/25] HID: multitouch: optimize Lumio panels Benjamin Tissoires
` (14 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Not very different in terms of processing time. However, this
uniformizes the handling of devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 0c62f90..8b07b6b 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -119,6 +119,7 @@ struct mt_device {
#define MT_CLS_DUAL_NSMU_CONTACTID 0x0008
#define MT_CLS_INRANGE_CONTACTNUMBER 0x0009
#define MT_CLS_ALWAYS_TRUE 0x000a
+#define MT_CLS_CONTACT_ID 0x0011
/* vendor specific classes */
#define MT_CLS_3M 0x0101
@@ -181,6 +182,10 @@ static struct mt_class mt_classes[] = {
{ .name = MT_CLS_ALWAYS_TRUE,
.quirks = MT_QUIRK_ALWAYS_VALID |
MT_QUIRK_CONTACT_CNT_ACCURATE },
+ { .name = MT_CLS_CONTACT_ID,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_CONTACT_CNT_ACCURATE |
+ MT_QUIRK_SLOT_IS_CONTACTID },
/*
* vendor specific classes
@@ -1157,7 +1162,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_CANDO_PIXCIR_MULTI_TOUCH) },
/* Quanta-based panels */
- { .driver_data = MT_CLS_CONFIDENCE_CONTACT_ID,
+ { .driver_data = MT_CLS_CONTACT_ID,
MT_USB_DEVICE(USB_VENDOR_ID_QUANTA,
USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH) },
{ .driver_data = MT_CLS_CONFIDENCE_CONTACT_ID,
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 12/25] HID: multitouch: optimize Lumio panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (10 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 11/25] HID: multitouch: optimize Quanta panels Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 13/25] HID: multitouch: optimize MosArt panels Benjamin Tissoires
` (13 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Not very different in terms of processing time. However, this
uniformizes the handling of devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 8b07b6b..d66c4d7 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -120,6 +120,7 @@ struct mt_device {
#define MT_CLS_INRANGE_CONTACTNUMBER 0x0009
#define MT_CLS_ALWAYS_TRUE 0x000a
#define MT_CLS_CONTACT_ID 0x0011
+#define MT_CLS_MINUS_ONE 0x0012
/* vendor specific classes */
#define MT_CLS_3M 0x0101
@@ -186,6 +187,10 @@ static struct mt_class mt_classes[] = {
.quirks = MT_QUIRK_ALWAYS_VALID |
MT_QUIRK_CONTACT_CNT_ACCURATE |
MT_QUIRK_SLOT_IS_CONTACTID },
+ { .name = MT_CLS_MINUS_ONE,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_CONTACT_CNT_ACCURATE |
+ MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE },
/*
* vendor specific classes
@@ -1101,10 +1106,10 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_LG_MULTITOUCH) },
/* Lumio panels */
- { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
+ { .driver_data = MT_CLS_MINUS_ONE,
MT_USB_DEVICE(USB_VENDOR_ID_LUMIO,
USB_DEVICE_ID_CRYSTALTOUCH) },
- { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
+ { .driver_data = MT_CLS_MINUS_ONE,
MT_USB_DEVICE(USB_VENDOR_ID_LUMIO,
USB_DEVICE_ID_CRYSTALTOUCH_DUAL) },
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 13/25] HID: multitouch: optimize MosArt panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (11 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 12/25] HID: multitouch: optimize Lumio panels Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 14/25] HID: multitouch: optimize Elo panels Benjamin Tissoires
` (12 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Not very different in terms of processing time. However, this
uniformizes the handling of devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index d66c4d7..bc680b5 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1114,7 +1114,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_CRYSTALTOUCH_DUAL) },
/* MosArt panels */
- { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
+ { .driver_data = MT_CLS_MINUS_ONE,
MT_USB_DEVICE(USB_VENDOR_ID_ASUS,
USB_DEVICE_ID_ASUS_T91MT)},
{ .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 14/25] HID: multitouch: optimize Elo panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (12 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 13/25] HID: multitouch: optimize MosArt panels Benjamin Tissoires
@ 2013-01-25 13:22 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 15/25] HID: multitouch: optimize Hanvon panels Benjamin Tissoires
` (11 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:22 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Relying on ALWAYS_VALID enhance a little the processing time of
the events.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index bc680b5..77f34ad 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -121,6 +121,7 @@ struct mt_device {
#define MT_CLS_ALWAYS_TRUE 0x000a
#define MT_CLS_CONTACT_ID 0x0011
#define MT_CLS_MINUS_ONE 0x0012
+#define MT_CLS_DUAL_CONTACT_ID 0x0013
/* vendor specific classes */
#define MT_CLS_3M 0x0101
@@ -191,6 +192,11 @@ static struct mt_class mt_classes[] = {
.quirks = MT_QUIRK_ALWAYS_VALID |
MT_QUIRK_CONTACT_CNT_ACCURATE |
MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE },
+ { .name = MT_CLS_DUAL_CONTACT_ID,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_CONTACT_CNT_ACCURATE |
+ MT_QUIRK_SLOT_IS_CONTACTID,
+ .maxcontacts = 2 },
/*
* vendor specific classes
@@ -1050,7 +1056,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_72C4) },
/* Elo TouchSystems IntelliTouch Plus panel */
- { .driver_data = MT_CLS_DUAL_NSMU_CONTACTID,
+ { .driver_data = MT_CLS_DUAL_CONTACT_ID,
MT_USB_DEVICE(USB_VENDOR_ID_ELO,
USB_DEVICE_ID_ELO_TS2515) },
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 15/25] HID: multitouch: optimize Hanvon panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (13 preceding siblings ...)
2013-01-25 13:22 ` [PATCH 14/25] HID: multitouch: optimize Elo panels Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 16/25] HID: multitouch: optimize IRTouch panels Benjamin Tissoires
` (10 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Not very different in terms of processing time. However, this
uniformizes the handling of devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 77f34ad..10881ca 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1084,7 +1084,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_GOODTOUCH_000f) },
/* Hanvon panels */
- { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTID,
+ { .driver_data = MT_CLS_DUAL_CONTACT_ID,
MT_USB_DEVICE(USB_VENDOR_ID_HANVON_ALT,
USB_DEVICE_ID_HANVON_ALT_MULTITOUCH) },
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 16/25] HID: multitouch: optimize IRTouch panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (14 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 15/25] HID: multitouch: optimize Hanvon panels Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 17/25] HID: multitouch: fix protocol for Cando 2087:0a02 Benjamin Tissoires
` (9 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Not very different in terms of processing time. However, this
uniformizes the handling of devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 10881ca..6db423f 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1102,7 +1102,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_ILITEK_MULTITOUCH) },
/* IRTOUCH panels */
- { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTID,
+ { .driver_data = MT_CLS_DUAL_CONTACT_ID,
MT_USB_DEVICE(USB_VENDOR_ID_IRTOUCHSYSTEMS,
USB_DEVICE_ID_IRTOUCH_INFRARED_USB) },
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 17/25] HID: multitouch: fix protocol for Cando 2087:0a02
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (15 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 16/25] HID: multitouch: optimize IRTouch panels Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 18/25] HID: multitouch: optimize Cando panels Benjamin Tissoires
` (8 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Cando 2087:0a02 was broken, this fixes it.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 6db423f..9d8228a 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -122,6 +122,7 @@ struct mt_device {
#define MT_CLS_CONTACT_ID 0x0011
#define MT_CLS_MINUS_ONE 0x0012
#define MT_CLS_DUAL_CONTACT_ID 0x0013
+#define MT_CLS_DUAL_CONTACT_NUMBER 0x0014
/* vendor specific classes */
#define MT_CLS_3M 0x0101
@@ -197,6 +198,11 @@ static struct mt_class mt_classes[] = {
MT_QUIRK_CONTACT_CNT_ACCURATE |
MT_QUIRK_SLOT_IS_CONTACTID,
.maxcontacts = 2 },
+ { .name = MT_CLS_DUAL_CONTACT_NUMBER,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_CONTACT_CNT_ACCURATE |
+ MT_QUIRK_SLOT_IS_CONTACTNUMBER,
+ .maxcontacts = 2 },
/*
* vendor specific classes
@@ -969,7 +975,7 @@ static const struct hid_device_id mt_devices[] = {
{ .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER,
MT_USB_DEVICE(USB_VENDOR_ID_CANDO,
USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
- { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER,
+ { .driver_data = MT_CLS_DUAL_CONTACT_NUMBER,
MT_USB_DEVICE(USB_VENDOR_ID_CANDO,
USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1) },
{ .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER,
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 18/25] HID: multitouch: optimize Cando panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (16 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 17/25] HID: multitouch: fix protocol for Cando 2087:0a02 Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 19/25] HID: multitouch: optimize ActionStar panels Benjamin Tissoires
` (7 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Not very different in terms of processing time. However, this
uniformizes the handling of devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 9d8228a..0ea98ae 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -978,7 +978,7 @@ static const struct hid_device_id mt_devices[] = {
{ .driver_data = MT_CLS_DUAL_CONTACT_NUMBER,
MT_USB_DEVICE(USB_VENDOR_ID_CANDO,
USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1) },
- { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER,
+ { .driver_data = MT_CLS_DUAL_CONTACT_NUMBER,
MT_USB_DEVICE(USB_VENDOR_ID_CANDO,
USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) },
{ .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER,
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 19/25] HID: multitouch: optimize ActionStar panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (17 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 18/25] HID: multitouch: optimize Cando panels Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 20/25] HID: multitouch: optimize Atmel panels Benjamin Tissoires
` (6 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Relying on ALWAYS_VALID enhance a little the processing time of
the events.
Also the slot can be extracted faster by using MINUS_ONE.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 0ea98ae..189a8fd 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -955,7 +955,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_3M3266) },
/* ActionStar panels */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_MINUS_ONE,
MT_USB_DEVICE(USB_VENDOR_ID_ACTIONSTAR,
USB_DEVICE_ID_ACTIONSTAR_1011) },
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 20/25] HID: multitouch: optimize Atmel panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (18 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 19/25] HID: multitouch: optimize ActionStar panels Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 21/25] HID: multitouch: optimize Ideacom panels Benjamin Tissoires
` (5 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
The slot can be extracted using MINUS_ONE.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 189a8fd..f50b359 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -960,7 +960,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_ACTIONSTAR_1011) },
/* Atmel panels */
- { .driver_data = MT_CLS_SERIAL,
+ { .driver_data = MT_CLS_MINUS_ONE,
MT_USB_DEVICE(USB_VENDOR_ID_ATMEL,
USB_DEVICE_ID_ATMEL_MULTITOUCH) },
{ .driver_data = MT_CLS_SERIAL,
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 21/25] HID: multitouch: optimize Ideacom panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (19 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 20/25] HID: multitouch: optimize Atmel panels Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 22/25] HID: multitouch: optimize LG panels Benjamin Tissoires
` (4 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
The slot can be extracted by using MINUS_ONE.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index f50b359..fe1aa3b 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1095,10 +1095,10 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_HANVON_ALT_MULTITOUCH) },
/* Ideacom panel */
- { .driver_data = MT_CLS_SERIAL,
+ { .driver_data = MT_CLS_MINUS_ONE,
MT_USB_DEVICE(USB_VENDOR_ID_IDEACOM,
USB_DEVICE_ID_IDEACOM_IDC6650) },
- { .driver_data = MT_CLS_SERIAL,
+ { .driver_data = MT_CLS_MINUS_ONE,
MT_USB_DEVICE(USB_VENDOR_ID_IDEACOM,
USB_DEVICE_ID_IDEACOM_IDC6651) },
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 22/25] HID: multitouch: optimize LG panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (20 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 21/25] HID: multitouch: optimize Ideacom panels Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 23/25] HID: multitouch: optimize Nexio panels Benjamin Tissoires
` (3 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Relying on ALWAYS_VALID enhance a little the processing time of
the events.
Also, the slot can be extracted by using the contact ID.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index fe1aa3b..34153f9 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1113,7 +1113,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_IRTOUCH_INFRARED_USB) },
/* LG Display panels */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_CONTACT_ID,
MT_USB_DEVICE(USB_VENDOR_ID_LG,
USB_DEVICE_ID_LG_MULTITOUCH) },
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 23/25] HID: multitouch: optimize Nexio panels
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (21 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 22/25] HID: multitouch: optimize LG panels Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 24/25] HID: multitouch: remove useless DUAL_NSMU_CONTACTID class Benjamin Tissoires
` (2 subsequent siblings)
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
The slot can be extracted using by MINUS_ONE.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 34153f9..e019608 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1137,7 +1137,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) },
/* Nexio panels */
- { .driver_data = MT_CLS_ALWAYS_TRUE,
+ { .driver_data = MT_CLS_MINUS_ONE,
MT_USB_DEVICE(USB_VENDOR_ID_NEXIO,
USB_DEVICE_ID_NEXIO_MULTITOUCH_420)},
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 24/25] HID: multitouch: remove useless DUAL_NSMU_CONTACTID class
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (22 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 23/25] HID: multitouch: optimize Nexio panels Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 25/25] HID: multitouch: make MT_CLS_ALWAYS_TRUE the new default class Benjamin Tissoires
2013-01-28 15:23 ` [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Henrik Rydberg
25 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index e019608..e3f0bf7 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -116,7 +116,6 @@ struct mt_device {
#define MT_CLS_CONFIDENCE_MINUS_ONE 0x0005
#define MT_CLS_DUAL_INRANGE_CONTACTID 0x0006
#define MT_CLS_DUAL_INRANGE_CONTACTNUMBER 0x0007
-#define MT_CLS_DUAL_NSMU_CONTACTID 0x0008
#define MT_CLS_INRANGE_CONTACTNUMBER 0x0009
#define MT_CLS_ALWAYS_TRUE 0x000a
#define MT_CLS_CONTACT_ID 0x0011
@@ -175,10 +174,6 @@ static struct mt_class mt_classes[] = {
.quirks = MT_QUIRK_VALID_IS_INRANGE |
MT_QUIRK_SLOT_IS_CONTACTNUMBER,
.maxcontacts = 2 },
- { .name = MT_CLS_DUAL_NSMU_CONTACTID,
- .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
- MT_QUIRK_SLOT_IS_CONTACTID,
- .maxcontacts = 2 },
{ .name = MT_CLS_INRANGE_CONTACTNUMBER,
.quirks = MT_QUIRK_VALID_IS_INRANGE |
MT_QUIRK_SLOT_IS_CONTACTNUMBER },
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 25/25] HID: multitouch: make MT_CLS_ALWAYS_TRUE the new default class
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (23 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 24/25] HID: multitouch: remove useless DUAL_NSMU_CONTACTID class Benjamin Tissoires
@ 2013-01-25 13:23 ` Benjamin Tissoires
2013-01-28 15:13 ` Henrik Rydberg
2013-01-28 15:23 ` [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Henrik Rydberg
25 siblings, 1 reply; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-25 13:23 UTC (permalink / raw)
To: Benjamin Tissoires, Dmitry Torokhov, Henrik Rydberg, Jiri Kosina,
Stephane Chatty, linux-input, linux-kernel
By running a test on all the traces of the devices I have,
I noticed that the class MT_CLS_ALWAYS_TRUE could handle all
the devices I've seen so far without any other quirks.
I guess this is the behavior Win 7 requires in its driver.
We can change the default class then and keep the existing classes
for backward compatibility and performances for some of them.
Two operations have been done:
- replaced MT_CLS_DEFAULT by MT_CLS_NSMU
- then replaced MT_CLS_ALWAYS_TRUE by MT_CLS_DEFAULT
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 53 ++++++++++++++++++++++----------------------
1 file changed, 27 insertions(+), 26 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index e3f0bf7..25b1d2c 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -117,7 +117,7 @@ struct mt_device {
#define MT_CLS_DUAL_INRANGE_CONTACTID 0x0006
#define MT_CLS_DUAL_INRANGE_CONTACTNUMBER 0x0007
#define MT_CLS_INRANGE_CONTACTNUMBER 0x0009
-#define MT_CLS_ALWAYS_TRUE 0x000a
+#define MT_CLS_NSMU 0x000a
#define MT_CLS_CONTACT_ID 0x0011
#define MT_CLS_MINUS_ONE 0x0012
#define MT_CLS_DUAL_CONTACT_ID 0x0013
@@ -155,6 +155,9 @@ static int cypress_compute_slot(struct mt_device *td)
static struct mt_class mt_classes[] = {
{ .name = MT_CLS_DEFAULT,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_CONTACT_CNT_ACCURATE },
+ { .name = MT_CLS_NSMU,
.quirks = MT_QUIRK_NOT_SEEN_MEANS_UP },
{ .name = MT_CLS_SERIAL,
.quirks = MT_QUIRK_ALWAYS_VALID},
@@ -177,9 +180,7 @@ static struct mt_class mt_classes[] = {
{ .name = MT_CLS_INRANGE_CONTACTNUMBER,
.quirks = MT_QUIRK_VALID_IS_INRANGE |
MT_QUIRK_SLOT_IS_CONTACTNUMBER },
- { .name = MT_CLS_ALWAYS_TRUE,
- .quirks = MT_QUIRK_ALWAYS_VALID |
- MT_QUIRK_CONTACT_CNT_ACCURATE },
+
{ .name = MT_CLS_CONTACT_ID,
.quirks = MT_QUIRK_ALWAYS_VALID |
MT_QUIRK_CONTACT_CNT_ACCURATE |
@@ -963,7 +964,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_ATMEL_MXT_DIGITIZER) },
/* Baanto multitouch devices */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_BAANTO,
USB_DEVICE_ID_BAANTO_MT_190W2) },
/* Cando panels */
@@ -981,12 +982,12 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) },
/* Chunghwa Telecom touch panels */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_CHUNGHWAT,
USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH) },
/* CVTouch panels */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_CVTOUCH,
USB_DEVICE_ID_CVTOUCH_SCREEN) },
@@ -1075,12 +1076,12 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PWT_TENFINGERS) },
/* Gametel game controller */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_BT_DEVICE(USB_VENDOR_ID_FRUCTEL,
USB_DEVICE_ID_GAMETEL_MT_MODE) },
/* GoodTouch panels */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_GOODTOUCH,
USB_DEVICE_ID_GOODTOUCH_000f) },
@@ -1098,7 +1099,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_IDEACOM_IDC6651) },
/* Ilitek dual touch panel */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_ILITEK,
USB_DEVICE_ID_ILITEK_MULTITOUCH) },
@@ -1145,7 +1146,7 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_PANABOARD_UBT880) },
/* Novatek Panel */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_NOVATEK,
USB_DEVICE_ID_NOVATEK_PCT) },
@@ -1185,13 +1186,13 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008) },
/* Stantum panels */
- { .driver_data = MT_CLS_ALWAYS_TRUE,
+ { .driver_data = MT_CLS_DEFAULT,
MT_USB_DEVICE(USB_VENDOR_ID_STANTUM,
USB_DEVICE_ID_MTP)},
{ .driver_data = MT_CLS_CONFIDENCE,
MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM,
USB_DEVICE_ID_MTP_STM)},
- { .driver_data = MT_CLS_ALWAYS_TRUE,
+ { .driver_data = MT_CLS_DEFAULT,
MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_SITRONIX,
USB_DEVICE_ID_MTP_SITRONIX)},
@@ -1201,48 +1202,48 @@ static const struct hid_device_id mt_devices[] = {
USB_DEVICE_ID_TOPSEED2_PERIPAD_701) },
/* Touch International panels */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_TOUCH_INTL,
USB_DEVICE_ID_TOUCH_INTL_MULTI_TOUCH) },
/* Unitec panels */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
USB_DEVICE_ID_UNITEC_USB_TOUCH_0709) },
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
/* XAT */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_XAT,
USB_DEVICE_ID_XAT_CSR) },
/* Xiroku */
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
USB_DEVICE_ID_XIROKU_SPX) },
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
USB_DEVICE_ID_XIROKU_MPX) },
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
USB_DEVICE_ID_XIROKU_CSR) },
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
USB_DEVICE_ID_XIROKU_SPX1) },
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
USB_DEVICE_ID_XIROKU_MPX1) },
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
USB_DEVICE_ID_XIROKU_CSR1) },
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
USB_DEVICE_ID_XIROKU_SPX2) },
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
USB_DEVICE_ID_XIROKU_MPX2) },
- { .driver_data = MT_CLS_DEFAULT,
+ { .driver_data = MT_CLS_NSMU,
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
USB_DEVICE_ID_XIROKU_CSR2) },
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH 02/25] HID: multitouch: add support for Nexio 42" panel
2013-01-25 13:22 ` [PATCH 02/25] HID: multitouch: add support for Nexio 42" panel Benjamin Tissoires
@ 2013-01-28 15:01 ` Henrik Rydberg
2013-01-28 16:08 ` Benjamin Tissoires
2013-01-28 16:56 ` Stéphane Chatty
0 siblings, 2 replies; 37+ messages in thread
From: Henrik Rydberg @ 2013-01-28 15:01 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Dmitry Torokhov, Jiri Kosina, Stephane Chatty, linux-input,
linux-kernel
Hi Benjamin,
> This device is the worst device I saw. It keeps TipSwitch and InRange
> at 1 for fingers that are not touching the panel.
> The solution is to rely on the field ContactCount, which is accurate
> as the correct information are packed at the begining of the frame.
>
> Unfortunately, CountactCount is most of the time at the end of the report.
> The solution is to pick it when we have the whole report in raw_event.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
> ---
> drivers/hid/hid-ids.h | 3 ++
> drivers/hid/hid-multitouch.c | 91 ++++++++++++++++++++++++++++++++++++--------
> 2 files changed, 78 insertions(+), 16 deletions(-)
I think it would make more sense to introduce a method where the
driver sees all report values at once. We have had reasonable cause to
add it in the past, but never did.
>
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index dad56aa..0935012 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -597,6 +597,9 @@
> #define USB_VENDOR_ID_NEC 0x073e
> #define USB_DEVICE_ID_NEC_USB_GAME_PAD 0x0301
>
> +#define USB_VENDOR_ID_NEXIO 0x1870
> +#define USB_DEVICE_ID_NEXIO_MULTITOUCH_420 0x010d
> +
> #define USB_VENDOR_ID_NEXTWINDOW 0x1926
> #define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003
>
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 46d8136..c4acdd0 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -32,6 +32,8 @@
> #include <linux/slab.h>
> #include <linux/usb.h>
> #include <linux/input/mt.h>
> +#include <asm/unaligned.h>
> +#include <asm/byteorder.h>
> #include "usbhid/usbhid.h"
>
>
> @@ -54,6 +56,7 @@ MODULE_LICENSE("GPL");
> #define MT_QUIRK_NO_AREA (1 << 9)
> #define MT_QUIRK_IGNORE_DUPLICATES (1 << 10)
> #define MT_QUIRK_HOVERING (1 << 11)
> +#define MT_QUIRK_CONTACT_CNT_ACCURATE (1 << 12)
>
> struct mt_slot {
> __s32 x, y, cx, cy, p, w, h;
> @@ -83,6 +86,10 @@ struct mt_device {
> struct mt_class mtclass; /* our mt device class */
> struct mt_fields *fields; /* temporary placeholder for storing the
> multitouch fields */
> + struct hid_field *contactcount; /* the hid_field contact count that
> + will be picked in mt_raw_event */
> + __s8 contactcount_index; /* the index of the usage contact count
> + in its hid_field. */
> unsigned last_field_index; /* last field index of the report */
> unsigned last_slot_field; /* the last field of a slot */
> __s8 inputmode; /* InputMode HID feature, -1 if non-existent */
> @@ -111,6 +118,7 @@ struct mt_device {
> #define MT_CLS_DUAL_INRANGE_CONTACTNUMBER 0x0007
> #define MT_CLS_DUAL_NSMU_CONTACTID 0x0008
> #define MT_CLS_INRANGE_CONTACTNUMBER 0x0009
> +#define MT_CLS_ALWAYS_TRUE 0x000a
>
> /* vendor specific classes */
> #define MT_CLS_3M 0x0101
> @@ -170,6 +178,9 @@ static struct mt_class mt_classes[] = {
> { .name = MT_CLS_INRANGE_CONTACTNUMBER,
> .quirks = MT_QUIRK_VALID_IS_INRANGE |
> MT_QUIRK_SLOT_IS_CONTACTNUMBER },
> + { .name = MT_CLS_ALWAYS_TRUE,
> + .quirks = MT_QUIRK_ALWAYS_VALID |
> + MT_QUIRK_CONTACT_CNT_ACCURATE },
>
> /*
> * vendor specific classes
> @@ -250,6 +261,9 @@ static ssize_t mt_set_quirks(struct device *dev,
>
> td->mtclass.quirks = val;
>
> + if (!td->contactcount)
> + td->mtclass.quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE;
> +
> return count;
> }
>
> @@ -264,24 +278,26 @@ static struct attribute_group mt_attribute_group = {
> .attrs = sysfs_attrs
> };
>
> +static int mt_find_usage_index(struct hid_field *field, struct hid_usage *usage)
> +{
> + int i;
> + for (i = 0; i < field->maxusage; i++) {
> + if (field->usage[i].hid == usage->hid)
> + return i;
> + }
> + return -1;
> +}
> +
> static void mt_feature_mapping(struct hid_device *hdev,
> struct hid_field *field, struct hid_usage *usage)
> {
> struct mt_device *td = hid_get_drvdata(hdev);
> - int i;
>
> switch (usage->hid) {
> case HID_DG_INPUTMODE:
> td->inputmode = field->report->id;
> - td->inputmode_index = 0; /* has to be updated below */
> -
> - for (i=0; i < field->maxusage; i++) {
> - if (field->usage[i].hid == usage->hid) {
> - td->inputmode_index = i;
> - break;
> - }
> - }
> -
> + td->inputmode_index = mt_find_usage_index(field, usage);
> + /* inputmode_index can't be set at -1 */
> break;
> case HID_DG_CONTACTMAX:
> td->maxcontact_report_id = field->report->id;
> @@ -459,6 +475,10 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
> td->last_field_index = field->index;
> return 1;
> case HID_DG_CONTACTCOUNT:
> + td->contactcount = field;
> + td->contactcount_index = mt_find_usage_index(field,
> + usage);
> + /* contactcount_index can't be set at -1 */
> td->last_field_index = field->index;
> return 1;
> case HID_DG_CONTACTMAX:
> @@ -523,6 +543,10 @@ static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
> */
> static void mt_complete_slot(struct mt_device *td, struct input_dev *input)
> {
> + if ((td->mtclass.quirks & MT_QUIRK_CONTACT_CNT_ACCURATE) &&
> + td->num_received >= td->num_expected)
> + return;
> +
> if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) {
> int slotnum = mt_compute_slot(td, input);
> struct mt_slot *s = &td->curdata;
> @@ -623,12 +647,6 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
> td->curdata.h = value;
> break;
> case HID_DG_CONTACTCOUNT:
> - /*
> - * Includes multi-packet support where subsequent
> - * packets are sent with zero contactcount.
> - */
> - if (value)
> - td->num_expected = value;
> break;
> case HID_DG_TOUCH:
> /* do nothing */
> @@ -658,6 +676,37 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
> return 1;
> }
>
> +static int mt_raw_event(struct hid_device *hid, struct hid_report *report,
> + u8 *data, int size)
> +{
> + struct mt_device *td = hid_get_drvdata(hid);
> + struct hid_field *field = td->contactcount;
> + s32 *value;
> +
> + if (field && report->id == field->report->id) {
> + /*
> + * Pick in advance the field HID_DG_CONTACTCOUNT as it is
> + * often placed at the end of the report.
> + */
> + if (report->id)
> + data++;
> +
> + value = hid_extract_field(hid, field, data);
> + if (!value)
> + return 0;
> +
> + /*
> + * Includes multi-packet support where subsequent
> + * packets are sent with zero contactcount.
> + */
> + if (value[td->contactcount_index])
> + td->num_expected = value[td->contactcount_index];
> +
> + kfree(value);
> + }
> + return 0;
> +}
This is a lot of cycles for something that is already available in the core.
> +
> static void mt_set_input_mode(struct hid_device *hdev)
> {
> struct mt_device *td = hid_get_drvdata(hdev);
> @@ -719,11 +768,15 @@ static void mt_post_parse_default_settings(struct mt_device *td)
> static void mt_post_parse(struct mt_device *td)
> {
> struct mt_fields *f = td->fields;
> + struct mt_class *cls = &td->mtclass;
>
> if (td->touches_by_report > 0) {
> int field_count_per_touch = f->length / td->touches_by_report;
> td->last_slot_field = f->usages[field_count_per_touch - 1];
> }
> +
> + if (!td->contactcount)
> + cls->quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE;
> }
>
> static void mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
> @@ -1056,6 +1109,11 @@ static const struct hid_device_id mt_devices[] = {
> MT_USB_DEVICE(USB_VENDOR_ID_TURBOX,
> USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) },
>
> + /* Nexio panels */
> + { .driver_data = MT_CLS_ALWAYS_TRUE,
> + MT_USB_DEVICE(USB_VENDOR_ID_NEXIO,
> + USB_DEVICE_ID_NEXIO_MULTITOUCH_420)},
> +
> /* Panasonic panels */
> { .driver_data = MT_CLS_PANASONIC,
> MT_USB_DEVICE(USB_VENDOR_ID_PANASONIC,
> @@ -1193,6 +1251,7 @@ static struct hid_driver mt_driver = {
> .feature_mapping = mt_feature_mapping,
> .usage_table = mt_grabbed_usages,
> .event = mt_event,
> + .raw_event = mt_raw_event,
Rather a new and simpler event method here, in other words.
> #ifdef CONFIG_PM
> .reset_resume = mt_reset_resume,
> .resume = mt_resume,
> --
> 1.8.1
>
Thanks,
Henrik
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/25] HID: break out hid_extract_field
2013-01-25 13:22 ` [PATCH 01/25] HID: break out hid_extract_field Benjamin Tissoires
@ 2013-01-28 15:04 ` Henrik Rydberg
0 siblings, 0 replies; 37+ messages in thread
From: Henrik Rydberg @ 2013-01-28 15:04 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Dmitry Torokhov, Jiri Kosina, Stephane Chatty, linux-input,
linux-kernel
Hi Benjamin,
> Breaking out this function allows third parties hid drivers to retrieve
> the data fields of a hid report in the raw_event callback.
>
> No functional changes, only exports the function.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
> ---
> drivers/hid/hid-core.c | 60 ++++++++++++++++++++++++++++++++++----------------
> include/linux/hid.h | 1 +
> 2 files changed, 42 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 5ae2cb1..ea478f5 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -962,6 +962,45 @@ static void implement(const struct hid_device *hid, __u8 *report,
> }
>
> /*
> + * Extract and allocate a data field from a little endian report (bit array).
> + */
> +
> +s32 *hid_extract_field(const struct hid_device *hid, struct hid_field *field,
> + __u8 *data)
> +{
> + unsigned n;
> + unsigned count = field->report_count;
> + unsigned offset = field->report_offset;
> + unsigned size = field->report_size;
> + __s32 min = field->logical_minimum;
> + __s32 max = field->logical_maximum;
> + __s32 *value;
> +
> + value = kmalloc(sizeof(__s32) * count, GFP_ATOMIC);
> + if (!value)
> + return value;
> +
> + for (n = 0; n < count; n++) {
> +
> + value[n] = min < 0 ?
> + snto32(extract(hid, data, offset + n * size, size),
> + size) :
> + extract(hid, data, offset + n * size, size);
> +
> + /* Ignore report if ErrorRollOver */
> + if (!(field->flags & HID_MAIN_ITEM_VARIABLE) &&
> + value[n] >= min && value[n] <= max &&
> + field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1) {
> + kfree(value);
> + return NULL;
> + }
> + }
> +
> + return value;
> +}
> +EXPORT_SYMBOL_GPL(hid_extract_field);
> +
I would rather see the extensive use of malloc go away than extend its
usage to drivers.
Thanks,
Henrik
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 06/25] HID: multitouch: optimize FlatFrog panels
2013-01-25 13:22 ` [PATCH 06/25] HID: multitouch: optimize FlatFrog panels Benjamin Tissoires
@ 2013-01-28 15:10 ` Henrik Rydberg
2013-01-28 16:01 ` Benjamin Tissoires
0 siblings, 1 reply; 37+ messages in thread
From: Henrik Rydberg @ 2013-01-28 15:10 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Dmitry Torokhov, Jiri Kosina, Stephane Chatty, linux-input,
linux-kernel
Hi Benjamin,
> Relying on ALWAYS_VALID enhance a little the processing time of
> the events.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
> ---
> drivers/hid/hid-multitouch.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Is there a measurement backing up this claim? I suspect
micro-optimizations of this kind drowns completely along the rather
long way from device, via malloc and loops, to the input core.
Considering the must-be-tested-for-regression risk on top of that,
this patch falls far below what is worth doing, IMHO.
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 5a886bd..7dfe891 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -229,8 +229,9 @@ static struct mt_class mt_classes[] = {
> },
>
> { .name = MT_CLS_FLATFROG,
> - .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
> - MT_QUIRK_NO_AREA,
> + .quirks = MT_QUIRK_ALWAYS_VALID |
> + MT_QUIRK_NO_AREA |
> + MT_QUIRK_CONTACT_CNT_ACCURATE,
> .sn_move = 2048,
> .maxcontacts = 40,
> },
> --
> 1.8.1
>
Thanks.
Henrik
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 25/25] HID: multitouch: make MT_CLS_ALWAYS_TRUE the new default class
2013-01-25 13:23 ` [PATCH 25/25] HID: multitouch: make MT_CLS_ALWAYS_TRUE the new default class Benjamin Tissoires
@ 2013-01-28 15:13 ` Henrik Rydberg
2013-01-28 15:54 ` Benjamin Tissoires
0 siblings, 1 reply; 37+ messages in thread
From: Henrik Rydberg @ 2013-01-28 15:13 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Dmitry Torokhov, Jiri Kosina, Stephane Chatty, linux-input,
linux-kernel
Hi Benjamin,
> By running a test on all the traces of the devices I have,
> I noticed that the class MT_CLS_ALWAYS_TRUE could handle all
> the devices I've seen so far without any other quirks.
> I guess this is the behavior Win 7 requires in its driver.
>
> We can change the default class then and keep the existing classes
> for backward compatibility and performances for some of them.
Nice observation. A simpler route is to add new devices according the
new scheme, and leave the current code intact. Don't fix what ain't
broken.
>
> Two operations have been done:
> - replaced MT_CLS_DEFAULT by MT_CLS_NSMU
> - then replaced MT_CLS_ALWAYS_TRUE by MT_CLS_DEFAULT
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
> ---
> drivers/hid/hid-multitouch.c | 53 ++++++++++++++++++++++----------------------
> 1 file changed, 27 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index e3f0bf7..25b1d2c 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -117,7 +117,7 @@ struct mt_device {
> #define MT_CLS_DUAL_INRANGE_CONTACTID 0x0006
> #define MT_CLS_DUAL_INRANGE_CONTACTNUMBER 0x0007
> #define MT_CLS_INRANGE_CONTACTNUMBER 0x0009
> -#define MT_CLS_ALWAYS_TRUE 0x000a
> +#define MT_CLS_NSMU 0x000a
> #define MT_CLS_CONTACT_ID 0x0011
> #define MT_CLS_MINUS_ONE 0x0012
> #define MT_CLS_DUAL_CONTACT_ID 0x0013
> @@ -155,6 +155,9 @@ static int cypress_compute_slot(struct mt_device *td)
>
> static struct mt_class mt_classes[] = {
> { .name = MT_CLS_DEFAULT,
> + .quirks = MT_QUIRK_ALWAYS_VALID |
> + MT_QUIRK_CONTACT_CNT_ACCURATE },
> + { .name = MT_CLS_NSMU,
> .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP },
> { .name = MT_CLS_SERIAL,
> .quirks = MT_QUIRK_ALWAYS_VALID},
> @@ -177,9 +180,7 @@ static struct mt_class mt_classes[] = {
> { .name = MT_CLS_INRANGE_CONTACTNUMBER,
> .quirks = MT_QUIRK_VALID_IS_INRANGE |
> MT_QUIRK_SLOT_IS_CONTACTNUMBER },
> - { .name = MT_CLS_ALWAYS_TRUE,
> - .quirks = MT_QUIRK_ALWAYS_VALID |
> - MT_QUIRK_CONTACT_CNT_ACCURATE },
> +
> { .name = MT_CLS_CONTACT_ID,
> .quirks = MT_QUIRK_ALWAYS_VALID |
> MT_QUIRK_CONTACT_CNT_ACCURATE |
> @@ -963,7 +964,7 @@ static const struct hid_device_id mt_devices[] = {
> USB_DEVICE_ID_ATMEL_MXT_DIGITIZER) },
>
> /* Baanto multitouch devices */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_BAANTO,
> USB_DEVICE_ID_BAANTO_MT_190W2) },
> /* Cando panels */
> @@ -981,12 +982,12 @@ static const struct hid_device_id mt_devices[] = {
> USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) },
>
> /* Chunghwa Telecom touch panels */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_CHUNGHWAT,
> USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH) },
>
> /* CVTouch panels */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_CVTOUCH,
> USB_DEVICE_ID_CVTOUCH_SCREEN) },
>
> @@ -1075,12 +1076,12 @@ static const struct hid_device_id mt_devices[] = {
> USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PWT_TENFINGERS) },
>
> /* Gametel game controller */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_BT_DEVICE(USB_VENDOR_ID_FRUCTEL,
> USB_DEVICE_ID_GAMETEL_MT_MODE) },
>
> /* GoodTouch panels */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_GOODTOUCH,
> USB_DEVICE_ID_GOODTOUCH_000f) },
>
> @@ -1098,7 +1099,7 @@ static const struct hid_device_id mt_devices[] = {
> USB_DEVICE_ID_IDEACOM_IDC6651) },
>
> /* Ilitek dual touch panel */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_ILITEK,
> USB_DEVICE_ID_ILITEK_MULTITOUCH) },
>
> @@ -1145,7 +1146,7 @@ static const struct hid_device_id mt_devices[] = {
> USB_DEVICE_ID_PANABOARD_UBT880) },
>
> /* Novatek Panel */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_NOVATEK,
> USB_DEVICE_ID_NOVATEK_PCT) },
>
> @@ -1185,13 +1186,13 @@ static const struct hid_device_id mt_devices[] = {
> USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008) },
>
> /* Stantum panels */
> - { .driver_data = MT_CLS_ALWAYS_TRUE,
> + { .driver_data = MT_CLS_DEFAULT,
> MT_USB_DEVICE(USB_VENDOR_ID_STANTUM,
> USB_DEVICE_ID_MTP)},
> { .driver_data = MT_CLS_CONFIDENCE,
> MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM,
> USB_DEVICE_ID_MTP_STM)},
> - { .driver_data = MT_CLS_ALWAYS_TRUE,
> + { .driver_data = MT_CLS_DEFAULT,
> MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_SITRONIX,
> USB_DEVICE_ID_MTP_SITRONIX)},
>
> @@ -1201,48 +1202,48 @@ static const struct hid_device_id mt_devices[] = {
> USB_DEVICE_ID_TOPSEED2_PERIPAD_701) },
>
> /* Touch International panels */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_TOUCH_INTL,
> USB_DEVICE_ID_TOUCH_INTL_MULTI_TOUCH) },
>
> /* Unitec panels */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
> USB_DEVICE_ID_UNITEC_USB_TOUCH_0709) },
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
> USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
> /* XAT */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_XAT,
> USB_DEVICE_ID_XAT_CSR) },
>
> /* Xiroku */
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
> USB_DEVICE_ID_XIROKU_SPX) },
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
> USB_DEVICE_ID_XIROKU_MPX) },
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
> USB_DEVICE_ID_XIROKU_CSR) },
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
> USB_DEVICE_ID_XIROKU_SPX1) },
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
> USB_DEVICE_ID_XIROKU_MPX1) },
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
> USB_DEVICE_ID_XIROKU_CSR1) },
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
> USB_DEVICE_ID_XIROKU_SPX2) },
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
> USB_DEVICE_ID_XIROKU_MPX2) },
> - { .driver_data = MT_CLS_DEFAULT,
> + { .driver_data = MT_CLS_NSMU,
> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
> USB_DEVICE_ID_XIROKU_CSR2) },
>
> --
> 1.8.1
>
Thanks,
Henrik
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
` (24 preceding siblings ...)
2013-01-25 13:23 ` [PATCH 25/25] HID: multitouch: make MT_CLS_ALWAYS_TRUE the new default class Benjamin Tissoires
@ 2013-01-28 15:23 ` Henrik Rydberg
2013-01-28 16:15 ` Benjamin Tissoires
25 siblings, 1 reply; 37+ messages in thread
From: Henrik Rydberg @ 2013-01-28 15:23 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Dmitry Torokhov, Jiri Kosina, Stephane Chatty, linux-input,
linux-kernel
Hi Benjamin,
> finally, I managed to send a new bunch of patches. Sorry for the delay from the
> previous version, but meanwhile, I implemented an automatic regressions tests
> for hid device [1].
> So this series seems pretty big, but it does not break any known devices (I ran
> 40 successful tests for this series)[2].
Thanks for the patches.
> To sum up:
> - Nexio devices were problematic in the sense they use out of range values for
> some of the fields, and consider that the driver won't treat the extra touches
> based on the reported contact count.
Problematic device, but I think we should add a new event function
which gives all values at the same time, since those are already
present in the core. It seems this will solve the current problem as
well as many older workarounds.
> - fortunately, this behavior (relying on contact count) is compatible with all
> the devices I know, which leads to think that this is how the Windows 7/8 driver
> manage to handle such a different bunch of devices.
This is a nice observation. IIRC, we used to rely more on contact
count in the old drivers.
> - thanks to the automatic testing, I was able to fix broken devices
> (Sharp LC-20FE1-W screen 04dd:9681, Sitronix 1403:5001 and Cando 2087:0a02)
> and optimize many others. In order to allow a bisection to be done, I split
> the patches in many different ones, one per device type.
Great tool, thank you Benjamin.
> - finally, I changed the default class in order to handle the new devices in a
> better way.
Old wisdom says differently. ;-)
Thanks,
Henrik
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 25/25] HID: multitouch: make MT_CLS_ALWAYS_TRUE the new default class
2013-01-28 15:13 ` Henrik Rydberg
@ 2013-01-28 15:54 ` Benjamin Tissoires
0 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-28 15:54 UTC (permalink / raw)
To: Henrik Rydberg
Cc: Dmitry Torokhov, Jiri Kosina, Stephane Chatty, linux-input,
linux-kernel
On Mon, Jan 28, 2013 at 4:13 PM, Henrik Rydberg <rydberg@euromail.se> wrote:
> Hi Benjamin,
>
>> By running a test on all the traces of the devices I have,
>> I noticed that the class MT_CLS_ALWAYS_TRUE could handle all
>> the devices I've seen so far without any other quirks.
>> I guess this is the behavior Win 7 requires in its driver.
>>
>> We can change the default class then and keep the existing classes
>> for backward compatibility and performances for some of them.
>
> Nice observation. A simpler route is to add new devices according the
> new scheme, and leave the current code intact. Don't fix what ain't
> broken.
I fully agree with that, and this is the way I built this patch. All
the current working devices supported in the kernel through the 'old'
default class (that I was not able to test) are keeping the very same
class. This class has just been renamed "NSMU".
The new devices will get the new default class.
Maybe that if I do the change with 2 different patches, it will be
more readable and error-proof?
Cheers,
Benjamin
>
>>
>> Two operations have been done:
>> - replaced MT_CLS_DEFAULT by MT_CLS_NSMU
>> - then replaced MT_CLS_ALWAYS_TRUE by MT_CLS_DEFAULT
>>
>> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
>> ---
>> drivers/hid/hid-multitouch.c | 53 ++++++++++++++++++++++----------------------
>> 1 file changed, 27 insertions(+), 26 deletions(-)
>>
>> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
>> index e3f0bf7..25b1d2c 100644
>> --- a/drivers/hid/hid-multitouch.c
>> +++ b/drivers/hid/hid-multitouch.c
>> @@ -117,7 +117,7 @@ struct mt_device {
>> #define MT_CLS_DUAL_INRANGE_CONTACTID 0x0006
>> #define MT_CLS_DUAL_INRANGE_CONTACTNUMBER 0x0007
>> #define MT_CLS_INRANGE_CONTACTNUMBER 0x0009
>> -#define MT_CLS_ALWAYS_TRUE 0x000a
>> +#define MT_CLS_NSMU 0x000a
>> #define MT_CLS_CONTACT_ID 0x0011
>> #define MT_CLS_MINUS_ONE 0x0012
>> #define MT_CLS_DUAL_CONTACT_ID 0x0013
>> @@ -155,6 +155,9 @@ static int cypress_compute_slot(struct mt_device *td)
>>
>> static struct mt_class mt_classes[] = {
>> { .name = MT_CLS_DEFAULT,
>> + .quirks = MT_QUIRK_ALWAYS_VALID |
>> + MT_QUIRK_CONTACT_CNT_ACCURATE },
>> + { .name = MT_CLS_NSMU,
>> .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP },
>> { .name = MT_CLS_SERIAL,
>> .quirks = MT_QUIRK_ALWAYS_VALID},
>> @@ -177,9 +180,7 @@ static struct mt_class mt_classes[] = {
>> { .name = MT_CLS_INRANGE_CONTACTNUMBER,
>> .quirks = MT_QUIRK_VALID_IS_INRANGE |
>> MT_QUIRK_SLOT_IS_CONTACTNUMBER },
>> - { .name = MT_CLS_ALWAYS_TRUE,
>> - .quirks = MT_QUIRK_ALWAYS_VALID |
>> - MT_QUIRK_CONTACT_CNT_ACCURATE },
>> +
>> { .name = MT_CLS_CONTACT_ID,
>> .quirks = MT_QUIRK_ALWAYS_VALID |
>> MT_QUIRK_CONTACT_CNT_ACCURATE |
>> @@ -963,7 +964,7 @@ static const struct hid_device_id mt_devices[] = {
>> USB_DEVICE_ID_ATMEL_MXT_DIGITIZER) },
>>
>> /* Baanto multitouch devices */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_BAANTO,
>> USB_DEVICE_ID_BAANTO_MT_190W2) },
>> /* Cando panels */
>> @@ -981,12 +982,12 @@ static const struct hid_device_id mt_devices[] = {
>> USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) },
>>
>> /* Chunghwa Telecom touch panels */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_CHUNGHWAT,
>> USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH) },
>>
>> /* CVTouch panels */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_CVTOUCH,
>> USB_DEVICE_ID_CVTOUCH_SCREEN) },
>>
>> @@ -1075,12 +1076,12 @@ static const struct hid_device_id mt_devices[] = {
>> USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PWT_TENFINGERS) },
>>
>> /* Gametel game controller */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_BT_DEVICE(USB_VENDOR_ID_FRUCTEL,
>> USB_DEVICE_ID_GAMETEL_MT_MODE) },
>>
>> /* GoodTouch panels */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_GOODTOUCH,
>> USB_DEVICE_ID_GOODTOUCH_000f) },
>>
>> @@ -1098,7 +1099,7 @@ static const struct hid_device_id mt_devices[] = {
>> USB_DEVICE_ID_IDEACOM_IDC6651) },
>>
>> /* Ilitek dual touch panel */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_ILITEK,
>> USB_DEVICE_ID_ILITEK_MULTITOUCH) },
>>
>> @@ -1145,7 +1146,7 @@ static const struct hid_device_id mt_devices[] = {
>> USB_DEVICE_ID_PANABOARD_UBT880) },
>>
>> /* Novatek Panel */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_NOVATEK,
>> USB_DEVICE_ID_NOVATEK_PCT) },
>>
>> @@ -1185,13 +1186,13 @@ static const struct hid_device_id mt_devices[] = {
>> USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008) },
>>
>> /* Stantum panels */
>> - { .driver_data = MT_CLS_ALWAYS_TRUE,
>> + { .driver_data = MT_CLS_DEFAULT,
>> MT_USB_DEVICE(USB_VENDOR_ID_STANTUM,
>> USB_DEVICE_ID_MTP)},
>> { .driver_data = MT_CLS_CONFIDENCE,
>> MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM,
>> USB_DEVICE_ID_MTP_STM)},
>> - { .driver_data = MT_CLS_ALWAYS_TRUE,
>> + { .driver_data = MT_CLS_DEFAULT,
>> MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_SITRONIX,
>> USB_DEVICE_ID_MTP_SITRONIX)},
>>
>> @@ -1201,48 +1202,48 @@ static const struct hid_device_id mt_devices[] = {
>> USB_DEVICE_ID_TOPSEED2_PERIPAD_701) },
>>
>> /* Touch International panels */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_TOUCH_INTL,
>> USB_DEVICE_ID_TOUCH_INTL_MULTI_TOUCH) },
>>
>> /* Unitec panels */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
>> USB_DEVICE_ID_UNITEC_USB_TOUCH_0709) },
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
>> USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
>> /* XAT */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_XAT,
>> USB_DEVICE_ID_XAT_CSR) },
>>
>> /* Xiroku */
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
>> USB_DEVICE_ID_XIROKU_SPX) },
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
>> USB_DEVICE_ID_XIROKU_MPX) },
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
>> USB_DEVICE_ID_XIROKU_CSR) },
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
>> USB_DEVICE_ID_XIROKU_SPX1) },
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
>> USB_DEVICE_ID_XIROKU_MPX1) },
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
>> USB_DEVICE_ID_XIROKU_CSR1) },
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
>> USB_DEVICE_ID_XIROKU_SPX2) },
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
>> USB_DEVICE_ID_XIROKU_MPX2) },
>> - { .driver_data = MT_CLS_DEFAULT,
>> + { .driver_data = MT_CLS_NSMU,
>> MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
>> USB_DEVICE_ID_XIROKU_CSR2) },
>>
>> --
>> 1.8.1
>>
>
> Thanks,
> Henrik
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 06/25] HID: multitouch: optimize FlatFrog panels
2013-01-28 15:10 ` Henrik Rydberg
@ 2013-01-28 16:01 ` Benjamin Tissoires
0 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-28 16:01 UTC (permalink / raw)
To: Henrik Rydberg
Cc: Dmitry Torokhov, Jiri Kosina, Stephane Chatty, linux-input,
linux-kernel
On Mon, Jan 28, 2013 at 4:10 PM, Henrik Rydberg <rydberg@euromail.se> wrote:
> Hi Benjamin,
>
>> Relying on ALWAYS_VALID enhance a little the processing time of
>> the events.
>>
>> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
>> ---
>> drivers/hid/hid-multitouch.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> Is there a measurement backing up this claim? I suspect
> micro-optimizations of this kind drowns completely along the rather
> long way from device, via malloc and loops, to the input core.
No, the measure I made for this are roughly the same. It's purely
micro-optimization, and yes, mallocs must kill the processing time.
However, the purpose of this patch and the others entitled 'optimize
XXX' is to show that I did not invented the new default class. My true
objective is to remove all the quirks related to the 'valid'
information in order to have a driver as universal as possible and to
be able to clean it up.
> Considering the must-be-tested-for-regression risk on top of that,
> this patch falls far below what is worth doing, IMHO.
It _has_ been tested. I got the HID traces from FlatFrog and either
they use different firmwares with different processing in their
devices, the kernel processing is good.
Cheers,
Benjamin
>
>> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
>> index 5a886bd..7dfe891 100644
>> --- a/drivers/hid/hid-multitouch.c
>> +++ b/drivers/hid/hid-multitouch.c
>> @@ -229,8 +229,9 @@ static struct mt_class mt_classes[] = {
>> },
>>
>> { .name = MT_CLS_FLATFROG,
>> - .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
>> - MT_QUIRK_NO_AREA,
>> + .quirks = MT_QUIRK_ALWAYS_VALID |
>> + MT_QUIRK_NO_AREA |
>> + MT_QUIRK_CONTACT_CNT_ACCURATE,
>> .sn_move = 2048,
>> .maxcontacts = 40,
>> },
>> --
>> 1.8.1
>>
>
> Thanks.
> Henrik
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 02/25] HID: multitouch: add support for Nexio 42" panel
2013-01-28 15:01 ` Henrik Rydberg
@ 2013-01-28 16:08 ` Benjamin Tissoires
2013-01-28 16:56 ` Stéphane Chatty
1 sibling, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-28 16:08 UTC (permalink / raw)
To: Henrik Rydberg
Cc: Dmitry Torokhov, Jiri Kosina, Stephane Chatty, linux-input,
linux-kernel
On Mon, Jan 28, 2013 at 4:01 PM, Henrik Rydberg <rydberg@euromail.se> wrote:
> Hi Benjamin,
>
>> This device is the worst device I saw. It keeps TipSwitch and InRange
>> at 1 for fingers that are not touching the panel.
>> The solution is to rely on the field ContactCount, which is accurate
>> as the correct information are packed at the begining of the frame.
>>
>> Unfortunately, CountactCount is most of the time at the end of the report.
>> The solution is to pick it when we have the whole report in raw_event.
>>
>> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
>> ---
>> drivers/hid/hid-ids.h | 3 ++
>> drivers/hid/hid-multitouch.c | 91 ++++++++++++++++++++++++++++++++++++--------
>> 2 files changed, 78 insertions(+), 16 deletions(-)
>
> I think it would make more sense to introduce a method where the
> driver sees all report values at once. We have had reasonable cause to
> add it in the past, but never did.
I will definitively look into it. It seems a fair idea.
>
>>
>> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
>> index dad56aa..0935012 100644
>> --- a/drivers/hid/hid-ids.h
>> +++ b/drivers/hid/hid-ids.h
>> @@ -597,6 +597,9 @@
>> #define USB_VENDOR_ID_NEC 0x073e
>> #define USB_DEVICE_ID_NEC_USB_GAME_PAD 0x0301
>>
>> +#define USB_VENDOR_ID_NEXIO 0x1870
>> +#define USB_DEVICE_ID_NEXIO_MULTITOUCH_420 0x010d
>> +
>> #define USB_VENDOR_ID_NEXTWINDOW 0x1926
>> #define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003
>>
>> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
>> index 46d8136..c4acdd0 100644
>> --- a/drivers/hid/hid-multitouch.c
>> +++ b/drivers/hid/hid-multitouch.c
>> @@ -32,6 +32,8 @@
>> #include <linux/slab.h>
>> #include <linux/usb.h>
>> #include <linux/input/mt.h>
>> +#include <asm/unaligned.h>
>> +#include <asm/byteorder.h>
>> #include "usbhid/usbhid.h"
>>
>>
>> @@ -54,6 +56,7 @@ MODULE_LICENSE("GPL");
>> #define MT_QUIRK_NO_AREA (1 << 9)
>> #define MT_QUIRK_IGNORE_DUPLICATES (1 << 10)
>> #define MT_QUIRK_HOVERING (1 << 11)
>> +#define MT_QUIRK_CONTACT_CNT_ACCURATE (1 << 12)
>>
>> struct mt_slot {
>> __s32 x, y, cx, cy, p, w, h;
>> @@ -83,6 +86,10 @@ struct mt_device {
>> struct mt_class mtclass; /* our mt device class */
>> struct mt_fields *fields; /* temporary placeholder for storing the
>> multitouch fields */
>> + struct hid_field *contactcount; /* the hid_field contact count that
>> + will be picked in mt_raw_event */
>> + __s8 contactcount_index; /* the index of the usage contact count
>> + in its hid_field. */
>> unsigned last_field_index; /* last field index of the report */
>> unsigned last_slot_field; /* the last field of a slot */
>> __s8 inputmode; /* InputMode HID feature, -1 if non-existent */
>> @@ -111,6 +118,7 @@ struct mt_device {
>> #define MT_CLS_DUAL_INRANGE_CONTACTNUMBER 0x0007
>> #define MT_CLS_DUAL_NSMU_CONTACTID 0x0008
>> #define MT_CLS_INRANGE_CONTACTNUMBER 0x0009
>> +#define MT_CLS_ALWAYS_TRUE 0x000a
>>
>> /* vendor specific classes */
>> #define MT_CLS_3M 0x0101
>> @@ -170,6 +178,9 @@ static struct mt_class mt_classes[] = {
>> { .name = MT_CLS_INRANGE_CONTACTNUMBER,
>> .quirks = MT_QUIRK_VALID_IS_INRANGE |
>> MT_QUIRK_SLOT_IS_CONTACTNUMBER },
>> + { .name = MT_CLS_ALWAYS_TRUE,
>> + .quirks = MT_QUIRK_ALWAYS_VALID |
>> + MT_QUIRK_CONTACT_CNT_ACCURATE },
>>
>> /*
>> * vendor specific classes
>> @@ -250,6 +261,9 @@ static ssize_t mt_set_quirks(struct device *dev,
>>
>> td->mtclass.quirks = val;
>>
>> + if (!td->contactcount)
>> + td->mtclass.quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE;
>> +
>> return count;
>> }
>>
>> @@ -264,24 +278,26 @@ static struct attribute_group mt_attribute_group = {
>> .attrs = sysfs_attrs
>> };
>>
>> +static int mt_find_usage_index(struct hid_field *field, struct hid_usage *usage)
>> +{
>> + int i;
>> + for (i = 0; i < field->maxusage; i++) {
>> + if (field->usage[i].hid == usage->hid)
>> + return i;
>> + }
>> + return -1;
>> +}
>> +
>> static void mt_feature_mapping(struct hid_device *hdev,
>> struct hid_field *field, struct hid_usage *usage)
>> {
>> struct mt_device *td = hid_get_drvdata(hdev);
>> - int i;
>>
>> switch (usage->hid) {
>> case HID_DG_INPUTMODE:
>> td->inputmode = field->report->id;
>> - td->inputmode_index = 0; /* has to be updated below */
>> -
>> - for (i=0; i < field->maxusage; i++) {
>> - if (field->usage[i].hid == usage->hid) {
>> - td->inputmode_index = i;
>> - break;
>> - }
>> - }
>> -
>> + td->inputmode_index = mt_find_usage_index(field, usage);
>> + /* inputmode_index can't be set at -1 */
>> break;
>> case HID_DG_CONTACTMAX:
>> td->maxcontact_report_id = field->report->id;
>> @@ -459,6 +475,10 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
>> td->last_field_index = field->index;
>> return 1;
>> case HID_DG_CONTACTCOUNT:
>> + td->contactcount = field;
>> + td->contactcount_index = mt_find_usage_index(field,
>> + usage);
>> + /* contactcount_index can't be set at -1 */
>> td->last_field_index = field->index;
>> return 1;
>> case HID_DG_CONTACTMAX:
>> @@ -523,6 +543,10 @@ static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
>> */
>> static void mt_complete_slot(struct mt_device *td, struct input_dev *input)
>> {
>> + if ((td->mtclass.quirks & MT_QUIRK_CONTACT_CNT_ACCURATE) &&
>> + td->num_received >= td->num_expected)
>> + return;
>> +
>> if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) {
>> int slotnum = mt_compute_slot(td, input);
>> struct mt_slot *s = &td->curdata;
>> @@ -623,12 +647,6 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
>> td->curdata.h = value;
>> break;
>> case HID_DG_CONTACTCOUNT:
>> - /*
>> - * Includes multi-packet support where subsequent
>> - * packets are sent with zero contactcount.
>> - */
>> - if (value)
>> - td->num_expected = value;
>> break;
>> case HID_DG_TOUCH:
>> /* do nothing */
>> @@ -658,6 +676,37 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
>> return 1;
>> }
>>
>> +static int mt_raw_event(struct hid_device *hid, struct hid_report *report,
>> + u8 *data, int size)
>> +{
>> + struct mt_device *td = hid_get_drvdata(hid);
>> + struct hid_field *field = td->contactcount;
>> + s32 *value;
>> +
>> + if (field && report->id == field->report->id) {
>> + /*
>> + * Pick in advance the field HID_DG_CONTACTCOUNT as it is
>> + * often placed at the end of the report.
>> + */
>> + if (report->id)
>> + data++;
>> +
>> + value = hid_extract_field(hid, field, data);
>> + if (!value)
>> + return 0;
>> +
>> + /*
>> + * Includes multi-packet support where subsequent
>> + * packets are sent with zero contactcount.
>> + */
>> + if (value[td->contactcount_index])
>> + td->num_expected = value[td->contactcount_index];
>> +
>> + kfree(value);
>> + }
>> + return 0;
>> +}
>
> This is a lot of cycles for something that is already available in the core.
Not that much: raw_event is called once per report (unlike ->event
which is called one per field per report).
So there is only one extra malloc if the quirk is in place compared to
the current implementation.
Cheers,
Benjamin
>
>> +
>> static void mt_set_input_mode(struct hid_device *hdev)
>> {
>> struct mt_device *td = hid_get_drvdata(hdev);
>> @@ -719,11 +768,15 @@ static void mt_post_parse_default_settings(struct mt_device *td)
>> static void mt_post_parse(struct mt_device *td)
>> {
>> struct mt_fields *f = td->fields;
>> + struct mt_class *cls = &td->mtclass;
>>
>> if (td->touches_by_report > 0) {
>> int field_count_per_touch = f->length / td->touches_by_report;
>> td->last_slot_field = f->usages[field_count_per_touch - 1];
>> }
>> +
>> + if (!td->contactcount)
>> + cls->quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE;
>> }
>>
>> static void mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
>> @@ -1056,6 +1109,11 @@ static const struct hid_device_id mt_devices[] = {
>> MT_USB_DEVICE(USB_VENDOR_ID_TURBOX,
>> USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) },
>>
>> + /* Nexio panels */
>> + { .driver_data = MT_CLS_ALWAYS_TRUE,
>> + MT_USB_DEVICE(USB_VENDOR_ID_NEXIO,
>> + USB_DEVICE_ID_NEXIO_MULTITOUCH_420)},
>> +
>> /* Panasonic panels */
>> { .driver_data = MT_CLS_PANASONIC,
>> MT_USB_DEVICE(USB_VENDOR_ID_PANASONIC,
>> @@ -1193,6 +1251,7 @@ static struct hid_driver mt_driver = {
>> .feature_mapping = mt_feature_mapping,
>> .usage_table = mt_grabbed_usages,
>> .event = mt_event,
>> + .raw_event = mt_raw_event,
>
> Rather a new and simpler event method here, in other words.
>
>> #ifdef CONFIG_PM
>> .reset_resume = mt_reset_resume,
>> .resume = mt_resume,
>> --
>> 1.8.1
>>
>
> Thanks,
> Henrik
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch
2013-01-28 15:23 ` [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Henrik Rydberg
@ 2013-01-28 16:15 ` Benjamin Tissoires
0 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-28 16:15 UTC (permalink / raw)
To: Henrik Rydberg
Cc: Dmitry Torokhov, Jiri Kosina, Stephane Chatty, linux-input,
linux-kernel
Hi Henrik,
On Mon, Jan 28, 2013 at 4:23 PM, Henrik Rydberg <rydberg@euromail.se> wrote:
> Hi Benjamin,
>
>> finally, I managed to send a new bunch of patches. Sorry for the delay from the
>> previous version, but meanwhile, I implemented an automatic regressions tests
>> for hid device [1].
>> So this series seems pretty big, but it does not break any known devices (I ran
>> 40 successful tests for this series)[2].
>
> Thanks for the patches.
And thanks for reviewing.
>
>> To sum up:
>> - Nexio devices were problematic in the sense they use out of range values for
>> some of the fields, and consider that the driver won't treat the extra touches
>> based on the reported contact count.
>
> Problematic device, but I think we should add a new event function
> which gives all values at the same time, since those are already
> present in the core. It seems this will solve the current problem as
> well as many older workarounds.
yeah, makes sense. I think it would also allows us to simplify the
logic of hid-multitouch by removing some of the states we have in it.
>
>> - fortunately, this behavior (relying on contact count) is compatible with all
>> the devices I know, which leads to think that this is how the Windows 7/8 driver
>> manage to handle such a different bunch of devices.
>
> This is a nice observation. IIRC, we used to rely more on contact
> count in the old drivers.
>
>> - thanks to the automatic testing, I was able to fix broken devices
>> (Sharp LC-20FE1-W screen 04dd:9681, Sitronix 1403:5001 and Cando 2087:0a02)
>> and optimize many others. In order to allow a bisection to be done, I split
>> the patches in many different ones, one per device type.
>
> Great tool, thank you Benjamin.
Once I will do the work on the suppression of usbhid direct use, we
also could rely on that for every HID devices, not only
hid-multitouch.
>
>> - finally, I changed the default class in order to handle the new devices in a
>> better way.
>
> Old wisdom says differently. ;-)
No: old wisdom says the exact same thing :) I did not break the
current supported devices. I _kept_ the old default class for all the
current supported devices, and I used the new default class only for
the new devices, the one that are not registered.
Cheers,
Benjamin
>
> Thanks,
> Henrik
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 02/25] HID: multitouch: add support for Nexio 42" panel
2013-01-28 15:01 ` Henrik Rydberg
2013-01-28 16:08 ` Benjamin Tissoires
@ 2013-01-28 16:56 ` Stéphane Chatty
2013-01-28 17:50 ` Benjamin Tissoires
1 sibling, 1 reply; 37+ messages in thread
From: Stéphane Chatty @ 2013-01-28 16:56 UTC (permalink / raw)
To: Henrik Rydberg
Cc: Benjamin Tissoires, Dmitry Torokhov, Jiri Kosina, linux-input,
linux-kernel
Le 28 janv. 2013 à 16:01, Henrik Rydberg a écrit :
> Hi Benjamin,
>
>> This device is the worst device I saw. It keeps TipSwitch and InRange
>> at 1 for fingers that are not touching the panel.
>> The solution is to rely on the field ContactCount, which is accurate
>> as the correct information are packed at the begining of the frame.
>>
>> Unfortunately, CountactCount is most of the time at the end of the report.
>> The solution is to pick it when we have the whole report in raw_event.
>>
>> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
>> ---
>> drivers/hid/hid-ids.h | 3 ++
>> drivers/hid/hid-multitouch.c | 91 ++++++++++++++++++++++++++++++++++++--------
>> 2 files changed, 78 insertions(+), 16 deletions(-)
>
> I think it would make more sense to introduce a method where the
> driver sees all report values at once. We have had reasonable cause to
> add it in the past, but never did.
I dreamed of this more than once in the early days of hid-multitouch, yes. But then it requires quite a few changes in hid-core.c, doesn't it?
Cheers,
St.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 02/25] HID: multitouch: add support for Nexio 42" panel
2013-01-28 16:56 ` Stéphane Chatty
@ 2013-01-28 17:50 ` Benjamin Tissoires
0 siblings, 0 replies; 37+ messages in thread
From: Benjamin Tissoires @ 2013-01-28 17:50 UTC (permalink / raw)
To: Stéphane Chatty
Cc: Henrik Rydberg, Dmitry Torokhov, Jiri Kosina, linux-input,
linux-kernel
On 01/28/2013 05:56 PM, Stéphane Chatty wrote:
>
> Le 28 janv. 2013 à 16:01, Henrik Rydberg a écrit :
>
>> Hi Benjamin,
>>
>>> This device is the worst device I saw. It keeps TipSwitch and InRange
>>> at 1 for fingers that are not touching the panel.
>>> The solution is to rely on the field ContactCount, which is accurate
>>> as the correct information are packed at the begining of the frame.
>>>
>>> Unfortunately, CountactCount is most of the time at the end of the report.
>>> The solution is to pick it when we have the whole report in raw_event.
>>>
>>> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
>>> ---
>>> drivers/hid/hid-ids.h | 3 ++
>>> drivers/hid/hid-multitouch.c | 91 ++++++++++++++++++++++++++++++++++++--------
>>> 2 files changed, 78 insertions(+), 16 deletions(-)
>>
>> I think it would make more sense to introduce a method where the
>> driver sees all report values at once. We have had reasonable cause to
>> add it in the past, but never did.
>
>
> I dreamed of this more than once in the early days of hid-multitouch, yes. But then it requires quite a few changes in hid-core.c, doesn't it?
>
Surprisingly, the hid-core part is very small. The difficulties come in hid-multitouch. But the good is that it's working :)
I'll send an updated series soon.
Cheers,
Benjamin
From 2ea45e1f42fdf1991a457b36ad9e4e729d9febc6 Mon Sep 17 00:00:00 2001
From: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Date: Mon, 28 Jan 2013 18:30:32 +0100
Subject: [PATCH 1/4] HID: add "report" callback
This callback is called when the parsing of the report has been done
by hid core. The driver can now rely on the values stored in the
different fields.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-core.c | 4 ++++
include/linux/hid.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index eb2ee11..754098a 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1195,6 +1195,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
{
struct hid_report_enum *report_enum = hid->report_enum + type;
struct hid_report *report;
+ struct hid_driver *hdrv;
unsigned int a;
int rsize, csize = size;
u8 *cdata = data;
@@ -1231,6 +1232,9 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
if (hid->claimed != HID_CLAIMED_HIDRAW) {
for (a = 0; a < report->maxfield; a++)
hid_input_field(hid, report->field[a], cdata, interrupt);
+ hdrv = hid->driver;
+ if (hdrv && hdrv->report)
+ hdrv->report(hid, report);
}
if (hid->claimed & HID_CLAIMED_INPUT)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 7330a0f..09dbd09 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -627,6 +627,7 @@ struct hid_driver {
const struct hid_usage_id *usage_table;
int (*event)(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value);
+ void (*report)(struct hid_device *hdev, struct hid_report *report);
__u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf,
unsigned int *size);
--
1.8.1
From fecc6efa1900611ef601837734f278bc06610aa8 Mon Sep 17 00:00:00 2001
From: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Date: Mon, 28 Jan 2013 18:39:51 +0100
Subject: [PATCH 2/4] HID: multitouch: use the callback "report" instead of
sequential events
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 48 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 42 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 61543c0..c692305 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -85,6 +85,7 @@ struct mt_device {
multitouch fields */
unsigned last_field_index; /* last field index of the report */
unsigned last_slot_field; /* the last field of a slot */
+ unsigned mt_report_id; /* the report ID of the multitouch device */
__s8 inputmode; /* InputMode HID feature, -1 if non-existent */
__s8 inputmode_index; /* InputMode HID feature index in the report */
__s8 maxcontact_report_id; /* Maximum Contact Number HID feature,
@@ -428,6 +429,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
mt_store_field(usage, td, hi);
td->last_field_index = field->index;
td->touches_by_report++;
+ td->mt_report_id = field->report->id;
return 1;
case HID_DG_WIDTH:
hid_map_usage(hi, usage, bit, max,
@@ -579,6 +581,22 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{
struct mt_device *td = hid_get_drvdata(hid);
+
+ if (field->report->id != td->mt_report_id)
+ /* fallback to the generic hidinput handling */
+ return 0;
+
+ /* we will handle the hidinput part, now remains hiddev */
+ if (hid->claimed & HID_CLAIMED_HIDDEV && hid->hiddev_hid_event)
+ hid->hiddev_hid_event(hid, field, usage, value);
+
+ return 1;
+}
+
+static void mt_process_mt_event(struct hid_device *hid, struct hid_field *field,
+ struct hid_usage *usage, __s32 value)
+{
+ struct mt_device *td = hid_get_drvdata(hid);
__s32 quirks = td->mtclass.quirks;
if (hid->claimed & HID_CLAIMED_INPUT) {
@@ -635,8 +653,7 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
break;
default:
- /* fallback to the generic hidinput handling */
- return 0;
+ return;
}
if (usage->usage_index + 1 == field->report_count) {
@@ -650,12 +667,30 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
}
}
+}
- /* we have handled the hidinput part, now remains hiddev */
- if (hid->claimed & HID_CLAIMED_HIDDEV && hid->hiddev_hid_event)
- hid->hiddev_hid_event(hid, field, usage, value);
+static void mt_report(struct hid_device *hid, struct hid_report *report)
+{
+ struct mt_device *td = hid_get_drvdata(hid);
+ struct hid_field *field;
+ struct hid_field *field_cc = td->contactcount;
+ unsigned count;
+ int r, n;
- return 1;
+ if (report->id != td->mt_report_id)
+ return;
+
+ for (r = 0; r < report->maxfield; r++) {
+ field = report->field[r];
+ count = field->report_count;
+
+ if (!(HID_MAIN_ITEM_VARIABLE & field->flags))
+ continue;
+
+ for (n = 0; n < count; n++)
+ mt_process_mt_event(hid, field, &field->usage[n],
+ field->value[n]);
+ }
}
static void mt_set_input_mode(struct hid_device *hdev)
@@ -1193,6 +1228,7 @@ static struct hid_driver mt_driver = {
.feature_mapping = mt_feature_mapping,
.usage_table = mt_grabbed_usages,
.event = mt_event,
+ .report = mt_report,
#ifdef CONFIG_PM
.reset_resume = mt_reset_resume,
.resume = mt_resume,
--
1.8.1
From 02f3c2f43fa31838dc8faef65690439c85a66086 Mon Sep 17 00:00:00 2001
From: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Date: Mon, 28 Jan 2013 18:37:59 +0100
Subject: [PATCH 4/4] HID: multitouch: pick the contact count field in advance
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
drivers/hid/hid-multitouch.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 6ce232e..3d7db96 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -698,6 +698,13 @@ static void mt_report(struct hid_device *hid, struct hid_report *report)
if (report->id != td->mt_report_id)
return;
+ /*
+ * Includes multi-packet support where subsequent
+ * packets are sent with zero contactcount.
+ */
+ if (field_cc->value[td->contactcount_index])
+ td->num_expected = field_cc->value[td->contactcount_index];
+
for (r = 0; r < report->maxfield; r++) {
field = report->field[r];
count = field->report_count;
--
1.8.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
end of thread, other threads:[~2013-01-28 17:50 UTC | newest]
Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25 13:22 [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 01/25] HID: break out hid_extract_field Benjamin Tissoires
2013-01-28 15:04 ` Henrik Rydberg
2013-01-25 13:22 ` [PATCH 02/25] HID: multitouch: add support for Nexio 42" panel Benjamin Tissoires
2013-01-28 15:01 ` Henrik Rydberg
2013-01-28 16:08 ` Benjamin Tissoires
2013-01-28 16:56 ` Stéphane Chatty
2013-01-28 17:50 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 03/25] HID: multitouch: fix Win8 protocol for Sharp like devices Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 04/25] HID: multitouch: ensure that serial devices make no use of contact count Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 05/25] HID: multitouch: fix protocol for Sitronix 1403:5001 Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 06/25] HID: multitouch: optimize FlatFrog panels Benjamin Tissoires
2013-01-28 15:10 ` Henrik Rydberg
2013-01-28 16:01 ` Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 07/25] HID: multitouch: optimize 3M panels Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 08/25] HID: multitouch: optimize Cypress panels Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 09/25] HID: multitouch: optimize eGalax panels Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 10/25] HID: multitouch: optimize Stantum panels Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 11/25] HID: multitouch: optimize Quanta panels Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 12/25] HID: multitouch: optimize Lumio panels Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 13/25] HID: multitouch: optimize MosArt panels Benjamin Tissoires
2013-01-25 13:22 ` [PATCH 14/25] HID: multitouch: optimize Elo panels Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 15/25] HID: multitouch: optimize Hanvon panels Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 16/25] HID: multitouch: optimize IRTouch panels Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 17/25] HID: multitouch: fix protocol for Cando 2087:0a02 Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 18/25] HID: multitouch: optimize Cando panels Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 19/25] HID: multitouch: optimize ActionStar panels Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 20/25] HID: multitouch: optimize Atmel panels Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 21/25] HID: multitouch: optimize Ideacom panels Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 22/25] HID: multitouch: optimize LG panels Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 23/25] HID: multitouch: optimize Nexio panels Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 24/25] HID: multitouch: remove useless DUAL_NSMU_CONTACTID class Benjamin Tissoires
2013-01-25 13:23 ` [PATCH 25/25] HID: multitouch: make MT_CLS_ALWAYS_TRUE the new default class Benjamin Tissoires
2013-01-28 15:13 ` Henrik Rydberg
2013-01-28 15:54 ` Benjamin Tissoires
2013-01-28 15:23 ` [PATCH 00/25] Support of Nexio 42" and new default class for hid-multitouch Henrik Rydberg
2013-01-28 16:15 ` Benjamin Tissoires
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).