Skip to contentSkip to conversation

HID: add multi-input quirk for eGalax Touchcontroller

PATCH In review Peter Hutterer 2 participants 7 messages Feb 2, 2010 – May 10, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: add multi-input quirk for eGalax Touchcontroller

---
I've got one of these devices on my desk and it seems that it suffers from the ABS_Z/ABS_RX issue that we've seen in other devices before. This patch uses the same reasoning as 9db630b48a99adb4156e205b812fba8959644280.

Nonetheless, I'm not sure about whether that's the right thing to do. With this patch applied, it gives me two devices, one mute, the other one announces BTN_PEN and BTN_TOUCH + abs axes, though only BTN_TOUCH is ever triggered. Loading usbtouchscreen instead of usbhid for this device makes the device look more sane BTN_TOUCH + abs axes but the actual data is random. So I'm not quite sure what the fix is supposed to be, any hints are appreciated if it's not the patch below.

Cheers,
Peter

 drivers/hid/hid-ids.h           |    3 +++
 drivers/hid/usbhid/hid-quirks.c |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/hid/hid-ids.h +3 -0
index f5144b8..2e698a2 100644
@@ -158,6 +158,9 @@
 
 #define USB_VENDOR_ID_DRAGONRISE	0x0079
 
+#define USB_VENDOR_ID_EGALAX		0x0EEF
+#define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER	0x0001
+
 #define USB_VENDOR_ID_ELO		0x04E7
 #define USB_DEVICE_ID_ELO_TS2700	0x0020
 
drivers/hid/usbhid/hid-quirks.c +1 -0
index e987562..dc27d74 100644
@@ -32,6 +32,7 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD },
 	{ USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD },
 	{ USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD },
