HID: logitech-hidpp: add support for HID++ 1.0 wheel reports
authorHans de Goede <hdegoede@redhat.com>
Sat, 20 Apr 2019 11:22:15 +0000 (13:22 +0200)
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>
Tue, 23 Apr 2019 16:03:05 +0000 (18:03 +0200)
commit4a79bcc64a0514d630783b8d19cf9a85e46fe988
treed5353e382531127601a261d5991337ff2c74b6df
parent35839f77238bccb695696bb390732339d53b8062
HID: logitech-hidpp: add support for HID++ 1.0 wheel reports

Add a quirk for switching wheel event reporting to using the HID++
report for this.

This has 2 advantages:
1) Without this tilting the scrollwheel left / right will send a
   scroll-lock + cursor-left/-right + scroll-lock key-sequence instead of
   hwheel events

2) The HID++ reports contain the device index instead of using the generic
   HID implementation, so this will make scroll-wheel events from the wheel
   on some keyboards be emitted by the right event node.

2. also fixes keyboard scroll-wheel events getting lost in the (mostly
theoretical) case of there not being a mouse paired with the receiver.

This commit enables this quirk for all 27Mhz mice, it cannot hurt to have
it enabled and this avoids the need to keep adding more and more quirks for
this. This has been tested in 5 different 27MHz mice, 3 of which have a
wheel which can tilt.

This commit also adds explicit quirks for 3 keyboards with a zoom-/scroll-
wheel. The MX3000 keyboard scroll-wheel can also tilt. I've defined aliases
to the new HIDPP_QUIRK_HIDPP_WHEELS for this, so that it is clear why the
keyboard has the quirk and in case we want to handle the keyboard wheels
and especially the keyboard zoom-wheels differently in the future.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
drivers/hid/hid-logitech-hidpp.c