OSDN Git Service

HID: core: process the Resolution Multiplier
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 5 Dec 2018 00:42:23 +0000 (10:42 +1000)
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>
Fri, 7 Dec 2018 15:27:13 +0000 (16:27 +0100)
commit5a4abb36f312cf83206b1b7d1308ba47cba0b3cc
tree928db9e1b26c88b5bda3247ebdf3b8858628c88b
parentc53431eb696f3c64c12c00afb81048af54b61532
HID: core: process the Resolution Multiplier

The Resolution Multiplier is a feature report that modifies the value of
Usages within the same Logical Collection. If the multiplier is set to
anything but 1, the hardware reports (value * multiplier) for the same amount
of physical movement, i.e. the value we receive in the kernel is
pre-multiplied.

The hardware may either send a single (value * multiplier), or by sending
multiplier as many reports with the same value, or a combination of these two
options. For example, when the Microsoft Sculpt Ergonomic mouse Resolution
Multiplier is set to 12, the Wheel sends out 12 for every detent but AC Pan
sends out a value of 3 at 4 times the frequency.

The effective multiplier is based on the physical min/max of the multiplier
field, a logical min/max of [0,1] with a physical min/max of [1,8] means the
multiplier is either 1 or 8.

The Resolution Multiplier was introduced for high-resolution scrolling in
Windows Vista and is commonly used on Microsoft mice.

The recommendation for the Resolution Multiplier is to default to 1 for
backwards compatibility. This patch adds an arbitrary upper limit at 255. The
only known use case for the Resolution Multiplier is for scroll wheels where the
multiplier has to be a fraction of 120 to work with Windows.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Verified-by: Harry Cutts <hcutts@chromium.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
drivers/hid/hid-core.c
include/linux/hid.h