20 Jun, 2017

1 commit

  • Setting these bits causes libinput to fail to initialize the device;
    setting BTN_TOUCH and BTN_TOOL_FINGER causes it to treat the mouse as a
    touchpad, and it then refuses to continue when it discovers ABS_X is not
    set.

    This breaks all known Wayland compositors, as well as Xorg when the
    libinput driver is being used.

    This reverts commit f4b65b9563216b3e01a5cc844c3ba68901d9b195.

    Signed-off-by: Daniel Stone
    Cc: Che-Liang Chiou
    Cc: Thierry Escande
    Cc: Jiri Kosina
    Cc: Benjamin Tissoires
    Acked-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Daniel Stone
     

05 May, 2017

1 commit

  • The driver emits multi-touch events for Magic Trackpad as well as Magic
    Mouse, but it does not set keybits that are related to multi-touch event
    for Magic Mouse; so set these keybits.

    The keybits that are not set cause trouble because user programs often
    probe these keybits for self-configuration and thus they cannot operate
    properly if the keybits are not set.

    One of such troubles is that libevdev will not be able to emit correct
    touch count, causing gestures library failed to do fling stop.

    Signed-off-by: Che-Liang Chiou
    Signed-off-by: Thierry Escande
    Signed-off-by: Jiri Kosina

    Che-Liang Chiou
     

24 Nov, 2016

1 commit


06 Nov, 2015

1 commit

  • When configuring input device via input_configured callback we may
    encounter errors (for example input_mt_init_slots() may fail). Instead
    of continuing with half-initialized input device let's allow driver
    indicate failures.

    Signed-off-by: Jaikumar Ganesh
    Signed-off-by: Arve Hjønnevåg
    Reviewed-by: Benjamin Tissoires
    Reviewed-by: David Herrmann
    Acked-by: Nikolai Kondrashov
    Acked-by: Andrew Duggan
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Jiri Kosina

    Dmitry Torokhov
     

27 Aug, 2014

1 commit


17 Feb, 2014

2 commits


06 Sep, 2013

1 commit


31 Jul, 2013

1 commit

  • It is safe to use devres allocation within the hid subsystem:
    - the devres release is called _after_ the call to .remove(), meaning
    that no freed pointers will exists while removing the device
    - if a .probe() fails, devres releases all the allocated ressources
    before going to the next driver: there will not be ghost ressources
    attached to a hid device if several drivers are probed.

    Given that, we can clean up a little some of the HID drivers. These ones
    are trivial:
    - there is only one kzalloc in the driver
    - the .remove() callback contains only one kfree on top of hid_hw_stop()
    - the error path in the probe is easy enough to be manually checked

    Signed-off-by: Benjamin Tissoires
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     

23 Jul, 2013

1 commit


30 Apr, 2013

1 commit


04 Apr, 2013

1 commit

  • Since kernel 3.7, it appears that the input registration occured before
    the end of magicmouse_setup_input(). This is shown by receiving a lot of
    "EV_SYN SYN_REPORT 1" instead of normal "EV_SYN SYN_REPORT 0".
    This value means that the output buffer is full, and the user space
    is loosing events.

    Using .input_configured guarantees that the race is not occuring, and that
    the call of "input_set_events_per_packet(input, 60)" is taken into account
    by input_register().

    Fixes:
    https://bugzilla.redhat.com/show_bug.cgi?id=908604

    Cc: stable@vger.kernel.org
    Reported-and-Tested-By: Clarke Wixon
    Signed-off-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     

25 Feb, 2013

1 commit


03 Jan, 2013

1 commit

  • Use the new module_hid_driver macro in all HID drivers that have
    a simple register/unregister init/exit.

    This also converts the hid drivers that test for a failure of
    hid_register_driver() and report the failure. Using module_hid_driver
    in those drivers removes the failure message.

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: Jiri Kosina

    H Hartley Sweeten
     

20 Sep, 2012

1 commit


05 Jul, 2012

