1. 07 Mar, 2018 2 commits
  2. 21 Nov, 2017 2 commits
    • Jason Gerecke's avatar
      HID: wacom: Queue events with missing type/serial data for later processing · 83417206
      Jason Gerecke authored
      Userspace expects to receive tool type and serial number information
      for the active pen in the very first kernel report, if such data is
      supported by the hardware. While this expectation is not an issue for
      EMR devices, AES sensors will often send several packets worth of in-
      range data before relaying type/serial data to the kernel. Sending this
      data "late" can result in proximity-tracking issues by xf86-input-wacom,
      or an inability to distinguish different pens by input-wacom.
      
      Options for dealing with this situation include ignoring reports from
      the tablet until we get the necessary data, or using the information
      from the last-seen pen instead of the (eventual) real data. Neither
      option is particularly attractive: the former results in truncated
      strokes and the latter causes issues with switching between pens.
      
      This commit instead opts to queue up events with missing information
      until we receive a report which contains it. At that point, we can
      update the driver's state variables (id[0] and serial[0]) and replay
      the queued events.
      Signed-off-by: 's avatarJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: 's avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: 's avatarJiri Kosina <jkosina@suse.cz>
      83417206
    • Jason Gerecke's avatar
      HID: wacom: Properly handle AES serial number and tool type · 99acedad
      Jason Gerecke authored
      Current AES sensors relay tool type and serial number information with
      a different set of usages than those prescribed by the modern (i.e.
      MobileStudio Pro and newer) EMR tablet standard. To ensure the driver
      properly understands these usages, we modify them to be compatible.
      The identifying information is split across three consecutive fields:
      a 16-bit WACOM_HID_WT_SERIALNUMBER (which is more accurately described
      as WACOM_HID_WD_TOOLTYPE), a 32-bit HID_DG_TOOLSERIALNUMBER, and an
      8-bit 0xFF000000 (which should be WACOM_HID_WD_SERIALHI). While we're
      at it, we also define proper min/max values since may may be undefined
      on some devices.
      Signed-off-by: 's avatarJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: 's avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: 's avatarJiri Kosina <jkosina@suse.cz>
      99acedad
  3. 09 Nov, 2017 1 commit
  4. 19 Oct, 2017 1 commit
  5. 05 May, 2017 2 commits
    • Jason Gerecke's avatar
      HID: wacom: generic: Refactor generic battery handling · 5ac3d4ae
      Jason Gerecke authored
      Generic battery handling code is spread between the pen and pad codepaths
      since battery usages may appear in reports for either. This makes it
      difficult to concisely see the logic involved. Since battery data is
      not treated like other data (i.e., we report it through the power_supply
      subsystem rather than through the input subsystem), it makes reasonable
      sense to split the functionality out into its own functions.
      
      This commit has the generic battery handling duplicate the same pattern
      that is used by the pen, pad, and touch interfaces. A "mapping" function
      is provided to set up the battery, an "event" function is provided to
      update the battery data, and a "report" function is provided to notify
      the power_supply subsystem after all the data has been read. We look at
      the usage itself rather than its collection to determine if one of the
      battery functions should handle it. Additionally, we unconditionally
      call the "report" function since there is no particularly good way to
      know if a report contained a battery usage; 'wacom_notify_battery()'
      will filter out any duplicate updates, however.
      Signed-off-by: 's avatarJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: 's avatarPing Cheng <ping.cheng@wacom.com>
      Signed-off-by: 's avatarJiri Kosina <jkosina@suse.cz>
      5ac3d4ae
    • Jason Gerecke's avatar
      HID: wacom: Add ability to provide explicit battery status info · 16e45989
      Jason Gerecke authored
      At the moment, our driver relies on 'wacom_battery_get_property()' to
      determine the most likely battery state (e.g charging, discharging, or
      full) based on the information available. It is not always possible
      for the function to properly determine this, however. For instance,
      whenever an AES pen leaves proximity the battery state becomes
      indeterminite. This commit adds the ability to provide it with explict
      state information if desired. Whenever explicit state is not required
      (the majority of circumstances), WACOM_POWER_SUPPLY_STATUS_AUTO can
      be used in its place.
      
      Three uses of explicit battery status are added: two wireless disconnect
      paths and the AES case mentioned above.
      Signed-off-by: 's avatarJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: 's avatarPing Cheng <ping.cheng@wacom.com>
      Signed-off-by: 's avatarJiri Kosina <jkosina@suse.cz>
      16e45989
  6. 06 Apr, 2017 1 commit
  7. 06 Mar, 2017 3 commits
  8. 26 Jan, 2017 6 commits
  9. 09 Dec, 2016 1 commit
  10. 20 Oct, 2016 12 commits
  11. 11 Aug, 2016 1 commit
    • Jason Gerecke's avatar
      HID: wacom: Update last_slot_field during pre_report phase · 003f50ab
      Jason Gerecke authored
      If a touchscreen contains both multitouch and single-touch reports in its
      descriptor in that order, the driver may overwrite information it saved
      about the format of the multitouch report. This can cause the report
      processing code to get tripped up and send an incorrect event stream to
      userspace.
      
      In particular, this can cause last_slot_field to be overwritten with the
      result that the driver prematurely assumes it has finished processing a
      slot and sending the ABS_MT_SLOT event at the wrong point in time,
      associating events for the current contact with the following contact
      instead.
      
      To prevent this from occurring, we update the value of last_slot_field
      durring the pre_report phase to ensure that it is correct for the report
      that is to be processed.
      Signed-off-by: 's avatarJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: 's avatarPing Cheng <pingc@wacom.com>
      Reviewed-by: 's avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: 's avatarJiri Kosina <jkosina@suse.cz>
      003f50ab
  12. 10 Aug, 2016 1 commit
  13. 05 Aug, 2016 5 commits
  14. 03 May, 2016 1 commit
    • Jason Gerecke's avatar
      HID: wacom: Add fuzz factor to distance and tilt axes · bef7e200
      Jason Gerecke authored
      The fuzz present on the distance and tilt axes is noticable when a puck is
      present, and userspace (specifically libinput) would like the ability to
      filter out the noise. To facilitate this, we assign a fuzz value of '1'
      for the distance and tilt axes. This is large enough to cover most of the
      natural variation in distance value as the puck is moved around, and
      enough to cover the jitter in rotation (reported through tilt axes) when
      the puck is left alone.
      Signed-off-by: 's avatarJason Gerecke <jason.gerecke@wacom.com>
      Signed-off-by: 's avatarJiri Kosina <jkosina@suse.cz>
      bef7e200
  15. 05 Apr, 2016 1 commit