Menu

#321 Second stylus button doesn't work with tablets based on Wacom Feel IT Technologies

closed-fixed
None
input-wacom
2016-12-23
2016-06-19
No

Hello,
I already posted this bug on kernel bugzilla, but I think I can get more specific information on what I should do next.

To make it short, I bought a Fujitsu tablet with one-button stylus, and Fujitsu tablet driver is installed on that tablet. I later bought a "Fujitsu Digitizer pen T5000" with two buttons and eraser, sold from Fujitsu. With driver provided by Wacom, the second button works on Windows.
Now, the second button doesn't work on Linux.

My tablet (QH55/M) is based on "Wacom Feel IT Technologies".
Here's partial list of tablets based on WFITT.
So, Microsoft Surface Pro 2 for example, can also handle second button I belive.

I noticed HID descriptor of this tablet is weird. In Report ID 2, there's no Usage 0x5a (Barrel switch 2) but 0x00 (undefined). So I created a patch to see both of them identical. And now the second button works as a BTN_STYLUS2.

I'd like someone confirm the second button actually work on WFITT tablet, and implement this feature on mainline kernel. Apparently my patch needs improvement. What should I do next?

2 Attachments

Discussion

  • Jason Gerecke

    Jason Gerecke - 2016-06-20

    Thanks for the report. After looking through the HID descriptors I've collected from a few other tablets, I agree that this might affect many more devices than just yours. Although it looks like the 0x000D0000 usage is only used for the secondary barrel switch (well, aside from numerous "Feature" uses as well) I'm a little hesitant to say that we should use it as an indicator since Wacom could use it to mean other things in the future. I'd almost rather just have the barrel switch usage enable both BTN_STYLUS and BTN_STYLUS2 since there are very few devices I can think of which can only report a single side switch. Alternatively, we could try to see if the 0x00 appears where we would expect a 0x5a (since the layout of that first byte doesn't really change) or if the report layout matches that of other known-bad reports.

    I'll see if I can get my hands on an affected tablet, though I think your diagnosis is sound :)

     
  • Tyson Tan

    Tyson Tan - 2016-09-15

    I've encountered the same problem on a cheap 2016 tablet called "Cube i7 Stylus" with the Top Barrel Button of a 2 button stylus (UP-911E-02DD) not working. It shows up in xsetwacom, I can -get and -set its parameter, but it has no action either way. Same pen works fine on Thinkpad X201T and X230T.

    xsetwacom --list devices
    Wacom HID 104 Pen stylus id:13 type: STYLUS
    Wacom HID 104 Pen eraser id:16 type: ERASER

    Anything I can do to assist you, please tell me.

     
  • Masanori SUTO

    Masanori SUTO - 2016-09-16

    Jason, sorry for the late reply. Actually, I have no idea how I should fix this issue. I did my best to make this hack, but I'm no kernel developer. Will you make a patch for me?

    Tyson, will you post HID report descriptor? Here's how to dump it.
    1. cat /proc/bus/input/devices
    2. search for WACOM Pen device and copy "Sysfs". cd to two level up from the /sys/path/to/Sysfs. In my case, 'cd /sys/devices/platform/80860F41:05/i2c-5/i2c-WCOM0007:00/0018:056A:0124.0003'
    3. You see 'report_descriptor' there. Please post this file.
    4. (Optional but preferrable) Build https://github.com/DIGImend/hidrd and run 'hidrd-convert -o code report_descriptor' to parse it's content.
    Besides, do X201W and X230T run linux? If not, please tell us.

     
  • Tyson Tan

    Tyson Tan - 2016-09-17

    Hi Masanori san,

    The following are my report following your instruction:

    cat /proc/bus/input/devices

    I: Bus=0018 Vendor=056a Product=0104 Version=0100
    N: Name="Wacom HID 104 Pen"
    P: Phys=i2c-WCOM4002:01

    S: Sysfs=/devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-7/i2c-WCOM4002:01/0018:056A:0104.0002/input/input12

    U: Uniq=
    H: Handlers=mouse0 event12
    B: PROP=2
    B: EV=b
    B: KEY=c03 0 0 0 0 0
    B: ABS=1000003

    hidrd-convert -o code report_descriptor

    0x05, 0x0D, / Usage Page (Digitizer), /
    0x09, 0x02, / Usage (Pen), /
    0xA1, 0x01, / Collection (Application), /
    0x85, 0x02, / Report ID (2), /
    0x09, 0x20, / Usage (Stylus), /
    0xA1, 0x00, / Collection (Physical), /
    0x09, 0x42, / Usage (Tip Switch), /
    0x09, 0x44, / Usage (Barrel Switch), /
    0x09, 0x45, / Usage (Eraser), /
    0x09, 0x3C, / Usage (Invert), /
    0x09, 0x00, / Usage (00h), /
    0x09, 0x32, / Usage (In Range), /
    0x15, 0x00, / Logical Minimum (0), /
    0x25, 0x01, / Logical Maximum (1), /
    0x75, 0x01, / Report Size (1), /
    0x95, 0x06, / Report Count (6), /
    0x81, 0x02, / Input (Variable), /
    0x95, 0x02, / Report Count (2), /
    0x81, 0x03, / Input (Constant, Variable), /
    0x05, 0x01, / Usage Page (Desktop), /
    0x09, 0x30, / Usage (X), /
    0x26, 0xB0, 0x5B, / Logical Maximum (23472), /
    0x46, 0xB0, 0x5B, / Physical Maximum (23472), /
    0x65, 0x11, / Unit (Centimeter), /
    0x55, 0x0D, / Unit Exponent (13), /
    0x75, 0x10, / Report Size (16), /
    0x95, 0x01, / Report Count (1), /
    0x81, 0x02, / Input (Variable), /
    0x09, 0x31, / Usage (Y), /
    0x26, 0x93, 0x33, / Logical Maximum (13203), /
    0x46, 0x93, 0x33, / Physical Maximum (13203), /
    0x81, 0x02, / Input (Variable), /
    0x45, 0x00, / Physical Maximum (0), /
    0x65, 0x00, / Unit, /
    0x55, 0x00, / Unit Exponent (0), /
    0x05, 0x0D, / Usage Page (Digitizer), /
    0x09, 0x30, / Usage (Tip Pressure), /
    0x26, 0xFF, 0x03, / Logical Maximum (1023), /
    0x81, 0x02, / Input (Variable), /
    0xC0, / End Collection, /
    0x09, 0x00, / Usage (00h), /
    0x75, 0x08, / Report Size (8), /
    0x26, 0xFF, 0x00, / Logical Maximum (255), /
    0xB1, 0x12, / Feature (Variable, Non Linear), /
    0x85, 0x03, / Report ID (3), /
    0x09, 0x00, / Usage (00h), /
    0x95, 0x10, / Report Count (16), /
    0xB1, 0x12, / Feature (Variable, Non Linear), /
    0x85, 0x04, / Report ID (4), /
    0x09, 0x00, / Usage (00h), /
    0xB1, 0x02, / Feature (Variable), /
    0x85, 0x05, / Report ID (5), /
    0x09, 0x00, / Usage (00h), /
    0x95, 0x04, / Report Count (4), /
    0xB1, 0x02, / Feature (Variable), /
    0x85, 0x06, / Report ID (6), /
    0x09, 0x00, / Usage (00h), /
    0x95, 0x24, / Report Count (36), /
    0xB1, 0x02, / Feature (Variable), /
    0x85, 0x07, / Report ID (7), /
    0x09, 0x00, / Usage (00h), /
    0x95, 0x49, / Report Count (73), /
    0xB1, 0x02, / Feature (Variable), /
    0x85, 0x08, / Report ID (8), /
    0x09, 0x00, / Usage (00h), /
    0x95, 0x03, / Report Count (3), /
    0xB1, 0x02, / Feature (Variable), /
    0xC0 / End Collection /

    Thinkpad X201T and X230T works under many Linux distributions since 2012. My 2-buttons pen worked fine on both of them. Ubuntu distros disable Hover Click by default. I have to use the following command to make them normal again:

    xsetwacom --set "Wacom HID 104 Pen stylus" TabletPCButton off

    Other distros like Manjaro handles everything just like Windows with Wacom Feel Driver installed.

    I should also mention that on Ubuntu 14.04 to 16.04, Gnome Control Center >> Wacom Tablet >> Map Buttons does not receive button input from any Wacom tablets (although it detects and shows them). I have to use the following command to make them work:

    gsettings set org.gnome.settings-daemon.plugins.gsdwacom active false
    gsettings set org.gnome.settings-daemon.plugins.gsdwacom active true

    Now you can Map buttons. However it'll stuck and block off all input of the system if you accidentally clicked tablet buttons when it awaits keyboard input to be assigned.

     
  • Masanori SUTO

    Masanori SUTO - 2016-09-17

    Tyson,
    Your detailed report enlightened me. Now I'll post my result.

    $ cat /proc/bus/input/devices
    ...
    I: Bus=0018 Vendor=056a Product=0124 Version=0100
    N: Name="Wacom HID 124 Pen"
    P: Phys=i2c-WCOM0007:00
    S: Sysfs=/devices/platform/80860F41:05/i2c-5/i2c-WCOM0007:00/0018:056A:0124.0005/input/input9
    U: Uniq=
    H: Handlers=event7 mouse1 
    B: PROP=2
    B: EV=b
    B: KEY=c03 0 0 0 0 0
    B: ABS=1000003
    
    $ hidrd-convert -o code /sys/devices/platform/80860F41\:05/i2c-5/i2c-WCOM0007\:00/0018\:056A\:0124.0005/report_descriptor 
    0x05, 0x01,         /*  Usage Page (Desktop),               */
    0x09, 0x02,         /*  Usage (Mouse),                      */
    0xA1, 0x01,         /*  Collection (Application),           */
    0x85, 0x01,         /*      Report ID (1),                  */
    0x09, 0x01,         /*      Usage (Pointer),                */
    0xA1, 0x00,         /*      Collection (Physical),          */
    0x05, 0x09,         /*          Usage Page (Button),        */
    0x19, 0x01,         /*          Usage Minimum (01h),        */
    0x29, 0x02,         /*          Usage Maximum (02h),        */
    0x15, 0x00,         /*          Logical Minimum (0),        */
    0x25, 0x01,         /*          Logical Maximum (1),        */
    0x95, 0x02,         /*          Report Count (2),           */
    0x75, 0x01,         /*          Report Size (1),            */
    0x81, 0x02,         /*          Input (Variable),           */
    0x95, 0x01,         /*          Report Count (1),           */
    0x75, 0x06,         /*          Report Size (6),            */
    0x81, 0x03,         /*          Input (Constant, Variable), */
    0x05, 0x01,         /*          Usage Page (Desktop),       */
    0x09, 0x30,         /*          Usage (X),                  */
    0x09, 0x31,         /*          Usage (Y),                  */
    0x15, 0x81,         /*          Logical Minimum (-127),     */
    0x25, 0x7F,         /*          Logical Maximum (127),      */
    0x75, 0x08,         /*          Report Size (8),            */
    0x95, 0x02,         /*          Report Count (2),           */
    0x81, 0x06,         /*          Input (Variable, Relative), */
    0xC0,               /*      End Collection,                 */
    0xC0,               /*  End Collection,                     */
    0x05, 0x0D,         /*  Usage Page (Digitizer),             */
    0x09, 0x02,         /*  Usage (Pen),                        */
    0xA1, 0x01,         /*  Collection (Application),           */
    0x85, 0x02,         /*      Report ID (2),                  */
    0x09, 0x20,         /*      Usage (Stylus),                 */
    0xA1, 0x00,         /*      Collection (Physical),          */
    0x09, 0x42,         /*          Usage (Tip Switch),         */
    0x09, 0x44,         /*          Usage (Barrel Switch),      */
    0x09, 0x45,         /*          Usage (Eraser),             */
    0x09, 0x3C,         /*          Usage (Invert),             */
    0x09, 0x00,         /*          Usage (00h),                */
    0x09, 0x32,         /*          Usage (In Range),           */
    0x15, 0x00,         /*          Logical Minimum (0),        */
    0x25, 0x01,         /*          Logical Maximum (1),        */
    0x75, 0x01,         /*          Report Size (1),            */
    0x95, 0x06,         /*          Report Count (6),           */
    0x81, 0x02,         /*          Input (Variable),           */
    0x95, 0x02,         /*          Report Count (2),           */
    0x81, 0x03,         /*          Input (Constant, Variable), */
    0x05, 0x01,         /*          Usage Page (Desktop),       */
    0x09, 0x30,         /*          Usage (X),                  */
    0x26, 0x88, 0x55,   /*          Logical Maximum (21896),    */
    0x46, 0x88, 0x55,   /*          Physical Maximum (21896),   */
    0x65, 0x11,         /*          Unit (Centimeter),          */
    0x55, 0x0D,         /*          Unit Exponent (13),         */
    0x75, 0x10,         /*          Report Size (16),           */
    0x95, 0x01,         /*          Report Count (1),           */
    0x81, 0x02,         /*          Input (Variable),           */
    0x09, 0x31,         /*          Usage (Y),                  */
    0x26, 0xC0, 0x35,   /*          Logical Maximum (13760),    */
    0x46, 0xC0, 0x35,   /*          Physical Maximum (13760),   */
    0x81, 0x02,         /*          Input (Variable),           */
    0x45, 0x00,         /*          Physical Maximum (0),       */
    0x65, 0x00,         /*          Unit,                       */
    0x55, 0x00,         /*          Unit Exponent (0),          */
    0x05, 0x0D,         /*          Usage Page (Digitizer),     */
    0x09, 0x30,         /*          Usage (Tip Pressure),       */
    0x26, 0xFF, 0x03,   /*          Logical Maximum (1023),     */
    0x81, 0x02,         /*          Input (Variable),           */
    0xC0,               /*      End Collection,                 */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x75, 0x08,         /*      Report Size (8),                */
    0x26, 0xFF, 0x00,   /*      Logical Maximum (255),          */
    0xB1, 0x12,         /*      Feature (Variable, Non Linear), */
    0x85, 0x03,         /*      Report ID (3),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x10,         /*      Report Count (16),              */
    0xB1, 0x12,         /*      Feature (Variable, Non Linear), */
    0x85, 0x04,         /*      Report ID (4),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0xB1, 0x02,         /*      Feature (Variable),             */
    0x85, 0x05,         /*      Report ID (5),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x04,         /*      Report Count (4),               */
    0xB1, 0x02,         /*      Feature (Variable),             */
    0x85, 0x06,         /*      Report ID (6),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x24,         /*      Report Count (36),              */
    0xB1, 0x02,         /*      Feature (Variable),             */
    0xC0,               /*  End Collection,                     */
    0x06, 0x00, 0xFF,   /*  Usage Page (FF00h),                 */
    0x09, 0x00,         /*  Usage (00h),                        */
    0xA1, 0x01,         /*  Collection (Application),           */
    0x85, 0x09,         /*      Report ID (9),                  */
    0x05, 0x0D,         /*      Usage Page (Digitizer),         */
    0x09, 0x20,         /*      Usage (Stylus),                 */
    0xA1, 0x00,         /*      Collection (Physical),          */
    0x09, 0x00,         /*          Usage (00h),                */
    0x26, 0xFF, 0x00,   /*          Logical Maximum (255),      */
    0x75, 0x08,         /*          Report Size (8),            */
    0x95, 0x07,         /*          Report Count (7),           */
    0x81, 0x02,         /*          Input (Variable),           */
    0xC0,               /*      End Collection,                 */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x03,         /*      Report Count (3),               */
    0xB1, 0x12,         /*      Feature (Variable, Non Linear), */
    0xC0,               /*  End Collection,                     */
    0x06, 0x00, 0xFF,   /*  Usage Page (FF00h),                 */
    0x09, 0x02,         /*  Usage (02h),                        */
    0xA1, 0x01,         /*  Collection (Application),           */
    0x85, 0x07,         /*      Report ID (7),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x49,         /*      Report Count (73),              */
    0xB1, 0x02,         /*      Feature (Variable),             */
    0x85, 0x08,         /*      Report ID (8),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x03,         /*      Report Count (3),               */
    0x81, 0x02,         /*      Input (Variable),               */
    0x09, 0x00,         /*      Usage (00h),                    */
    0xB1, 0x02,         /*      Feature (Variable),             */
    0xC0                /*  End Collection                      */
    

    Also, I'll attach evtest result to show what is happening.

    $ evtest /dev/input/event7
    Input driver version is 1.0.1
    Input device ID: bus 0x18 vendor 0x56a product 0x124 version 0x100
    Input device name: "Wacom HID 124 Pen"
    Supported events:
      Event type 0 (EV_SYN)
      Event type 1 (EV_KEY)
        Event code 320 (BTN_TOOL_PEN)
        Event code 321 (BTN_TOOL_RUBBER)
        Event code 330 (BTN_TOUCH)
        Event code 331 (BTN_STYLUS)
      Event type 3 (EV_ABS)
        Event code 0 (ABS_X)
          Value   9761
          Min        0
          Max    21896
          Fuzz       4
          Resolution     100
        Event code 1 (ABS_Y)
          Value   9893
          Min        0
          Max    13760
          Fuzz       4
          Resolution     100
        Event code 24 (ABS_PRESSURE)
          Value      0
          Min        0
          Max     1023
    Properties:
      Property type 1 (INPUT_PROP_DIRECT)
    Testing ... (interrupt to exit)
    

    Well, my guess is only "Pen"s on i2c bus are affected by this issue. By the word "Pen" I mean device on the computer side.

    Tyson, will you post above 3 result on X201T and evtest on Cube i7 to make things crystal clear? If my guess is right, evtest result on X201T contains BTN_STYLUS2 although that on Cube i7 doesn't.

     
  • Tyson Tan

    Tyson Tan - 2016-09-18

    Hi Masanori,

    I tried to follow your instructions on all X201T, X230T and Cubei7. Everything went well except I couldn't obtain X201T's report_descriptor file. It seems X201T's Wacom device has completely different /sys/devices/... folder structure. I will attach its folders as a zip, maybe you can find something useful out of it.

    I will also attach the each device's full evtest log and original report_descriptor files (if available) , pretty much everything I collected is inside that zip file. Hope it helps!

    X201T cat /proc/bus/input/devices:

    I: Bus=0013 Vendor=056a Product=0090 Version=0100
    N: Name="Wacom Serial Penabled Pen"
    P: Phys=ttyS4/serio0/input0
    S: Sysfs=/devices/pnp0/00:05/tty/ttyS4/serio3/input/input14
    U: Uniq=
    H: Handlers=mouse2 event13 
    B: PROP=2
    B: EV=b
    B: KEY=1c03 0 0 0 0 0
    B: ABS=1000003
    

    X230T cat /proc/bus/input/devices:

    $ cat /proc/bus/input/devices
    ...
    I: Bus=0003 Vendor=056a Product=00e6 Version=0111
    N: Name="Wacom ISDv4 E6 Pen"
    P: Phys=usb-0000:00:1d.0-1.5/input0
    S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.0/0003:056A:00E6.0001/input/input7
    U: Uniq=
    H: Handlers=mouse0 event5 
    B: PROP=2
    B: EV=b
    B: KEY=1c03 0 0 0 0 0
    B: ABS=1000003
    
    I: Bus=0003 Vendor=056a Product=00e6 Version=0111
    N: Name="Wacom ISDv4 E6 Finger"
    P: Phys=usb-0000:00:1d.0-1.5/input1
    S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.1/0003:056A:00E6.0002/input/input11
    U: Uniq=
    H: Handlers=mouse1 event6 
    B: PROP=2
    B: EV=b
    B: KEY=400 0 0 0 0 0
    B: ABS=260800000000003
    

    Cube i7 Stylus cat /proc/bus/input/devices:

    $ cat /proc/bus/input/devices
    ...
    I: Bus=0018 Vendor=056a Product=0104 Version=0100
    N: Name="Wacom HID 104 Pen"
    P: Phys=i2c-WCOM4002:01
    S: Sysfs=/devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-7/i2c-WCOM4002:01/0018:056A:0104.0002/input/input12
    U: Uniq=
    H: Handlers=mouse0 event12 
    B: PROP=2
    B: EV=b
    B: KEY=c03 0 0 0 0 0
    B: ABS=1000003
    

    X201T hidrd-convert -o code report_descriptor

    NOT FOUND
    

    X230T hidrd-convert -o code report_descriptor

    $ hidrd-convert -o code report_descriptor
    ...
    0x05, 0x0D,         /*  Usage Page (Digitizer),             */
    0x09, 0x02,         /*  Usage (Pen),                        */
    0xA1, 0x01,         /*  Collection (Application),           */
    0x85, 0x02,         /*      Report ID (2),                  */
    0x09, 0x20,         /*      Usage (Stylus),                 */
    0xA1, 0x00,         /*      Collection (Physical),          */
    0x09, 0x42,         /*          Usage (Tip Switch),         */
    0x09, 0x44,         /*          Usage (Barrel Switch),      */
    0x09, 0x45,         /*          Usage (Eraser),             */
    0x09, 0x3C,         /*          Usage (Invert),             */
    0x09, 0x00,         /*          Usage (00h),                */
    0x09, 0x32,         /*          Usage (In Range),           */
    0x15, 0x00,         /*          Logical Minimum (0),        */
    0x25, 0x01,         /*          Logical Maximum (1),        */
    0x75, 0x01,         /*          Report Size (1),            */
    0x95, 0x06,         /*          Report Count (6),           */
    0x81, 0x02,         /*          Input (Variable),           */
    0x95, 0x02,         /*          Report Count (2),           */
    0x81, 0x03,         /*          Input (Constant, Variable), */
    0x05, 0x01,         /*          Usage Page (Desktop),       */
    0x09, 0x30,         /*          Usage (X),                  */
    0x26, 0x70, 0x6C,   /*          Logical Maximum (27760),    */
    0x46, 0x70, 0x6C,   /*          Physical Maximum (27760),   */
    0x65, 0x11,         /*          Unit (Centimeter),          */
    0x55, 0x0D,         /*          Unit Exponent (13),         */
    0x75, 0x10,         /*          Report Size (16),           */
    0x95, 0x01,         /*          Report Count (1),           */
    0x81, 0x02,         /*          Input (Variable),           */
    0x09, 0x31,         /*          Usage (Y),                  */
    0x26, 0x4E, 0x3D,   /*          Logical Maximum (15694),    */
    0x46, 0x4E, 0x3D,   /*          Physical Maximum (15694),   */
    0x81, 0x02,         /*          Input (Variable),           */
    0x45, 0x00,         /*          Physical Maximum (0),       */
    0x65, 0x00,         /*          Unit,                       */
    0x55, 0x00,         /*          Unit Exponent (0),          */
    0x05, 0x0D,         /*          Usage Page (Digitizer),     */
    0x09, 0x30,         /*          Usage (Tip Pressure),       */
    0x26, 0xFF, 0x00,   /*          Logical Maximum (255),      */
    0x81, 0x02,         /*          Input (Variable),           */
    0xC0,               /*      End Collection,                 */
    0xC0,               /*  End Collection,                     */
    0x06, 0x00, 0xFF,   /*  Usage Page (FF00h),                 */
    0x09, 0x00,         /*  Usage (00h),                        */
    0xA1, 0x01,         /*  Collection (Application),           */
    0x85, 0x11,         /*      Report ID (17),                 */
    0x05, 0x0D,         /*      Usage Page (Digitizer),         */
    0x09, 0x20,         /*      Usage (Stylus),                 */
    0xA1, 0x00,         /*      Collection (Physical),          */
    0x09, 0x42,         /*          Usage (Tip Switch),         */
    0x09, 0x44,         /*          Usage (Barrel Switch),      */
    0x09, 0x45,         /*          Usage (Eraser),             */
    0x09, 0x3C,         /*          Usage (Invert),             */
    0x09, 0x00,         /*          Usage (00h),                */
    0x09, 0x32,         /*          Usage (In Range),           */
    0x15, 0x00,         /*          Logical Minimum (0),        */
    0x25, 0x01,         /*          Logical Maximum (1),        */
    0x75, 0x01,         /*          Report Size (1),            */
    0x95, 0x06,         /*          Report Count (6),           */
    0x81, 0x02,         /*          Input (Variable),           */
    0x95, 0x02,         /*          Report Count (2),           */
    0x81, 0x03,         /*          Input (Constant, Variable), */
    0x05, 0x01,         /*          Usage Page (Desktop),       */
    0x09, 0x30,         /*          Usage (X),                  */
    0x26, 0x70, 0x6C,   /*          Logical Maximum (27760),    */
    0x46, 0x70, 0x6C,   /*          Physical Maximum (27760),   */
    0x65, 0x11,         /*          Unit (Centimeter),          */
    0x55, 0x0D,         /*          Unit Exponent (13),         */
    0x75, 0x10,         /*          Report Size (16),           */
    0x95, 0x01,         /*          Report Count (1),           */
    0x81, 0x02,         /*          Input (Variable),           */
    0x09, 0x31,         /*          Usage (Y),                  */
    0x26, 0x4E, 0x3D,   /*          Logical Maximum (15694),    */
    0x46, 0x4E, 0x3D,   /*          Physical Maximum (15694),   */
    0x81, 0x02,         /*          Input (Variable),           */
    0x45, 0x00,         /*          Physical Maximum (0),       */
    0x65, 0x00,         /*          Unit,                       */
    0x55, 0x00,         /*          Unit Exponent (0),          */
    0x05, 0x0D,         /*          Usage Page (Digitizer),     */
    0x09, 0x30,         /*          Usage (Tip Pressure),       */
    0x26, 0xFF, 0x00,   /*          Logical Maximum (255),      */
    0x81, 0x02,         /*          Input (Variable),           */
    0xC0,               /*      End Collection,                 */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x75, 0x08,         /*      Report Size (8),                */
    0x95, 0x03,         /*      Report Count (3),               */
    0xB1, 0x12,         /*      Feature (Variable, Non Linear), */
    0xC0                /*  End Collection                      */
    

    Cube i7 Stylus hidrd-convert -o code report_descriptor

    $ hidrd-convert -o code report_descriptor
    ...
    0x05, 0x0D,         /*  Usage Page (Digitizer),             */
    0x09, 0x02,         /*  Usage (Pen),                        */
    0xA1, 0x01,         /*  Collection (Application),           */
    0x85, 0x02,         /*      Report ID (2),                  */
    0x09, 0x20,         /*      Usage (Stylus),                 */
    0xA1, 0x00,         /*      Collection (Physical),          */
    0x09, 0x42,         /*          Usage (Tip Switch),         */
    0x09, 0x44,         /*          Usage (Barrel Switch),      */
    0x09, 0x45,         /*          Usage (Eraser),             */
    0x09, 0x3C,         /*          Usage (Invert),             */
    0x09, 0x00,         /*          Usage (00h),                */
    0x09, 0x32,         /*          Usage (In Range),           */
    0x15, 0x00,         /*          Logical Minimum (0),        */
    0x25, 0x01,         /*          Logical Maximum (1),        */
    0x75, 0x01,         /*          Report Size (1),            */
    0x95, 0x06,         /*          Report Count (6),           */
    0x81, 0x02,         /*          Input (Variable),           */
    0x95, 0x02,         /*          Report Count (2),           */
    0x81, 0x03,         /*          Input (Constant, Variable), */
    0x05, 0x01,         /*          Usage Page (Desktop),       */
    0x09, 0x30,         /*          Usage (X),                  */
    0x26, 0xB0, 0x5B,   /*          Logical Maximum (23472),    */
    0x46, 0xB0, 0x5B,   /*          Physical Maximum (23472),   */
    0x65, 0x11,         /*          Unit (Centimeter),          */
    0x55, 0x0D,         /*          Unit Exponent (13),         */
    0x75, 0x10,         /*          Report Size (16),           */
    0x95, 0x01,         /*          Report Count (1),           */
    0x81, 0x02,         /*          Input (Variable),           */
    0x09, 0x31,         /*          Usage (Y),                  */
    0x26, 0x93, 0x33,   /*          Logical Maximum (13203),    */
    0x46, 0x93, 0x33,   /*          Physical Maximum (13203),   */
    0x81, 0x02,         /*          Input (Variable),           */
    0x45, 0x00,         /*          Physical Maximum (0),       */
    0x65, 0x00,         /*          Unit,                       */
    0x55, 0x00,         /*          Unit Exponent (0),          */
    0x05, 0x0D,         /*          Usage Page (Digitizer),     */
    0x09, 0x30,         /*          Usage (Tip Pressure),       */
    0x26, 0xFF, 0x03,   /*          Logical Maximum (1023),     */
    0x81, 0x02,         /*          Input (Variable),           */
    0xC0,               /*      End Collection,                 */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x75, 0x08,         /*      Report Size (8),                */
    0x26, 0xFF, 0x00,   /*      Logical Maximum (255),          */
    0xB1, 0x12,         /*      Feature (Variable, Non Linear), */
    0x85, 0x03,         /*      Report ID (3),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x10,         /*      Report Count (16),              */
    0xB1, 0x12,         /*      Feature (Variable, Non Linear), */
    0x85, 0x04,         /*      Report ID (4),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0xB1, 0x02,         /*      Feature (Variable),             */
    0x85, 0x05,         /*      Report ID (5),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x04,         /*      Report Count (4),               */
    0xB1, 0x02,         /*      Feature (Variable),             */
    0x85, 0x06,         /*      Report ID (6),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x24,         /*      Report Count (36),              */
    0xB1, 0x02,         /*      Feature (Variable),             */
    0x85, 0x07,         /*      Report ID (7),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x49,         /*      Report Count (73),              */
    0xB1, 0x02,         /*      Feature (Variable),             */
    0x85, 0x08,         /*      Report ID (8),                  */
    0x09, 0x00,         /*      Usage (00h),                    */
    0x95, 0x03,         /*      Report Count (3),               */
    0xB1, 0x02,         /*      Feature (Variable),             */
    0xC0                /*  End Collection                      */
    

    X201T evtest:

    $ evtest /dev/input/event13
    ...
    Input driver version is 1.0.1
    Input device ID: bus 0x13 vendor 0x56a product 0x90 version 0x100
    Input device name: "Wacom Serial Penabled Pen"
    Supported events:
      Event type 0 (EV_SYN)
      Event type 1 (EV_KEY)
        Event code 320 (BTN_TOOL_PEN)
        Event code 321 (BTN_TOOL_RUBBER)
        Event code 330 (BTN_TOUCH)
        Event code 331 (BTN_STYLUS)
        Event code 332 (BTN_STYLUS2)
      Event type 3 (EV_ABS)
        Event code 0 (ABS_X)
          Value   8362
          Min        0
          Max    26312
          Resolution     100
        Event code 1 (ABS_Y)
          Value   3727
          Min        0
          Max    16520
          Resolution     100
        Event code 24 (ABS_PRESSURE)
          Value      0
          Min        0
          Max      255
    Properties:
      Property type 1 (INPUT_PROP_DIRECT)
    

    X230T evtest:

    $ evtest /dev/input/event5
    ...
    Input driver version is 1.0.1
    Input device ID: bus 0x3 vendor 0x56a product 0xe6 version 0x111
    Input device name: "Wacom ISDv4 E6 Pen"
    Supported events:
      Event type 0 (EV_SYN)
      Event type 1 (EV_KEY)
        Event code 320 (BTN_TOOL_PEN)
        Event code 321 (BTN_TOOL_RUBBER)
        Event code 330 (BTN_TOUCH)
        Event code 331 (BTN_STYLUS)
        Event code 332 (BTN_STYLUS2)
      Event type 3 (EV_ABS)
        Event code 0 (ABS_X)
          Value   1687
          Min        0
          Max    27760
          Fuzz       4
          Resolution     100
        Event code 1 (ABS_Y)
          Value    746
          Min        0
          Max    15694
          Fuzz       4
          Resolution     100
        Event code 24 (ABS_PRESSURE)
          Value      0
          Min        0
          Max      255
    Properties:
      Property type 1 (INPUT_PROP_DIRECT)
    

    Cube i7 Stylus evtest:

    $ evtest /dev/input/event13
    ...
    Input driver version is 1.0.1
    Input device ID: bus 0x18 vendor 0x56a product 0x104 version 0x100
    Input device name: "Wacom HID 104 Pen"
    Supported events:
      Event type 0 (EV_SYN)
      Event type 1 (EV_KEY)
        Event code 320 (BTN_TOOL_PEN)
        Event code 321 (BTN_TOOL_RUBBER)
        Event code 330 (BTN_TOUCH)
        Event code 331 (BTN_STYLUS)
      Event type 3 (EV_ABS)
        Event code 0 (ABS_X)
          Value  11623
          Min        0
          Max    23472
          Fuzz       4
          Resolution     100
        Event code 1 (ABS_Y)
          Value   1972
          Min        0
          Max    13203
          Fuzz       4
          Resolution     100
        Event code 24 (ABS_PRESSURE)
          Value      0
          Min        0
          Max     1023
    Properties:
      Property type 1 (INPUT_PROP_DIRECT)
    
     
    • Jason Gerecke

      Jason Gerecke - 2016-09-19

      Tyson Tan, Do any of those devices use a Wacom sensor for the touch device? If so, I'd appreciate if you could provide information on those as well, especially the report_descriptor file. The X201T, X230, and Cube i7 are all missing from the wacom-hid-descriptors repository which I use to figure out if kernel changes we make are compatible with existing tablets.

       
      • Tyson Tan

        Tyson Tan - 2016-09-20

        Hi Jason,
        Only X230T has Wacom touch device. Cube i7 Stylus uses Fujitsu touchscreen. I will post everything I've found about X230T here. I hope they helps.

        cat

        I: Bus=0003 Vendor=056a Product=00e6 Version=0111
        N: Name="Wacom ISDv4 E6 Finger"
        P: Phys=usb-0000:00:1d.0-1.5/input1
        S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.1/0003:056A:00E6.0002/input/input11
        U: Uniq=
        H: Handlers=mouse1 event6 
        B: PROP=2
        B: EV=b
        B: KEY=400 0 0 0 0 0
        B: ABS=260800000000003
        

        report_descriptor

        $ hidrd-convert -o code report_descriptor
        0x05, 0x0D,         /*  Usage Page (Digitizer),             */
        0x09, 0x04,         /*  Usage (Touchscreen),                */
        0xA1, 0x01,         /*  Collection (Application),           */
        0x85, 0x0C,         /*      Report ID (12),                 */
        0x09, 0x22,         /*      Usage (Finger),                 */
        0xA1, 0x00,         /*      Collection (Physical),          */
        0x09, 0x42,         /*          Usage (Tip Switch),         */
        0x15, 0x00,         /*          Logical Minimum (0),        */
        0x25, 0x01,         /*          Logical Maximum (1),        */
        0x75, 0x01,         /*          Report Size (1),            */
        0x95, 0x01,         /*          Report Count (1),           */
        0x81, 0x02,         /*          Input (Variable),           */
        0x09, 0x32,         /*          Usage (In Range),           */
        0x81, 0x02,         /*          Input (Variable),           */
        0x09, 0x47,         /*          Usage (47h),                */
        0x81, 0x02,         /*          Input (Variable),           */
        0x95, 0x05,         /*          Report Count (5),           */
        0x81, 0x03,         /*          Input (Constant, Variable), */
        0x05, 0x01,         /*          Usage Page (Desktop),       */
        0x09, 0x30,         /*          Usage (X),                  */
        0x26, 0xD8, 0x0A,   /*          Logical Maximum (2776),     */
        0x46, 0x70, 0x6C,   /*          Physical Maximum (27760),   */
        0x65, 0x11,         /*          Unit (Centimeter),          */
        0x55, 0x0D,         /*          Unit Exponent (13),         */
        0x75, 0x10,         /*          Report Size (16),           */
        0x95, 0x01,         /*          Report Count (1),           */
        0x81, 0x02,         /*          Input (Variable),           */
        0x09, 0x31,         /*          Usage (Y),                  */
        0x26, 0x21, 0x06,   /*          Logical Maximum (1569),     */
        0x46, 0x4E, 0x3D,   /*          Physical Maximum (15694),   */
        0x81, 0x02,         /*          Input (Variable),           */
        0x45, 0x00,         /*          Physical Maximum (0),       */
        0x65, 0x00,         /*          Unit,                       */
        0x55, 0x00,         /*          Unit Exponent (0),          */
        0x05, 0x0D,         /*          Usage Page (Digitizer),     */
        0x09, 0x48,         /*          Usage (48h),                */
        0x75, 0x08,         /*          Report Size (8),            */
        0x25, 0x7F,         /*          Logical Maximum (127),      */
        0x81, 0x02,         /*          Input (Variable),           */
        0x09, 0x49,         /*          Usage (49h),                */
        0x81, 0x02,         /*          Input (Variable),           */
        0x09, 0x51,         /*          Usage (51h),                */
        0x81, 0x02,         /*          Input (Variable),           */
        0x09, 0x55,         /*          Usage (55h),                */
        0xB1, 0x02,         /*          Feature (Variable),         */
        0xC0,               /*      End Collection,                 */
        0xC0,               /*  End Collection,                     */
        0x06, 0x00, 0xFF,   /*  Usage Page (FF00h),                 */
        0x09, 0x01,         /*  Usage (01h),                        */
        0xA1, 0x01,         /*  Collection (Application),           */
        0x85, 0x0D,         /*      Report ID (13),                 */
        0x05, 0x0D,         /*      Usage Page (Digitizer),         */
        0x09, 0x22,         /*      Usage (Finger),                 */
        0xA1, 0x00,         /*      Collection (Physical),          */
        0x09, 0x42,         /*          Usage (Tip Switch),         */
        0x15, 0x00,         /*          Logical Minimum (0),        */
        0x25, 0x01,         /*          Logical Maximum (1),        */
        0x75, 0x01,         /*          Report Size (1),            */
        0x95, 0x04,         /*          Report Count (4),           */
        0x81, 0x02,         /*          Input (Variable),           */
        0x95, 0x04,         /*          Report Count (4),           */
        0x81, 0x03,         /*          Input (Constant, Variable), */
        0x05, 0x01,         /*          Usage Page (Desktop),       */
        0x09, 0x30,         /*          Usage (X),                  */
        0x26, 0xD8, 0x0A,   /*          Logical Maximum (2776),     */
        0x46, 0x70, 0x6C,   /*          Physical Maximum (27760),   */
        0x65, 0x11,         /*          Unit (Centimeter),          */
        0x55, 0x0D,         /*          Unit Exponent (13),         */
        0x75, 0x10,         /*          Report Size (16),           */
        0x95, 0x02,         /*          Report Count (2),           */
        0x81, 0x02,         /*          Input (Variable),           */
        0x09, 0x31,         /*          Usage (Y),                  */
        0x26, 0x21, 0x06,   /*          Logical Maximum (1569),     */
        0x46, 0x4E, 0x3D,   /*          Physical Maximum (15694),   */
        0x81, 0x02,         /*          Input (Variable),           */
        0x45, 0x00,         /*          Physical Maximum (0),       */
        0x65, 0x00,         /*          Unit,                       */
        0x55, 0x00,         /*          Unit Exponent (0),          */
        0x05, 0x0D,         /*          Usage Page (Digitizer),     */
        0x09, 0x48,         /*          Usage (48h),                */
        0x75, 0x08,         /*          Report Size (8),            */
        0x25, 0x7F,         /*          Logical Maximum (127),      */
        0x81, 0x02,         /*          Input (Variable),           */
        0x09, 0x49,         /*          Usage (49h),                */
        0x81, 0x02,         /*          Input (Variable),           */
        0xC0,               /*      End Collection,                 */
        0x85, 0x02,         /*      Report ID (2),                  */
        0x09, 0x00,         /*      Usage (00h),                    */
        0x26, 0xFF, 0x00,   /*      Logical Maximum (255),          */
        0x95, 0x01,         /*      Report Count (1),               */
        0xB1, 0x02,         /*      Feature (Variable),             */
        0x85, 0x03,         /*      Report ID (3),                  */
        0x09, 0x00,         /*      Usage (00h),                    */
        0x95, 0x03,         /*      Report Count (3),               */
        0xB1, 0x02,         /*      Feature (Variable),             */
        0x85, 0x05,         /*      Report ID (5),                  */
        0x09, 0x00,         /*      Usage (00h),                    */
        0x95, 0x08,         /*      Report Count (8),               */
        0xB1, 0x02,         /*      Feature (Variable),             */
        0x85, 0x06,         /*      Report ID (6),                  */
        0x09, 0x00,         /*      Usage (00h),                    */
        0x95, 0x08,         /*      Report Count (8),               */
        0xB1, 0x02,         /*      Feature (Variable),             */
        0xC0,               /*  End Collection,                     */
        0x05, 0x0D,         /*  Usage Page (Digitizer),             */
        0x09, 0x0E,         /*  Usage (0Eh),                        */
        0xA1, 0x01,         /*  Collection (Application),           */
        0x85, 0x0E,         /*      Report ID (14),                 */
        0x09, 0x52,         /*      Usage (52h),                    */
        0x09, 0x53,         /*      Usage (53h),                    */
        0x15, 0x00,         /*      Logical Minimum (0),            */
        0x26, 0xFF, 0x00,   /*      Logical Maximum (255),          */
        0x75, 0x08,         /*      Report Size (8),                */
        0x95, 0x02,         /*      Report Count (2),               */
        0xB1, 0x02,         /*      Feature (Variable),             */
        0xC0,               /*  End Collection,                     */
        0x05, 0x01,         /*  Usage Page (Desktop),               */
        0x09, 0x02,         /*  Usage (Mouse),                      */
        0xA1, 0x01,         /*  Collection (Application),           */
        0x85, 0x0F,         /*      Report ID (15),                 */
        0x09, 0x01,         /*      Usage (Pointer),                */
        0xA1, 0x00,         /*      Collection (Physical),          */
        0x05, 0x09,         /*          Usage Page (Button),        */
        0x19, 0x01,         /*          Usage Minimum (01h),        */
        0x29, 0x02,         /*          Usage Maximum (02h),        */
        0x15, 0x00,         /*          Logical Minimum (0),        */
        0x25, 0x01,         /*          Logical Maximum (1),        */
        0x95, 0x02,         /*          Report Count (2),           */
        0x75, 0x01,         /*          Report Size (1),            */
        0x81, 0x02,         /*          Input (Variable),           */
        0x95, 0x01,         /*          Report Count (1),           */
        0x75, 0x06,         /*          Report Size (6),            */
        0x81, 0x03,         /*          Input (Constant, Variable), */
        0x05, 0x01,         /*          Usage Page (Desktop),       */
        0x09, 0x30,         /*          Usage (X),                  */
        0x09, 0x31,         /*          Usage (Y),                  */
        0x26, 0xFF, 0x7F,   /*          Logical Maximum (32767),    */
        0x75, 0x10,         /*          Report Size (16),           */
        0x95, 0x02,         /*          Report Count (2),           */
        0x81, 0x02,         /*          Input (Variable),           */
        0xC0,               /*      End Collection,                 */
        0xC0,               /*  End Collection,                     */
        0x05, 0x0D,         /*  Usage Page (Digitizer),             */
        0x09, 0x04,         /*  Usage (Touchscreen),                */
        0xA1, 0x01,         /*  Collection (Application),           */
        0x85, 0x10,         /*      Report ID (16),                 */
        0x09, 0x22,         /*      Usage (Finger),                 */
        0xA1, 0x00,         /*      Collection (Physical),          */
        0x09, 0x42,         /*          Usage (Tip Switch),         */
        0x09, 0x32,         /*          Usage (In Range),           */
        0x15, 0x00,         /*          Logical Minimum (0),        */
        0x25, 0x01,         /*          Logical Maximum (1),        */
        0x75, 0x01,         /*          Report Size (1),            */
        0x95, 0x02,         /*          Report Count (2),           */
        0x81, 0x02,         /*          Input (Variable),           */
        0x95, 0x06,         /*          Report Count (6),           */
        0x81, 0x03,         /*          Input (Constant, Variable), */
        0x05, 0x01,         /*          Usage Page (Desktop),       */
        0x09, 0x30,         /*          Usage (X),                  */
        0x26, 0xD8, 0x0A,   /*          Logical Maximum (2776),     */
        0x46, 0x70, 0x6C,   /*          Physical Maximum (27760),   */
        0x65, 0x11,         /*          Unit (Centimeter),          */
        0x55, 0x0D,         /*          Unit Exponent (13),         */
        0x75, 0x10,         /*          Report Size (16),           */
        0x95, 0x01,         /*          Report Count (1),           */
        0x81, 0x02,         /*          Input (Variable),           */
        0x09, 0x31,         /*          Usage (Y),                  */
        0x26, 0x21, 0x06,   /*          Logical Maximum (1569),     */
        0x46, 0x4E, 0x3D,   /*          Physical Maximum (15694),   */
        0x81, 0x02,         /*          Input (Variable),           */
        0x45, 0x00,         /*          Physical Maximum (0),       */
        0x65, 0x00,         /*          Unit,                       */
        0x55, 0x00,         /*          Unit Exponent (0),          */
        0xC0,               /*      End Collection,                 */
        0xC0                /*  End Collection                      */
        

        evtest

        $ evtest /dev/input/event6
        ...
        Input driver version is 1.0.1
        Input device ID: bus 0x3 vendor 0x56a product 0xe6 version 0x111
        Input device name: "Wacom ISDv4 E6 Finger"
        Supported events:
          Event type 0 (EV_SYN)
          Event type 1 (EV_KEY)
            Event code 330 (BTN_TOUCH)
          Event type 3 (EV_ABS)
            Event code 0 (ABS_X)
              Value   1843
              Min        0
              Max     2776
              Resolution      10
            Event code 1 (ABS_Y)
              Value    597
              Min        0
              Max     1569
              Resolution      10
            Event code 47 (ABS_MT_SLOT)
              Value      0
              Min        0
              Max        1
            Event code 53 (ABS_MT_POSITION_X)
              Value      0
              Min        0
              Max     2776
              Fuzz       4
              Resolution      10
            Event code 54 (ABS_MT_POSITION_Y)
              Value      0
              Min        0
              Max     1569
              Fuzz       4
              Resolution      10
            Event code 57 (ABS_MT_TRACKING_ID)
              Value      0
              Min        0
              Max    65535
        Properties:
          Property type 1 (INPUT_PROP_DIRECT)
        
         
  • Jason Gerecke

    Jason Gerecke - 2016-09-19

    Thanks for the reminder about this bug. I've attached a patch that I think might do the trick, but I don't have any way to test it. If either of you could try checking out the "master" branch of input-wacom and applying/compiling/installing I'd love to know if it works.

    Alternatively, you could use the hid-recorder tool to capture the raw hardware events that are sent by your tablet, which I can then replay these and see if they actually enable the BTN_STYLU2 event properly. Just run hid-recorder > /tmp/log and choose your pen input device (if it isn't obvious which to choose, just run it once for each device, saving the results to e.g. /tmp/log.0, /tmp/log.1, etc.). Once its running, bring the pen into prox, press the lower switch, then the upper switch, and then remove the pen from prox. Finally, press CTRL+C to quit recording and attach the result for me to review.

     
  • Masanori SUTO

    Masanori SUTO - 2016-09-20

    Tyson Tan, thank you for your info! It's great to know this is not just for me.   But I'm afraid I can't do anything about this.

    Hi, Jason
    Thank you for writing a patch for me. But unfortunately your patch doesn't work. I added some code to yours to see what's wrong.

            if (features->type == HID_GENERIC &&
                usage->hid == 0x000D0000 &&
                field->application == HID_DG_PEN &&
                field->physical == HID_DG_STYLUS) {
                    hid_info(wacom->hdev, "got inside\n");
                    struct hid_report *r = field->report;
                    int i = field->index;
                    hid_info(wacom->hdev, "%d\n", i);
    
                    if (i-4 >= 0 && i+1 < HID_MAX_FIELDS) {
                        hid_info(wacom->hdev, "passed index range check\n");
                        if (r->field[i-4]->usage->hid == HID_DG_TIPSWITCH &&
                            r->field[i-3]->usage->hid == HID_DG_BARRELSWITCH &&
                            r->field[i-2]->usage->hid == HID_DG_ERASER &&
                            r->field[i-1]->usage->hid == HID_DG_INVERT &&
                            r->field[i+1]->usage->hid == HID_DG_INRANGE) {
                                hid_info(wacom->hdev, "got deep inside\n");
    
                                usage->hid = HID_DG_BARRELSWITCH2;
                        }
                    }
            }
    

    And this outputs following dmesg.

    $ dmesg|tail
    
    [   29.033320] intel_sst_acpi 80860F28:00: Free for str 3 pipe 0xe
    [   29.048892] sst-mfld-platform sst-mfld-platform: Enter: enable=0 port_name=ssp2-port
    [   29.049937] intel_sst_acpi 80860F28:00: Free for str 1 pipe 0x90
    [   29.368230] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
    [  115.031302] input: Wacom HID 5008 Finger as /devices/platform/80860F41:05/i2c-5/i2c-WCOM5008:00/0018:056A:5008.0004/input/input14
    [  115.032506] wacom 0018:056A:5008.0004: hidraw2: I2C HID v1.00 Device [WCOM5008:00 056A:5008] on i2c-WCOM5008:00
    [  115.034494] wacom 0018:056A:0124.0005: got inside
    [  115.034503] wacom 0018:056A:0124.0005: 0
    [  115.034706] input: Wacom HID 124 Pen as /devices/platform/80860F41:05/i2c-5/i2c-WCOM0007:00/0018:056A:0124.0005/input/input16
    [  115.035376] wacom 0018:056A:0124.0005: hidraw3: I2C HID v1.00 Mouse [WCOM0007:00 056A:0124] on i2c-WCOM0007:00
    

    Hope this helps.

     

    Last edit: Masanori SUTO 2016-09-20
  • Masanori SUTO

    Masanori SUTO - 2016-09-20

    Here's report_descriptors of QH55/M.
    This tablet has touch input as well, so I think this helps development too.

     

    Last edit: Masanori SUTO 2016-09-20
  • Jason Gerecke

    Jason Gerecke - 2016-09-20

    Thanks for testing the patch out. I have an updated version for you to try which will hopefully do the trick.

     
    • Tyson Tan

      Tyson Tan - 2016-09-21

      Hi Jason,
      I used your patch on Ubuntu's Linux source package, version 4.4.0-38-generic_4.4.0-38.57. It worked! Thank you very much! :D

      Now, are there any more tests I should run at this point? Or do we call it a day?

      Also, when do we expect to see this patch land on Long Term Support Linux kernels, where non-tech users enjoy the benefit? The problem resides within kernel, too bad we can't just simply upgrade libwacom or xf86-input-wacom to do the trick.

      Or is there a way to push this patch to Debian or Ubuntu, so athey can patch it before the official kernel catch up?

       
  • Masanori SUTO

    Masanori SUTO - 2016-09-21

    This patch works perfectly! The "Wacom HID 124 Pen" device reports BTN_STYLUS2 and it actually works. Thank you Jason!

     
  • Jason Gerecke

    Jason Gerecke - 2016-09-21

    Thanks for the feedback -- I'll see about getting the patch integrated upstream.

    Unfortunately, its not likely that this patch would actually arrive in a kernel or distribution for quite some time. Even if this patch were accepted upstream without question (which is not guaranteed) it would likely be slated for the 4.9 kernel which isn't expected to be generally available until December and may take many more months to be picked up by distributions. LTS and distribution kernels aren't likely to pick up the patch either since they are very conservative and will typically only add fixes for panics and severe regressions.

    The best course of action is to wait for the patch to land in "input-wacom". Its much easier to build and install than a full kernel and will provide a way for you to enjoy the benefits of the patch while waiting for the patch to make its way through the upstream and distribution processes. I'll post back when the patch has been added to input-wacom; this normally isn't too long after we receive word that the patch has been accepted upstream.

     
  • Jason Gerecke

    Jason Gerecke - 2016-09-21
    • status: new --> pending
    • assigned_to: Jason Gerecke
     
  • The Compiler

    The Compiler - 2016-12-21

    It seems like this patch didn't make it to 4.9? For whatever reason, the second button started working in Xournal for me (but I don't see anything with e.g. xev) since upgrading to 4.9 :)

     
  • Jason Gerecke

    Jason Gerecke - 2016-12-23
    • status: pending --> pending-fixed
     
  • Jason Gerecke

    Jason Gerecke - 2016-12-23

    Interesting that its started working for you after upgrading to 4.9. You're correct -- the patch that I posted above did not make it into 4.9, although it has been pulled by Linus into his 4.10 tree. I completley forgot to update this bug after the pull...

    Fixed upstream by commit 6005a13. Expected release: Linux 4.10.
    Fixed in input-wacom by commits 0c73651 (import) and 0838341(backport). Expected release: input-wacom 0.33.0

     
  • Aaron Skomra

    Aaron Skomra - 2016-12-23
    • status: pending-fixed --> closed-fixed
     
  • Aaron Skomra

    Aaron Skomra - 2016-12-23

    "Fix available in Linux 4.10 and input-wacom 0.33.0"