2 commits

  • The driver for Apple Magic Trackpad/Mouse currently uses
    Multi-touch Protocol A (MT-A) to report touch events and uses
    ABS_MT_TRACKING_ID to do finger tracking. The fact of the device
    being able to track individual finger makes it possible to
    report touch events using MT-B. This patch converts the driver
    to use MT-B as it is preferred to MT-A.

    V4: Removed BTN_TOUCH evnet.
    V3: Removed the single touch related logic.
    V2: Converting entirely to MT-B as Henrik Rydberg suggested.

    Signed-off-by: Yufeng Shen
    Reviewed-and-tested-by: Henrik Rydberg
    Signed-off-by: Jiri Kosina

    Yufeng Shen
     
  • Remove the report_touches switch as it is not so useful to turn
    off reporting touch events for a touch device. Let the userspace
    to do the filtering if the turning off is needed.

    V2: Remove report_touches as suggeted by Chase Douglas

    Signed-off-by: Yufeng Shen
    Reviewed-and-tested-by: Henrik Rydberg
    Signed-off-by: Jiri Kosina

    Yufeng Shen
     

25 Jun, 2012

1 commit

  • In patch "HID: magicmouse: Adjust major / minor axes to scale",
    touch_major and touch_minor axes are scaled by a factor of
    four when reported but the max touch_major/minor is not scaled
    accordingly. This patch scales the max touch_major/minor to
    be consistent with the reported value.

    Signed-off-by: Yufeng Shen
    Acked-by: Henrik Rydberg
    Signed-off-by: Jiri Kosina

    Yufeng Shen
     

21 Feb, 2012

1 commit


21 Oct, 2011

