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

2 commits

  • The X and Y values have two more significant bits in the same byte
    that contains click status. Include these in the reported value.
    Thanks to Iain Hibbert of NetBSD for pointing this out.

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

    Michael Poole
     
  • The evdev multitouch protocol requires that a last MT sync event must be
    sent after all touches are up. This change adds the last MT sync event
    to the hid-magicmouse driver.

    Also, don't send events when a touch leaves.

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

    Chase Douglas
     

24 Jun, 2010

3 commits

  • Mimicks OS X behavior.

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

    Chase Douglas
     
  • The new scroll_speed param takes an integer value from 0 to 63, where 0
    is slowest and 63 is fastest. The default of 32 remains the same. This
    parameter also affects scroll acceleration linearly.

    A second part of this change is a tightly coupled modification to the
    scroll acceleration. Previously, scroll acceleration could be reset
    without lifting the scroll finger. This is rather unintuitive and hard
    to control in the case where a user wants faster scrolling, but wants to
    hold the scroll touch for longer than a moment.

    Note that scroll acceleration levels are now 1-7, where 7 is slowest. In
    the previous implementation, there were 8 levels defined, but it was
    impossible to start at the slowest level. In order to keep the default
    scroll speed unchanged, only 7 levels are used now.

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

    Chase Douglas
     
  • Before this change, sequential scroll events would take a variable
    amount of movement due to incorrect accounting. This change ensures all
    scroll movements require a deterministic touch movement for an action to
    occur.

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

    Chase Douglas
     

04 Jun, 2010

2 commits


12 May, 2010

1 commit

  • When HIDRAW is not set, hid_hw_start() returns ENODEV as no subsystem has
    claimed the magicmouse device, and probe routine bails out. Which is not what we want.

    This happens because magicmouse driver is instantiating the connection to
    Input subsystem itself, and since commit 28918c211d86b ("HID: magicmouse: fix
    oops after device removal") the HID core is not registering input device
    itself.

    Fix this by letting HID core register the input device (so that hid_hw_start()
    succeeds, as the device is claimed by at least one subsystem) and de-register
    it again later before proceeding with proper input setup.

    Reported-by: Justin P. Mattock
    Signed-off-by: Jiri Kosina

    Jiri Kosina
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

09 Mar, 2010

1 commit


11 Feb, 2010

1 commit

  • Use proper values to initialize bool configuration variables, tabs rather than
    spaces, no braces for one-line else clause, __set_bit() when the operation
    doesn't have to be atomic, input_set_abs_params() rather than writing the
    fields directly, and call hid_hw_stop() when appropriate to handle failures in
    the probe.

    Signed-off-by: Michael Poole
    Signed-off-by: Jiri Kosina

    Michael Poole
     

10 Feb, 2010

1 commit

  • The Magic Mouse requires that a driver send an unlock Report(Feature) command,
    similar to the Wacom wireless tablet and Sixaxis controller quirks. This turns
    on an Input Report that isn't published in the input Report descriptor that
    contains touch data (and usually overrides the normal motion and click Report).

    Because the mouse has only one switch and no scroll wheel, the driver
    (under control of parameters) emulates a middle button and scroll wheel.
    User space could also ignore and/or re-synthesize those events based on
    the reported events.

    Some user-space tools to talk to the mouse directly (that is, when it is not
    associated with the host's HIDP stack) are at
    http://github.com/entrope/linux-magicmouse

    Signed-off-by: Michael Poole
    Signed-off-by: Jiri Kosina

    Michael Poole