Skip to content
Snippets Groups Projects
  1. Jul 18, 2022
    • Joshua's avatar
      tests: wacom: Making the test framework for touch · 63a17f0f
      Joshua authored
      
      Using the existing framework for stylus based inputs to create a new framework
      needed for touch tests. Made slight adjustments to the base tests to facilitate
      touch inputs. For the touch tests the report descriptor for a DTH-2452 tablet
      was added in to use for the device. Ontop of existing tests a new test was
      created in order to catch an edge case for touch involving a tablet passing
      a contact ID of 0.
      
      Signed-off-by: default avatarJoshua Dickens <joshua.dickens@wacom.com>
      Reviewed-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      63a17f0f
    • Jason Gerecke's avatar
      tests: wacom: Implement test for partial/empty pad syncs · 62f21f86
      Jason Gerecke authored and Joshua's avatar Joshua committed
      
      The PTH-460 has its HID descriptor implemented slightly differently
      to its siblings the 660 and 860. Specifically, each of the functions
      of the pad are encapsulated in their own physical collections. This
      causes a little bit of trouble for the current Wacom driver which
      typically treats multiple collections of the same tool as multiple
      snapshots of a single tool's state (mainly to support BT devices
      that send e.g. 5 pen updates in a single packet).
      
      We check to make sure that we don't get partial/empty pad syncs
      when they shouldn't exist. The easiest way to trigger this behavior
      is to simultaneously use the touchring and expresskeys since they
      are in different collections.
      
      This behavior was fixed in the upstream Linux kernel by commit
      d4b8efeb46d9 ("HID: wacom: generic: Correct pad syncing").
      
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      62f21f86
    • Jason Gerecke's avatar
      BaseDevice: Make 'match_evdev_rule' more lenient · 649fcd8e
      Jason Gerecke authored and Joshua's avatar Joshua committed
      
      At the moment the function offers no middle-ground between
      returning "true" and associating an evdev device with a specific
      type, or returning "false" and associating it with *no* types.
      
      The Wacom tests require us to have access to both e.g. Pen and
      Pad devices, but we need to be careful to ensure that the pen
      evdev device is actually associated with the "Pen" type, and
      pad device with the "Pad" type. The "udev_input_event" function
      does a pretty good job with this normally, but because all pad
      devices are also pen devices, things go a little off the rails.
      
      This commit allows the caller to return 'false' for only the
      specific combinations of device and application that don't
      make sense, but still return 'true' in other situations.
      
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      649fcd8e
    • Jason Gerecke's avatar
      tests: wacom: Check PTH tablets for spurious event bug · 6c1b8943
      Jason Gerecke authored and Joshua's avatar Joshua committed
      
      Commit d4b8efeb46d9 introduced an issue which causes a BTN_TOUCH=0
      event to be sent out whenever a heartbeat report is received. We
      have a fix for this bug, but lets make sure it does not come back.
      
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      6c1b8943
    • Jason Gerecke's avatar
      tests: wacom: Add tests for 2nd-gen Intuos Pro · 4638ffdd
      Jason Gerecke authored and Joshua's avatar Joshua committed
      
      Adds descriptors for the PTH-660, PTH-860, and PTH-460, as well as
      the necessary device / test definitions to exercise them. Updates
      `test_descriptor_physicals()` to better handle these tablets (new
      usages listed among the required, filtering of mouse collection).
      Also notes errata with the descriptors that cause the physicals
      test to fail.
      
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      4638ffdd
    • Jason Gerecke's avatar
      tests: wacom: Filter out Pad evdev devices from test runs · b9b02a48
      Jason Gerecke authored and Joshua's avatar Joshua committed
      
      The Wacom driver may create several devices for a given interface.
      We need to be sure we're working with the correct one.
      
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      b9b02a48
    • Jason Gerecke's avatar
      tests: wacom: Test HID descriptors for proper physical ranges · efb927d0
      Jason Gerecke authored and Joshua's avatar Joshua committed
      
      Adds a test of the HID descriptor itself to make sure that physical
      ranges are set where necessary and actually make sense. Failures in
      this test highlight devices that may need a HID descriptor fixup.
      Mostly intended for pre-production use to catch errors before they
      become real.
      
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      efb927d0
    • Jason Gerecke's avatar
      tests: wacom: Add a generic CTL-series tablet and tests · 334148d1
      Jason Gerecke authored and Joshua's avatar Joshua committed
      
      Adds a slightly more in-depth report descriptor for something resembling
      a generic pen-only CTL device. Additions above and beyond the bare-bones
      OpaqueTablet are the use of Wacom's vendor-defined usages and support
      for pressure, eraser, and barrel buttons.
      
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      334148d1
    • Jason Gerecke's avatar
      tests: Add module to test Wacom driver generic codepath · efa09f79
      Jason Gerecke authored and Joshua's avatar Joshua committed
      
      Just some boiler-plate to get started. Still need to write many more
      devices and testcases. Note that the weird report_descriptor comment
      formatting is just to shut up flake8's E262 rule (which doesn't like
      indenting).
      
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      efa09f79
  2. May 17, 2022
  3. Mar 06, 2022
  4. Dec 20, 2021
  5. Dec 19, 2021
  6. Dec 18, 2021
  7. Dec 08, 2021
  8. Dec 06, 2021
  9. Nov 24, 2021
  10. Nov 17, 2021
  11. Nov 09, 2021
  12. Oct 10, 2021
    • Maximilian Luz's avatar
      hidtools: Add support for BUS_HOST · 5a86fcc7
      Maximilian Luz authored
      
      Currently, hid-tools does not support BUS_HOST. This can, for example,
      cause hid-recorder to crash when it encounters a device with that bus
      with the following stack trace:
      
        Traceback (most recent call last):
          File "/home/ukas/hid-tools/./hid-recorder", line 23, in <module>
            hidtools.cli.record.main()
          File "/usr/lib/python3/dist-packages/click/core.py", line 829, in __call__
            return self.main(*args, **kwargs)
          File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
            rv = self.invoke(ctx)
          File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
            return ctx.invoke(self.callback, **ctx.params)
          File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
            return callback(*args, **kwargs)
          File "/home/ukas/hid-tools/hidtools/cli/record.py", line 75, in main
            device_list = [open(list_devices())]
          File "/home/ukas/hid-tools/hidtools/cli/record.py", line 36, in list_devices
            d = HidrawDevice(f)
          File "/home/ukas/hid-tools/hidtools/hidraw.py", line 199, in __init__
            self.bustype = BusType(bustype)
          File "/usr/lib/python3.9/enum.py", line 360, in __call__
            return cls.__new__(cls, value)
          File "/usr/lib/python3.9/enum.py", line 678, in __new__
            raise ve_exc
        ValueError: 25 is not a valid BusType
      
      BUS_HOST is for example used on HID devices connected via the Microsoft
      Surface Aggregator, an embedded controller found on newer Microsoft
      Surface devices. On those devices the surface_hid kernel driver provides
      a HID transport channel to that EC.
      
      Add support for BUS_HOST to prevent crashes like this.
      
      Signed-off-by: default avatarMaximilian Luz <luzmaximilian@gmail.com>
  13. Sep 21, 2021
    • Benjamin Tissoires's avatar
      hidraw: fixes for _HIDIOCGFEATURE · 30aebaf5
      Benjamin Tissoires authored
      
      The report ID can not be negative
      The buf had a wrong size
      
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@gmail.com>
      30aebaf5
    • Peter Hutterer's avatar
      Add a hid-feature tool to query and change Feature Reports · 2f47a127
      Peter Hutterer authored and Benjamin Tissoires's avatar Benjamin Tissoires committed
      
      Example usage to change the second Resolution Multiplier here:
      
      $ hid-feature list --fetch-values /dev/hidraw1
      Feature | Report | Usage Page                | Usage                                      | Range     | Count | Bits | Value(s)
      --------|--------|---------------------------|--------------------------------------------|-----------|-------|------|---------
       120000 |     18 | Generic Desktop           | Resolution Multiplier                      | [ 0,   1] |     1 |   2  | 1
       120001 |     18 | Generic Desktop           | Resolution Multiplier                      | [ 0,   1] |     1 |   2  | 1
       120002 |     18 | Generic Desktop           | Undefined                                  | [ 0,   1] |     1 |   4  | 0
       170000 |     23 | Vendor Defined Page 1     | 0xff00ff06                                 | [ 0,   1] |     1 |   2  | 1
      
      $ hid-feature set --feature 120000 1 --feature 120001 0 /dev/hidraw1
      
      $ hid-feature list --fetch-values /dev/hidraw1
      Feature | Report | Usage Page                | Usage                                      | Range     | Count | Bits | Value(s)
      --------|--------|---------------------------|--------------------------------------------|-----------|-------|------|---------
       120000 |     18 | Generic Desktop           | Resolution Multiplier                      | [ 0,   1] |     1 |   2  | 1
       120001 |     18 | Generic Desktop           | Resolution Multiplier                      | [ 0,   1] |     1 |   2  | 0
       120002 |     18 | Generic Desktop           | Undefined                                  | [ 0,   1] |     1 |   4  | 0
       170000 |     23 | Vendor Defined Page 1     | 0xff00ff06                                 | [ 0,   1] |     1 |   2  | 1
      
      Where the --fetch-values is omitted during `list`, the device is never accessed.
      
      The feature index is a simple value based on the report ID and the index of
      the feature within that report, this gives it a unique-enough ID that we can
      then pass into `hid-feature set`.
      
      Setting the actual feature takes a tuple of the id and the new value
      (e.g.--feature 120001 0). This won't work for items that have a count != 1
      but we can deal with that when we need to.
      
      Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
      2f47a127
    • Peter Hutterer's avatar
      hidraw: add support for HIDIOCGFEATURE · 66d6396a
      Peter Hutterer authored and Benjamin Tissoires's avatar Benjamin Tissoires committed
      
      Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
      66d6396a
  14. May 30, 2021
  15. May 27, 2021
  16. May 05, 2021
Loading