HID: logitech-dj: Handle quad/bluetooth keyboards with a builtin trackpad
authorHans de Goede <hdegoede@redhat.com>
Mon, 2 Nov 2020 13:36:56 +0000 (14:36 +0100)
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>
Thu, 12 Nov 2020 15:00:34 +0000 (16:00 +0100)
commitee5e58418a854755201eb4952b1230d873a457d5
treeb9bfcc6a56e0d863731336e601fa1dee1c47b60e
parentf59ee399de4a8ca4d7d19cdcabb4b63e94867f09
HID: logitech-dj: Handle quad/bluetooth keyboards with a builtin trackpad

Some quad/bluetooth keyboards, such as the Dinovo Edge (Y-RAY81) have a
builtin touchpad. In this case when asking the receiver for paired devices,
we get only 1 paired device with a device_type of REPORT_TYPE_KEYBOARD.

This means that we do not instantiate a second dj_hiddev for the mouse
(as we normally would) and thus there is no place for us to forward the
mouse input reports to, causing the touchpad part of the keyboard to not
work.

There is no way for us to detect these keyboards, so this commit adds
an array with device-ids for such keyboards and when a keyboard is on
this list it adds STD_MOUSE to the reports_supported bitmap for the
dj_hiddev created for the keyboard fixing the touchpad not working.

Using a list of device-ids for this is not ideal, but there are only
very few such keyboards so this should be fine. Besides the Dinovo Edge,
other known wireless Logitech keyboards with a builtin touchpad are:

* Dinovo Mini (TODO add its device-id to the list)
* K400 (uses a unifying receiver so is not affected)
* K600 (uses a unifying receiver so is not affected)

Cc: stable@vger.kernel.org
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1811424
Fixes: f2113c3020ef ("HID: logitech-dj: add support for Logitech Bluetooth Mini-Receiver")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
drivers/hid/hid-logitech-dj.c