1 commit

  • hid-magicmouse was advertising the Apple Magic Trackpad as having 2
    buttons (left and right) when it actually only has 1 button.

    Advertising multiple buttons makes Xorg disable all button 2 and 3
    emulation (using multi-finger clicks). So Xorg users don't get working
    right/middle-click emulation out of the box.

    This patch makes hid-magicmouse correctly only report one real button
    for Magic Trackpad, which in turn makes Xorg enable multi-finger click
    support to emulate right/middle buttons.

    [http://launchpad.net/bugs/862094]

    Signed-off-by: Daniel van Vugt
    Reviewed-by: Chase Douglas
    Signed-off-by: Jiri Kosina

    Daniel van Vugt
     

25 Aug, 2011

1 commit

  • This is basically a more generic respin of 23746a6 ("HID: magicmouse: ignore
    'ivalid report id' while switching modes") which got reverted later by
    c3a492.

    It turns out that on some configurations, this is actually still the case
    and we are not able to detect in runtime.

    The device reponds with 'invalid report id' when feature report switching it
    into multitouch mode is sent to it.

    This has been silently ignored before 0825411ade ("HID: bt: Wait for ACK
    on Sent Reports"), but since this commit, it propagates -EIO from the _raw
    callback .

    So let the driver ignore -EIO as response to 0xd7,0x01 report, as that's
    how the device reacts in normal mode.

    Sad, but following reality.

    This fixes https://bugzilla.kernel.org/show_bug.cgi?id=35022

    Reported-by: Chase Douglas
    Reported-by: Jaikumar Ganesh
    Tested-by: Chase Douglas
    Tested-by: Jaikumar Ganesh
    Signed-off-by: Jiri Kosina

    Jiri Kosina
     

10 Aug, 2011

1 commit

  • Add touch surface resolution information. The size of the touch surfaces
    has been determined to the hundredth of a mm.

    Cc: Jiri Kosina
    Cc: Michael Poole
    Cc: linux-input@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Chase Douglas
    [jkosina@suse.cz: update comments and commit message]
    Signed-off-by: Jiri Kosina

    Chase Douglas
     

16 Jun, 2011

1 commit


23 May, 2011

1 commit


20 May, 2011

1 commit

  • The device reponds with 'invalid report id' when feature report switching it
    into multitouch mode is sent to it.

    This has been silently ignored before 0825411ade ("HID: bt: Wait for ACK
    on Sent Reports"), but since this commit, it propagates -EIO from the _raw
    callback .

    So let the driver ignore -EIO as response to 0xd7,0x01 report, as that's
    how the device reacts in normal mode.

    Sad, but following reality.

    This fixes https://bugzilla.kernel.org/show_bug.cgi?id=35022

    Tested-by: Chase Douglas
    Signed-off-by: Jiri Kosina

    Jiri Kosina
     

08 Apr, 2011

1 commit


06 Apr, 2011

1 commit

  • The evdev buffer isn't big enough when you get many fingers on the
    device. Bump up the buffer to a reasonable size, matching what other
    multitouch devices use. Without this change, events may be discarded in
    the evdev buffer before they are read.

    Reported-by: Simon Budig
    Cc: Henrik Rydberg
    Cc: Jiri Kosina
    Cc: stable@kernel.org
    Signed-off-by: Chase Douglas
    Acked-by: Henrik Rydberg
    Signed-off-by: Jiri Kosina

    Chase Douglas
     

31 Mar, 2011

1 commit


10 Mar, 2011

1 commit

  • The magic trackpad and mouse both report touch orientation in opposite
    direction to the bcm5974 driver and what is written in
    Documents/input/multi-touch-protocol.txt. This patch reverts the
    direction, so that all in-kernel devices with this feature behave the
    same way.

    Since no known application has been utilizing this information yet, it
    seems appropriate also for stable.

    Cc: stable@kernel.org
    Cc: Michael Poole
    Signed-off-by: Henrik Rydberg
    Acked-by: Chase Douglas
    Signed-off-by: Jiri Kosina

    Henrik Rydberg
     

08 Jan, 2011

1 commit


10 Dec, 2010

1 commit

  • Neaten current uses of dev_ by adding and using
    hid specific hid_ macros.

    Convert existing uses of dev_ uses to hid_.
    Convert hid-pidff printk uses to hid_.

    Remove err_hid and use hid_err instead.

    Add missing newlines to logging messages where necessary.
    Coalesce format strings.

    Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt

    Other miscellaneous changes:

    Add const struct hid_device * argument to hid-core functions
    extract() and implement() so hid_ can be used by them.
    Fix bad indentation in hid-core hid_input_field function
    that calls extract() function above.

    Signed-off-by: Joe Perches
    Signed-off-by: Jiri Kosina

    Joe Perches
     

09 Dec, 2010

1 commit

  • With the recent switch to having the hid layer handle standard axis
    initialization, the Magic Trackpad now reports relative axes. This would
    be fine in the normal mode, but the driver puts the device in multitouch
    mode where no relative events are generated. Also, userspace software
    depends on accurate axis information for device type detection. Thus,
    ignoring the relative axes from the Magic Trackpad is best.

    Signed-off-by: Chase Douglas
    Signed-off-by: Jiri Kosina

    Chase Douglas
     

01 Oct, 2010

1 commit

  • By visual inspection, the reported touch_major and touch_minor axes
    are roughly a factor of four too small. The factor is approximate,
    since the protocol is not known and the HID report encodes touch size
    with fewer bits than positions. This patch scales the reported values
    by a factor of four.

    Signed-off-by: Henrik Rydberg
    Signed-off-by: Chase Douglas
    Acked-by: Michael Poole
    Signed-off-by: Jiri Kosina

    Henrik Rydberg
     

24 Sep, 2010

1 commit


04 Sep, 2010

2 commits

  • The trackpad speaks a similar, but different, protocol from the magic
    mouse. However, only small code tweaks here and there are needed to make
    basic multitouch work.

    Extra logic is required for single-touch emulation of the touchpad. The
    changes made here take the approach that only one finger may emulate the
    single pointer when multiple fingers have touched the screen. Once that
    finger is raised, all touches must be raised before any further single
    touch events can be sent.

    Sometimes the magic trackpad sends two distinct touch reports as one big
    report. Simply splitting the packet in two and resending them through
    magicmouse_raw_event ensures they are handled properly.

    I also added myself to the copyright statement.

    Signed-off-by: Chase Douglas
    Acked-by: Michael Poole
    Signed-off-by: Jiri Kosina

    Chase Douglas
     
  • The new format should be easier to read to determine which bits
    correspond to which data. It also brings all the manipulation logic to
    the top of the function. This makes size and orientation reading more
    clear.

    Note that the impetus for this change is the forthcoming support for the
    Magic Trackpad, which has a different touch data protocol.

    Signed-off-by: Chase Douglas
    Acked-by: Michael Poole
    Signed-off-by: Jiri Kosina

    Chase Douglas
     

03 Sep, 2010

1 commit


02 Sep, 2010

2 commits

  • The timestamps from the device are currently stored in the private data
    structure. These aren't used, so remove them. I've left a comment
    detailing the protocol for future reference.

    Signed-off-by: Chase Douglas
    Acked-by: Michael Poole
    Signed-off-by: Jiri Kosina

    Chase Douglas
     
  • For the MT protocol, we need to properly keep track of each down touch.
    This change simplifies the logic, and should make things easier when
    support for the Magic Trackpad is added.

    Signed-off-by: Chase Douglas
    Acked-by: Michael Poole
    Signed-off-by: Jiri Kosina

    Chase Douglas
     

12 Jul, 2010

1 commit