+	{ USB_VENDOR_ID_EGALAX, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
Signature · 1 line
1.6.5.2
#1 lore raw
Quoted 7 lines · Peter Hutterer

Nonetheless, I'm not sure about whether that's the right thing to do. With this patch applied, it gives me two devices, one mute, the other one announces BTN_PEN and BTN_TOUCH + abs axes, though only BTN_TOUCH is ever triggered. Loading usbtouchscreen instead of usbhid for this device makes the device look more sane BTN_TOUCH + abs axes but the actual data is random. So I'm not quite sure what the fix is supposed to be, any hints are appreciated if it's not the patch below.

The data could also be mis-interpreted because of some bug in the HID descriptor.

Does looking at the HID report descriptor and looking at the actual raw HID reports coming out from the device give any clue? (in recent kernels, you can just use 'hid' directory in debugfs to gather all this information).

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#2 lore raw
Quoted 10 lines · Jiri Kosina
Quoted 7 lines · Peter Hutterer

Nonetheless, I'm not sure about whether that's the right thing to do. With this patch applied, it gives me two devices, one mute, the other one announces BTN_PEN and BTN_TOUCH + abs axes, though only BTN_TOUCH is ever triggered. Loading usbtouchscreen instead of usbhid for this device makes the device look more sane BTN_TOUCH + abs axes but the actual data is random. So I'm not quite sure what the fix is supposed to be, any hints are appreciated if it's not the patch below.

Quoted 7 lines

The data could also be mis-interpreted because of some bug in the HID descriptor.

Does looking at the HID report descriptor and looking at the actual raw HID reports coming out from the device give any clue? (in recent kernels, you can just use 'hid' directory in debugfs to gather all this information).

Thanks. The hid descriptor table is attached, but tbh I'm not well-versed enough in the HID protocol to even tell what format I can give you. I've attached a simple hexdump of two presses, one with a finger, one with the stylus. Let me know what format you need or what how I can start to decypher this myself (are there any parsing tools around?).

Cheers,
Peter

0000000 720a 7065 726f 2074 7328 7a69 2065 2936 0000010 2820 756e 626d 7265 6465 0a29 7200 7065 0000020 726f 2074 2032 7328 7a69 2065 2936 3d20 0000030 0020 3020 0032 3020 0033 6120 0030 3020 0000040 0031 3120 0033 3020 0032 000a 6944 6967 0000050 6974 657a 7372 542e 7069 7753 7469 6863 0000060 3d20 3120 000a 6944 6967 6974 657a 7372 0000070 492e 526e 6e61 6567 3d20 3120 000a 6547 0000080 656e 6972 4463 7365 746b 706f 582e 3d20 0000090 3420 3631 000a 6547 656e 6972 4463 7365 00000a0 746b 706f 592e 3d20 3520 3133 000a 720a 00000b0 7065 726f 2074 7328 7a69 2065 2936 2820 00000c0 756e 626d 7265 6465 0a29 7200 7065 726f 00000d0 2074 2032 7328 7a69 2065 2936 3d20 0020 00000e0 3020 0032 3020 0033 6120 0030 3020 0031 00000f0 3120 0032 3020 0032 000a 6944 6967 6974 0000100 657a 7372 542e 7069 7753 7469 6863 3d20 0000110 3120 000a 6944 6967 6974 657a 7372 492e 0000120 526e 6e61 6567 3d20 3120 000a 6547 656e 0000130 6972 4463 7365 746b 706f 582e 3d20 3420 0000140 3631 000a 6547 656e 6972 4463 7365 746b 0000150 706f 592e 3d20 3520 3033 000a 720a 7065 0000160 726f 2074 7328 7a69 2065 2936 2820 756e 0000170 626d 7265 6465 0a29 7200 7065 726f 2074 0000180 2032 7328 7a69 2065 2936 3d20 0020 3020 0000190 0032 3020 0033 6120 0030 3020 0031 3120 00001a0 0030 3020 0032 000a 6944 6967 6974 657a 00001b0 7372 542e 7069 7753 7469 6863 3d20 3120 00001c0 000a 6944 6967 6974 657a 7372 492e 526e 00001d0 6e61 6567 3d20 3120 000a 6547 656e 6972 00001e0 4463 7365 746b 706f 582e 3d20 3420 3631 00001f0 000a 6547 656e 6972 4463 7365 746b 006f 0000200 2e70 2059 203d 3235 0a38 0a00 6572 6f70 0000210 7472 2820 6973 657a 3620 2029 6e28 6d75 0000220 6562 6572 2964 000a 6572 6f70 7472 3220 0000230 2820 6973 657a 3620 2029 203d 2000 3230 0000240 2000 3330 2000 6639 2000 3130 2000 6530 0000250 2000 3230 0a00 4400 6769 7469 7a69 7265 0000260 2e73 6954 5370 6977 6374 2068 203d 0a31 0000270 4400 6769 7469 7a69 7265 2e73 6e49 6152 0000280 676e 2065 203d 0a31 4700 6e65 7265 6369 0000290 6544 6b73 6f74 2e70 2058 203d 3134 0a35 00002a0 4700 6e65 7265 6369 6544 6b73 6f74 2e70 00002b0 2059 203d 3235 0a36 0a00 6572 6f70 7472 00002c0 2820 6973 657a 3620 2029 6e28 6d75 6562 00002d0 6572 2964 000a 6572 6f70 7472 3220 2820 00002e0 6973 657a 3620 2029 203d 2000 3230 2000 00002f0 3330 2000 3161 2000 3130 2000 6430 2000 0000300 3230 0a00 4400 6769 7469 7a69 7265 2e73 0000310 6954 5370 6977 6374 2068 203d 0a31 4400 0000320 6769 7469 7a69 7265 2e73 6e49 6152 676e 0000330 2065 203d 0a31 4700 6e65 7265 6369 6544 0000340 6b73 6f74 2e70 2058 203d 3134 0a37 4700 0000350 6e65 7265 6369 6544 6b73 6f74 2e70 2059 0000360 203d 3235 0a35 0a00 6572 6f70 7472 2820 0000370 6973 657a 3620 2029 6e28 6d75 6562 6572 0000380 2964 000a 6572 6f70 7472 3220 2820 6973 0000390 657a 3620 2029 203d 2000 3230 2000 3330 00003a0 2000 3161 2000 3130 2000 6330 2000 3230 00003b0 0a00 4400 6769 7469 7a69 7265 2e73 6954 00003c0 5370 6977 6374 2068 203d 0a31 4400 6769 00003d0 7469 7a69 7265 2e73 6e49 6152 676e 2065 00003e0 203d 0a31 4700 6e65 7265 6369 6544 6b73 00003f0 6f74 2e70 2058 203d 3134 0a37 4700 0065 0000400 656e 6972 4463 7365 746b 706f 592e 3d20 0000410 3520 3432 000a 720a 7065 726f 2074 7328 0000420 7a69 2065 2936 2820 756e 626d 7265 6465 0000430 0a29 7200 7065 726f 2074 2032 7328 7a69 0000440 2065 2936 3d20 0020 3020 0032 3020 0033 0000450 6120 0031 3020 0031 3020 0062 3020 0032 0000460 000a 6944 6967 6974 657a 7372 542e 7069 0000470 7753 7469 6863 3d20 3120 000a 6944 6967 0000480 6974 657a 7372 492e 526e 6e61 6567 3d20 0000490 3120 000a 6547 656e 6972 4463 7365 746b 00004a0 706f 582e 3d20 3420 3731 000a 6547 656e 00004b0 6972 4463 7365 746b 706f 592e 3d20 3520 00004c0 3332 000a 720a 7065 726f 2074 7328 7a69 00004d0 2065 2936 2820 756e 626d 7265 6465 0a29 00004e0 7200 7065 726f 2074 2032 7328 7a69 2065 00004f0 2936 3d20 0020 3020 0032 3020 0033 6120 0000500 0030 3020 0031 3020 0064 3020 0032 000a 0000510 6944 6967 6974 657a 7372 542e 7069 7753 0000520 7469 6863 3d20 3120 000a 6944 6967 6974 0000530 657a 7372 492e 526e 6e61 6567 3d20 3120 0000540 000a 6547 656e 6972 4463 7365 746b 706f 0000550 582e 3d2

05 01 09 01 a1 01 85 01 09 01 a1 00 05 09 19 01 29 02 15 00 25 01 95 02 75 01 81 02 95 01 75 06 81 01 05 01 09 30 09 31 16 2a 00 26 bd 07 36 00 00 46 ff 0f 66 00 00 75 10 95 02 81 02 c0 c0 05 0d 09 04 a1 01 85 02 09 20 a1 00 09 42 09 32 15 00 25 01 95 02 75 01 81 02 95 06 75 01 81 03 05 01 09 30 75 10 95 01 a4 55 00 65 00 36 00 00 46 00 00 16 1e 00 26 c8 0f 81 02 09 31 16 3c 00 26 c3 0f 36 00 00 46 00 00 81 02 b4 c0 c0

INPUT(1)[INPUT]

    Field(0)
      Physical(GenericDesktop.Pointer)
      Usage(2)
        Button.0001
        Button.0002
      Logical Minimum(0)
      Logical Maximum(1)
      Report Size(1)
      Report Count(2)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Physical(GenericDesktop.Pointer)
      Usage(2)
        GenericDesktop.X
        GenericDesktop.Y
      Logical Minimum(42)
      Logical Maximum(1981)
      Physical Minimum(0)
      Physical Maximum(4095)
      Report Size(16)
      Report Count(2)
      Report Offset(8)
      Flags( Variable Absolute )
  INPUT(2)[INPUT]
    Field(0)
      Physical(Digitizers.Stylus)
      Usage(2)
        Digitizers.TipSwitch
        Digitizers.InRange
      Logical Minimum(0)
      Logical Maximum(1)
      Physical Minimum(0)
      Physical Maximum(4095)
      Report Size(1)
      Report Count(2)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Physical(Digitizers.Stylus)
      Usage(1)
        GenericDesktop.X
      Logical Minimum(30)
      Logical Maximum(4040)
      Report Size(16)
      Report Count(1)
      Report Offset(8)
      Flags( Variable Absolute )
    Field(2)
      Physical(Digitizers.Stylus)
      Usage(1)
        GenericDesktop.Y
      Logical Minimum(60)
      Logical Maximum(4035)
      Report Size(16)
      Report Count(1)
      Report Offset(24)
      Flags( Variable Absolute )

Button.0001 ---> Key.LeftBtn
Button.0002 ---> Key.RightBtn GenericDesktop.X ---> Absolute.X GenericDesktop.Y ---> Absolute.Y Digitizers.TipSwitch ---> Key.Touch Digitizers.InRange ---> Key.ToolPen GenericDesktop.X ---> Absolute.X GenericDesktop.Y ---> Absolute.Y

#3 lore raw
Quoted 10 lines · Peter Hutterer
Quoted 4 lines

Does looking at the HID report descriptor and looking at the actual raw HID reports coming out from the device give any clue? (in recent kernels, you can just use 'hid' directory in debugfs to gather all this information).

Thanks. The hid descriptor table is attached, but tbh I'm not well-versed enough in the HID protocol to even tell what format I can give you. I've attached a simple hexdump of two presses, one with a finger, one with the stylus. Let me know what format you need or what how I can start to decypher this myself (are there any parsing tools around?).

It shouldn't be necesarry to run hexdump on the 'events' node, the data coming from it are supposed to already be parsed and human-readable.

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#4 lore raw
Quoted 7 lines · Jiri Kosina
Quoted 5 lines · Peter Hutterer
Quoted 4 lines

Does looking at the HID report descriptor and looking at the actual raw HID reports coming out from the device give any clue? (in recent kernels, you can just use 'hid' directory in debugfs to gather all this information).

Quoted 8 lines
Quoted 5 lines

Thanks. The hid descriptor table is attached, but tbh I'm not well-versed enough in the HID protocol to even tell what format I can give you. I've attached a simple hexdump of two presses, one with a finger, one with the stylus. Let me know what format you need or what how I can start to decypher this myself (are there any parsing tools around?).

It shouldn't be necesarry to run hexdump on the 'events' node, the data coming from it are supposed to already be parsed and human-readable.

aah, don't we love a good brown paper bag moment...

events are below, if I read this correctly the hardware might need a quirk for the permanently-set InRange bits.

report (size 6) (numbered)
report 2 (size 6) = 02 03 69 0e c4 03
Digitizers.TipSwitch = 1
Digitizers.InRange = 1
GenericDesktop.X = 3689
GenericDesktop.Y = 964

report (size 6) (numbered)
report 2 (size 6) = 02 03 6f 0e bb 03
Digitizers.TipSwitch = 1
Digitizers.InRange = 1
GenericDesktop.X = 3695
GenericDesktop.Y = 955

[...]

report (size 6) (numbered)
report 2 (size 6) = 02 02 71 0e a9 03
Digitizers.TipSwitch = 0
Digitizers.InRange = 1
GenericDesktop.X = 3697
GenericDesktop.Y = 937

report (size 6) (numbered)
report 2 (size 6) = 02 03 68 0e d1 03
Digitizers.TipSwitch = 1
Digitizers.InRange = 1
GenericDesktop.X = 3688
GenericDesktop.Y = 977

report (size 6) (numbered)
report 2 (size 6) = 02 03 67 0e d1 03
Digitizers.TipSwitch = 1
Digitizers.InRange = 1
GenericDesktop.X = 3687

[...]

report (size 6) (numbered)
report 2 (size 6) = 02 02 7b 0e dd 03
Digitizers.TipSwitch = 0
Digitizers.InRange = 1
GenericDesktop.X = 3707
GenericDesktop.Y = 989

#5 lore raw
In reply to Peter Hutterer

Hi Jiri,

Quoted 6 lines · Peter Hutterer

---
I've got one of these devices on my desk and it seems that it suffers from the ABS_Z/ABS_RX issue that we've seen in other devices before. This patch uses the same reasoning as 9db630b48a99adb4156e205b812fba8959644280.

Quoted 7 lines

Nonetheless, I'm not sure about whether that's the right thing to do. With this patch applied, it gives me two devices, one mute, the other one announces BTN_PEN and BTN_TOUCH + abs axes, though only BTN_TOUCH is ever triggered. Loading usbtouchscreen instead of usbhid for this device makes the device look more sane BTN_TOUCH + abs axes but the actual data is random. So I'm not quite sure what the fix is supposed to be, any hints are appreciated if it's not the patch below.

See https://patchwork.kernel.org/patch/76210/ for the original thread. This patch never got merged, were you waiting on me or did it just drop under the table?

I'm getting positive reports from users that this indeed fixes the issues for their device.
https://bugzilla.redhat.com/show_bug.cgi?id=473144

Cheers,
Peter

Quoted 32 lines
 drivers/hid/hid-ids.h           |    3 +++
 drivers/hid/usbhid/hid-quirks.c |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/hid/hid-ids.h +3 -0
index f5144b8..2e698a2 100644
@@ -158,6 +158,9 @@
 
 #define USB_VENDOR_ID_DRAGONRISE	0x0079
 
+#define USB_VENDOR_ID_EGALAX		0x0EEF
+#define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER	0x0001
+
 #define USB_VENDOR_ID_ELO		0x04E7
 #define USB_DEVICE_ID_ELO_TS2700	0x0020
 
drivers/hid/usbhid/hid-quirks.c +1 -0
index e987562..dc27d74 100644
@@ -32,6 +32,7 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD },
 	{ USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD },
 	{ USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD },
+	{ USB_VENDOR_ID_EGALAX, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
Signature · 1 line
1.6.5.2
#6 lore raw
Quoted 11 lines · Peter Hutterer
Quoted 3 lines

I've got one of these devices on my desk and it seems that it suffers from the ABS_Z/ABS_RX issue that we've seen in other devices before. This patch uses the same reasoning as 9db630b48a99adb4156e205b812fba8959644280.

See https://patchwork.kernel.org/patch/76210/ for the original thread. This patch never got merged, were you waiting on me or did it just drop under the table?

I'm getting positive reports from users that this indeed fixes the issues for their device.
https://bugzilla.redhat.com/show_bug.cgi?id=473144

Sorry, I have lost the original thread. I have applied the patch now.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.