12 Dec, 2014

1 commit


10 Dec, 2014

1 commit

  • If a HID descriptor places HID_DG_CONTACTID before HID_DG_X and HID_DG_Y then
    the ABS_X and ABS_Y will not be automatically initialized by the call to
    input_mt_init_slots. To ensure that this is not a problem, we relocate that
    call to occur after HID parsing has been completed and we've initalized all the
    multitouch axes.

    Signed-off-by: Jason Gerecke
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Jason Gerecke
     

02 Dec, 2014

2 commits

  • Since the conversion from USB to HID (in v3.17), some people reported a
    freeze on boot with the wacom driver. Hans managed to get a stacktrace:

    [ 240.272331] Call Trace:
    [ 240.272338] [] ? usb_hcd_submit_urb+0xa9/0xb10
    [ 240.272347] [] schedule+0x29/0x70
    [ 240.272355] [] schedule_preempt_disabled+0x16/0x20
    [ 240.272363] [] __mutex_lock_slowpath+0xe5/0x230
    [ 240.272372] [] mutex_lock+0x17/0x30
    [ 240.272380] [] wacom_resume+0x22/0x50 [wacom]
    [ 240.272396] [] hid_resume_common+0xba/0x110 [usbhid]
    [ 240.272404] [] ? usb_runtime_suspend+0x80/0x80
    [ 240.272417] [] hid_resume+0x3d/0x70 [usbhid]
    [ 240.272425] [] usb_resume_interface.isra.6+0xb6/0x120
    [ 240.272432] [] usb_resume_both+0x74/0x140
    [ 240.272439] [] usb_runtime_resume+0x1a/0x20
    [ 240.272446] [] __rpm_callback+0x32/0x70
    [ 240.272453] [] rpm_callback+0x26/0xa0
    [ 240.272460] [] rpm_resume+0x4b1/0x690
    [ 240.272468] [] ? radix_tree_lookup_slot+0x22/0x50
    [ 240.272475] [] rpm_resume+0x35a/0x690
    [ 240.272482] [] ? zone_statistics+0x89/0xa0
    [ 240.272489] [] __pm_runtime_resume+0x40/0x60
    [ 240.272497] [] usb_autopm_get_interface+0x22/0x60
    [ 240.272509] [] usbhid_open+0x59/0xe0 [usbhid]
    [ 240.272517] [] wacom_open+0x35/0x50 [wacom]
    [ 240.272525] [] input_open_device+0x79/0xa0
    [ 240.272534] [] evdev_open+0x1b1/0x200 [evdev]
    [ 240.272543] [] chrdev_open+0xae/0x1f0
    [ 240.272549] [] ? cdev_put+0x30/0x30
    [ 240.272556] [] do_dentry_open+0x1d2/0x320
    [ 240.272562] [] finish_open+0x31/0x50
    [ 240.272571] [] do_last.isra.36+0x652/0xe50
    [ 240.272579] [] path_openat+0xc7/0x6f0
    [ 240.272586] [] ? final_putname+0x22/0x50
    [ 240.272594] [] ? user_path_at_empty+0x72/0xd0
    [ 240.272602] [] do_filp_open+0x4d/0xc0
    [...]

    So here, wacom_open is called, and then wacom_resume is called by the
    PM system. However, wacom_open already took the lock when wacom_resume
    tries to get it. Freeze.

    A little bit of history shows that this already happened in the past
    - commit f6cd378372bf ("Input: wacom - fix runtime PM related deadlock"),
    and the solution was to call first the PM function before taking the lock.

    The lock was introduced in commit commit e722409445fb ("Input: wacom -
    implement suspend and autosuspend") when the autosuspend feature has
    been added. Given that usbhid already takes care of this very same
    locking between suspend/resume, I think we can simply kill the lock
    in open/close.

    The lock is now used also with LEDs, so we can not remove it completely.

    Reported-by: Hans Spath
    Tested-by: Hans Spath
    CC: stable@vger.kernel.org # v3.17+
    Signed-off-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     
  • In several hid drivers it is necessary to calculate the length of an
    hid_report. This patch exports the existing static function hid_report_len of
    hid-core.c as an inline function in hid.h

    Signed-off-by: Mathieu Magnaudet
    Reviewed-by: Benjamin Tissoires
    Reviewed-by: David Herrmann
    Signed-off-by: Jiri Kosina

    Mathieu Magnaudet
     

26 Nov, 2014

1 commit

  • PAD can be on pen interface (Intuos Pro and Cintiq series) or touch
    interface (Bamboo PT and Intuos PT series) or its own interface
    (Bamboo pen-only and Intuos Pen M/S). We need to mark it independently.

    Signed-off-by: Ping Cheng
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Ping Cheng
     

21 Nov, 2014

1 commit


01 Oct, 2014

5 commits

  • Signed-off-by: Benjamin Tissoires
    Acked-by: Jason Gerecke
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     
  • ISDv4 and v5 are plain HID devices. We can directly implement a generic
    HID parsing/handling and remove the need to manually add those PID in
    the list of supported devices.

    This patch implements the pen support only. The finger part will come in
    a later patch.

    To be properly notified of an .event() and a .report(), we need to force
    hid-core to go through the HID parsing. By default, wacom.ko binds only
    hidraw, so the hid parsing is not done by hid-core. When a true HID device
    is there, we add the flag HID_CLAIMED_DRIVER to hid->claimed which will
    force hid-core to parse the incoming reports.
    (Note that this can be easily backported by directly setting the .claimed
    flag to HID_CLAIMED_DRIVER even if hid-core does not support
    HID_CONNECT_DRIVER)

    Signed-off-by: Benjamin Tissoires
    Acked-by: Jason Gerecke
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     
  • This allows to have the input devices ready in while parsing the reports
    descriptor.

    Signed-off-by: Benjamin Tissoires
    Acked-by: Jason Gerecke
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     
  • If the input can be created earlier during probe, we can already populate
    them while reading the report descriptor. This way, we can rely on the
    hid subsystem directly for tablets which already provide a meaningful
    report descriptor (like ISDv4-5).

    This patch only splits the allocation and registration, but do not
    change where we allocate the input. This will come in a later patch.

    Signed-off-by: Benjamin Tissoires
    Acked-by: Jason Gerecke
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     
  • When we have to deal with new elements in probe, having the exit labels
    named sequencially is a pain to maintain. Put a meaningful name instead
    so that we do not have to renumber them on inserts.

    Signed-off-by: Benjamin Tissoires
    Acked-by: Jason Gerecke
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     

22 Sep, 2014

1 commit

  • Some Wacom tablets (at least the ISDv4 found in the Lenovo X230) timeout
    during probe while retrieving the input reports.
    The only time this information is valuable is during the feature_mapping
    stage, so we can ask for it there and discard the generic input reports
    retrieval.

    This gives a code path closer to the wacom.ko driver when it was in the
    input subtree (not HID).

    Cc: stable@vger.kernel.org # requires cherry-pick of c64d883476
    Signed-off-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     

12 Sep, 2014

1 commit

  • Currently, tablets connected to the WL receiver all share the same
    VID/PID. There is no way for the user space to know which one is which
    besides parsing the name. We can force the PID to be set to the
    actual hardware. This way, the input device will have the correct PID
    which can be match in libwacom.

    With only this trick, the pad input does not inherit the ID_INPUT_TABLET
    udev property from its parent. We can force udev to accept it by declaring
    a BTN_STYLUS which is never used.

    This way, tablets connected through WL can be used from the user point of
    view in the same way they are used while connected through wire.

    Signed-off-by: Benjamin Tissoires
    Reviewed-by: Ping Cheng
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     

11 Sep, 2014

4 commits


13 Aug, 2014

1 commit


07 Aug, 2014

6 commits


26 Jul, 2014

5 commits

  • This is used by HID Bluetooth devices but also add some more information
    to the USB Wireless Receiver.
    We are just porting the bits from hid-wacom.c to the common driver here.

    Signed-off-by: Benjamin Tissoires
    Acked-by: Przemo Firszt
    Acked-by: Ping Cheng
    Signed-off-by: Dmitry Torokhov

    Benjamin Tissoires
     
  • The current implementation uses "wacom_battery" as a generic name for
    batteries. This prevents us to have two Wacom devices with a battery
    attached as the power system will complain about the name which is already
    registered.

    Use an incremental name for each battery attached.

    Related bug:
    https://sourceforge.net/p/linuxwacom/bugs/248/

    Signed-off-by: Benjamin Tissoires
    Acked-by: Przemo Firszt
    Acked-by: Ping Cheng
    Signed-off-by: Dmitry Torokhov

    Benjamin Tissoires
     
  • - Reports the current status of the battery (discharging, charging, full).
    - Also notify the upower daemon when there is a change in the battery
    value.
    - keep the battery value as a percentage, not the raw value
    - add WACOM_QUIRK_BATTERY to easily add a battery to a device (required
    for Bluetooth devices)

    Signed-off-by: Benjamin Tissoires
    Acked-by: Przemo Firszt
    Acked-by: Ping Cheng
    Signed-off-by: Dmitry Torokhov

    Benjamin Tissoires
     
  • This solves a bug with the wireless receiver:
    - at plug, the wireless receiver does not know which Wacom device it is
    connected to, so it does not actually creates all the LEDs
    - when the tablet connects, wacom->wacom_wac.features.type is set to the
    proper device so that wacom_wac can understand the packets
    - when the receiver is unplugged, it detects that a LED should have been
    created (based on wacom->wacom_wac.features.type) and tries to remove
    it: crash when removing the sysfs group.

    Side effect, we can now safely call several times wacom_destroy_leds().

    Signed-off-by: Benjamin Tissoires
    Acked-by: Ping Cheng
    Signed-off-by: Dmitry Torokhov

    Benjamin Tissoires
     
  • wacom.ko is now a full HID driver, we have to move it into the proper
    subdirectory: drivers/hid.

    Signed-off-by: Benjamin Tissoires
    Signed-off-by: Dmitry Torokhov

    Benjamin Tissoires