Skip to content

Commit b4c00e7

Browse files
jwrdegoedebentiss
authored andcommitted
HID: logitech-dj: Fix Dinovo Mini when paired with a MX5x00 receiver
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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent eec231e commit b4c00e7

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
@@ -93,6 +93,8 @@ MODULE_PARM_DESC(disable_tap_to_click,
9393
#define HIDPP_CAPABILITY_BATTERY_LEVEL_STATUS BIT(3)
9494
#define HIDPP_CAPABILITY_BATTERY_VOLTAGE BIT(4)
9595

96+
#define lg_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c))
97+
9698
/*
9799
* There are two hidpp protocols in use, the first version hidpp10 is known
98100
* as register access protocol or RAP, the second version hidpp20 is known as
@@ -2950,6 +2952,26 @@ static int g920_get_config(struct hidpp_device *hidpp,
29502952
return g920_ff_set_autocenter(hidpp, data);
29512953
}
29522954

2955+
/* -------------------------------------------------------------------------- */
2956+
/* Logitech Dinovo Mini keyboard with builtin touchpad */
2957+
/* -------------------------------------------------------------------------- */
2958+
#define DINOVO_MINI_PRODUCT_ID 0xb30c
2959+
2960+
static int lg_dinovo_input_mapping(struct hid_device *hdev, struct hid_input *hi,
2961+
struct hid_field *field, struct hid_usage *usage,
2962+
unsigned long **bit, int *max)
2963+
{
2964+
if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
2965+
return 0;
2966+
2967+
switch (usage->hid & HID_USAGE) {
2968+
case 0x00d: lg_map_key_clear(KEY_MEDIA); break;
2969+
default:
2970+
return 0;
2971+
}
2972+
return 1;
2973+
}
2974+
29532975
/* -------------------------------------------------------------------------- */
29542976
/* HID++1.0 devices which use HID++ reports for their wheels */
29552977
/* -------------------------------------------------------------------------- */
@@ -3185,6 +3207,9 @@ static int hidpp_input_mapping(struct hid_device *hdev, struct hid_input *hi,
31853207
field->application != HID_GD_MOUSE)
31863208
return m560_input_mapping(hdev, hi, field, usage, bit, max);
31873209

3210+
if (hdev->product == DINOVO_MINI_PRODUCT_ID)
3211+
return lg_dinovo_input_mapping(hdev, hi, field, usage, bit, max);
3212+
31883213
return 0;
31893214
}
31903215

0 commit comments

Comments
 (0)