1. 07 11月, 2019 1 次提交
    • J
      HID: wacom: generic: Treat serial number and related fields as unsigned · ff479731
      Jason Gerecke 提交于
      The HID descriptors for most Wacom devices oddly declare the serial
      number and other related fields as signed integers. When these numbers
      are ingested by the HID subsystem, they are automatically sign-extended
      into 32-bit integers. We treat the fields as unsigned elsewhere in the
      kernel and userspace, however, so this sign-extension causes problems.
      In particular, the sign-extended tool ID sent to userspace as ABS_MISC
      does not properly match unsigned IDs used by xf86-input-wacom and libwacom.
      
      We introduce a function 'wacom_s32tou' that can undo the automatic sign
      extension performed by 'hid_snto32'. We call this function when processing
      the serial number and related fields to ensure that we are dealing with
      and reporting the unsigned form. We opt to use this method rather than
      adding a descriptor fixup in 'wacom_hid_usage_quirk' since it should be
      more robust in the face of future devices.
      
      Ref: https://github.com/linuxwacom/input-wacom/issues/134
      Fixes: f85c9dc6 ("HID: wacom: generic: Support tool ID and additional tool types")
      CC: <stable@vger.kernel.org> # v4.10+
      Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: NAaron Armstrong Skomra <aaron.skomra@wacom.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ff479731
  2. 05 9月, 2019 1 次提交
  3. 20 8月, 2019 3 次提交
  4. 19 8月, 2019 1 次提交
  5. 13 8月, 2019 1 次提交
  6. 05 8月, 2019 1 次提交
  7. 02 7月, 2019 1 次提交
  8. 26 6月, 2019 1 次提交
  9. 13 6月, 2019 4 次提交
  10. 31 5月, 2019 1 次提交
  11. 18 5月, 2019 3 次提交
  12. 17 5月, 2019 5 次提交
  13. 21 2月, 2019 1 次提交
  14. 15 2月, 2019 1 次提交
    • G
      HID: wacom: Mark expected switch fall-through · 1da92d43
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warning:
      
      drivers/hid/wacom_wac.c: In function ‘wacom_setup_pen_input_capabilities’:
      drivers/hid/wacom_wac.c:3506:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
         __clear_bit(ABS_MISC, input_dev->absbit);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/hid/wacom_wac.c:3508:2: note: here
        case WACOM_MO:
        ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Acked-by: NPing Cheng <ping.cheng@wacom.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      1da92d43
  15. 29 1月, 2019 1 次提交
  16. 11 10月, 2018 1 次提交
    • J
      HID: wacom: Work around HID descriptor bug in DTK-2451 and DTH-2452 · 11db8173
      Jason Gerecke 提交于
      The DTK-2451 and DTH-2452 have a buggy HID descriptor which incorrectly
      contains a Cintiq-like report, complete with pen tilt, rotation, twist, serial
      number, etc. The hardware doesn't actually support this data but our driver
      duitifully sets up the device as though it does. To ensure userspace has a
      correct view of devices without updated firmware, we clean up this incorrect
      data in wacom_setup_device_quirks.
      
      We're also careful to clear the WACOM_QUIRK_TOOLSERIAL flag since its presence
      causes the driver to wait for serial number information (via
      wacom_wac_pen_serial_enforce) that never comes, resulting in
      the pen being non-responsive.
      Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Fixes: 83417206 ("HID: wacom: Queue events with missing type/serial data for later processing")
      Cc: stable@vger.kernel.org # v4.16+
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      11db8173
  17. 03 7月, 2018 2 次提交
    • J
      HID: wacom: Correct touch maximum XY of 2nd-gen Intuos · 3b8d5735
      Jason Gerecke 提交于
      The touch sensors on the 2nd-gen Intuos tablets don't use a 4096x4096
      sensor like other similar tablets (3rd-gen Bamboo, Intuos5, etc.).
      The incorrect maximum XY values don't normally affect userspace since
      touch input from these devices is typically relative rather than
      absolute. It does, however, cause problems when absolute distances
      need to be measured, e.g. for gesture recognition. Since the resolution
      of the touch sensor on these devices is 10 units / mm (versus 100 for
      the pen sensor), the proper maximum values can be calculated by simply
      dividing by 10.
      
      Fixes: b5fd2a3e ("Input: wacom - add support for three new Intuos devices")
      Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      3b8d5735
    • J
      HID: wacom: Replace touch_max fixup code with static touch_max definitions · 29b9e148
      Jason Gerecke 提交于
      Detecting the number of supported touches for a particular device used
      to be tricky, both because early forms of the driver didn't have a very
      good HID parser and because early hardware didn't always advertise the
      actual number. At the time, we added a block of code which would ensure
      that touch_max would always be equal to at least 1 on any touch device,
      and relied on setting touch_max to e.g. 2 only for the multitouch-capable
      exceptions.
      
      The common case has since flipped, and the driver and descriptors can
      reliably detect the number of touches supported by modern sensors.
      Because of this, it makes sense to remove the fixup code and instead
      place static declarations of "touch_max = 1" for these old devices. It
      isn't entirely clear if all 2-finger devices actually report a maximum
      number of touches so we leave these declarations still in place.
      
      For the eagle-eyed, the "> BAMBOO_PT" condition was originally equivalent
      to ">= TABLETPC", which is what the intent was. This commit doesn't have
      to consider the types introduced in the interim since they shouldn't be
      affected, hence why only the tablet PC definitions have been modified.
      Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: NPing Cheng <ping.cheng@wacom.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      29b9e148
  18. 22 5月, 2018 1 次提交
  19. 12 4月, 2018 1 次提交
  20. 07 3月, 2018 4 次提交
  21. 23 1月, 2018 2 次提交
    • J
      HID: wacom: Add support for One by Wacom (CTL-472 / CTL-672) · c9472189
      Jason Gerecke 提交于
      Adds support for the second-generation "One by Wacom" tablets. These
      devices are similar to the last generation, but a slightly different size
      and reporting a higher number of pressure levels.
      Signed-off-by: NMx Jing <jingmingxuan@outlook.com>
      Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      c9472189
    • J
      HID: wacom: Fix reporting of touch toggle (WACOM_HID_WD_MUTE_DEVICE) events · 403c0f68
      Jason Gerecke 提交于
      Touch toggle softkeys send a '1' while pressed and a '0' while released,
      requring the kernel to keep track of wether touch should be enabled or
      disabled. The code does not handle the state transitions properly,
      however. If the key is pressed repeatedly, the following four states
      of states are cycled through (assuming touch starts out enabled):
      
      Press:   shared->is_touch_on => 0, SW_MUTE_DEVICE => 1
      Release: shared->is_touch_on => 0, SW_MUTE_DEVICE => 1
      Press:   shared->is_touch_on => 1, SW_MUTE_DEVICE => 0
      Release: shared->is_touch_on => 1, SW_MUTE_DEVICE => 1
      
      The hardware always properly enables/disables touch when the key is
      pressed but applications that listen for SW_MUTE_DEVICE events to provide
      feedback about the state will only ever show touch as being enabled while
      the key is held, and only every-other time. This sequence occurs because
      the fallthrough WACOM_HID_WD_TOUCHONOFF case is always handled, and it
      uses the value of the *local* is_touch_on variable as the value to
      report to userspace. The local value is equal to the shared value when
      the button is pressed, but equal to zero when the button is released.
      
      Reporting the shared value to userspace fixes this problem, but the
      fallthrough case needs to update the shared value in an incompatible
      way (which is why the local variable was introduced in the first place).
      To work around this, we just handle both cases in a single block of code
      and update the shared variable as appropriate.
      
      Fixes: d793ff81 ("HID: wacom: generic: support touch on/off softkey")
      Cc: <stable@vger.kernel.org> # v4.12+
      Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: NAaron Skomra <aaron.skomra@wacom.com>
      Tested-by: NAaron Skomra <aaron.skomra@wacom.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      403c0f68
  22. 21 11月, 2017 2 次提交
    • J
      HID: wacom: Queue events with missing type/serial data for later processing · 83417206
      Jason Gerecke 提交于
      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: NJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      83417206
    • J
      HID: wacom: Properly handle AES serial number and tool type · 99acedad
      Jason Gerecke 提交于
      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: NJason Gerecke <jason.gerecke@wacom.com>
      Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      99acedad
  23. 09 11月, 2017 1 次提交