Skip to content

Commit d6f5011

Browse files
jwrdegoedeksacilotto
authored andcommitted
HID: logitech-dj: Handle quad/bluetooth keyboards with a builtin trackpad
BugLink: https://bugs.launchpad.net/bugs/1908561 [ Upstream commit ee5e584 ] 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: f2113c3 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Ian May <ian.may@canonical.com>
1 parent a8892b7 commit d6f5011

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/hid/hid-logitech-dj.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,11 +866,23 @@ static void logi_dj_recv_queue_notification(struct dj_receiver_dev *djrcv_dev,
866866
schedule_work(&djrcv_dev->work);
867867
}
868868

869+
/*
870+
* Some quad/bluetooth keyboards have a builtin touchpad in this case we see
871+
* only 1 paired device with a device_type of REPORT_TYPE_KEYBOARD. For the
872+
* touchpad to work we must also forward mouse input reports to the dj_hiddev
873+
* created for the keyboard (instead of forwarding them to a second paired
874+
* device with a device_type of REPORT_TYPE_MOUSE as we normally would).
875+
*/
876+
static const u16 kbd_builtin_touchpad_ids[] = {
877+
0xb309, /* Dinovo Edge */
878+
};
879+
869880
static void logi_hidpp_dev_conn_notif_equad(struct hid_device *hdev,
870881
struct hidpp_event *hidpp_report,
871882
struct dj_workitem *workitem)
872883
{
873884
struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
885+
int i, id;
874886

875887
workitem->type = WORKITEM_TYPE_PAIRED;
876888
workitem->device_type = hidpp_report->params[HIDPP_PARAM_DEVICE_INFO] &
@@ -882,6 +894,13 @@ static void logi_hidpp_dev_conn_notif_equad(struct hid_device *hdev,
882894
workitem->reports_supported |= STD_KEYBOARD | MULTIMEDIA |
883895
POWER_KEYS | MEDIA_CENTER |
884896
HIDPP;
897+
id = (workitem->quad_id_msb << 8) | workitem->quad_id_lsb;
898+
for (i = 0; i < ARRAY_SIZE(kbd_builtin_touchpad_ids); i++) {
899+
if (id == kbd_builtin_touchpad_ids[i]) {
900+
workitem->reports_supported |= STD_MOUSE;
901+
break;
902+
}
903+
}
885904
break;
886905
case REPORT_TYPE_MOUSE:
887906
workitem->reports_supported |= STD_MOUSE | HIDPP;

0 commit comments

Comments
 (0)