Skip to content

Commit cf58cd9

Browse files
jwrdegoedeksacilotto
authored andcommitted
HID: logitech-dj: Fix Dinovo Mini when paired with a MX5x00 receiver
BugLink: https://bugs.launchpad.net/bugs/1908561 [ Upstream commit b4c00e7 ] Some users are pairing the Dinovo keyboards with the MX5000 or MX5500 receivers, instead of with the Dinovo receivers. The receivers are mostly the same (and the air protocol obviously is compatible) but currently the Dinovo receivers are handled by hid-lg.c while the MX5x00 receivers are handled by logitech-dj.c. When using a Dinovo keyboard, with its builtin touchpad, through logitech-dj.c then the touchpad stops working because when asking the receiver for paired devices, we get only 1 paired device with a device_type of REPORT_TYPE_KEYBOARD. And since we don't see a paired mouse, we have nowhere to send mouse-events to, so we drop them. Extend the existing fix for the Dinovo Edge for this to also cover the Dinovo Mini keyboard and also add a mapping to logitech-hidpp for the Media key on the Dinovo Mini, so that that keeps working too. 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 d6f5011 commit cf58cd9

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

drivers/hid/hid-logitech-dj.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ static void logi_dj_recv_queue_notification(struct dj_receiver_dev *djrcv_dev,
875875
*/
876876
static const u16 kbd_builtin_touchpad_ids[] = {
877877
0xb309, /* Dinovo Edge */
878+
0xb30c, /* Dinovo Mini */
878879
};
879880

880881
static void logi_hidpp_dev_conn_notif_equad(struct hid_device *hdev,

drivers/hid/hid-logitech-hidpp.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ MODULE_PARM_DESC(disable_tap_to_click,
8888
#define HIDPP_CAPABILITY_BATTERY_MILEAGE BIT(2)
8989
#define HIDPP_CAPABILITY_BATTERY_LEVEL_STATUS BIT(3)
9090

91+
#define lg_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c))
92+
9193
/*
9294
* There are two hidpp protocols in use, the first version hidpp10 is known
9395
* as register access protocol or RAP, the second version hidpp20 is known as
@@ -2768,6 +2770,26 @@ static int g920_get_config(struct hidpp_device *hidpp,
27682770
return g920_ff_set_autocenter(hidpp, data);
27692771
}
27702772

2773+
/* -------------------------------------------------------------------------- */
2774+
/* Logitech Dinovo Mini keyboard with builtin touchpad */
2775+
/* -------------------------------------------------------------------------- */
2776+
#define DINOVO_MINI_PRODUCT_ID 0xb30c
2777+
2778+
static int lg_dinovo_input_mapping(struct hid_device *hdev, struct hid_input *hi,
2779+
struct hid_field *field, struct hid_usage *usage,
2780+
unsigned long **bit, int *max)
2781+
{
2782+
if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
2783+
return 0;
2784+
2785+
switch (usage->hid & HID_USAGE) {
2786+
case 0x00d: lg_map_key_clear(KEY_MEDIA); break;
2787+
default:
2788+
return 0;
2789+
}
2790+
return 1;
2791+
}
2792+
27712793
/* -------------------------------------------------------------------------- */
27722794
/* HID++1.0 devices which use HID++ reports for their wheels */
27732795
/* -------------------------------------------------------------------------- */
@@ -3003,6 +3025,9 @@ static int hidpp_input_mapping(struct hid_device *hdev, struct hid_input *hi,
30033025
field->application != HID_GD_MOUSE)
30043026
return m560_input_mapping(hdev, hi, field, usage, bit, max);
30053027

3028+
if (hdev->product == DINOVO_MINI_PRODUCT_ID)
3029+
return lg_dinovo_input_mapping(hdev, hi, field, usage, bit, max);
3030+
30063031
return 0;
30073032
}
30083033

0 commit comments

Comments
 (0)