Hi,
On 30-03-19 12:24, Hans de Goede wrote:
Most Logitech wireless keyboard and mice using the 27 MHz are hidpp10
devices, add support to logitech-dj for their receivers.
Doing so leads to 2 improvements:
1) All these devices share the same USB product-id for their receiver,
making it impossible to properly map some special keys / buttons
which differ from device to device. Adding support to logitech-dj to
see these as hidpp10 devices allows us to get the actual device-id
from the keyboard / mouse.
2) It enables battery-monitoring of these devices
Note this commits also sets up a better name for 27 MHz hidpp devices,
this is done because unlike other hidpp devices, the logitech-hidpp code
will not override the name, so having a good name is important.
Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
<snip>
@@ -592,9 +653,16 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
dj_hiddev->vendor = djrcv_hdev->vendor;
dj_hiddev->product = (workitem->quad_id_msb << 8) |
workitem->quad_id_lsb;
- snprintf(dj_hiddev->name, sizeof(dj_hiddev->name),
- "Logitech Unifying Device. Wireless PID:%04x",
- dj_hiddev->product);
+ if (djrcv_dev->type == recvr_type_27mhz) {
+ snprintf(dj_hiddev->name, sizeof(dj_hiddev->name),
+ "Logitech 27 MHz %s. Wireless PID:%04x",
+ (device_index == 1) ? "Mouse" : "Keyboard",
+ dj_hiddev->product);
+ } else {
+ snprintf(dj_hiddev->name, sizeof(dj_hiddev->name),
+ "Logitech Unifying Device. Wireless PID:%04x",
+ dj_hiddev->product);
+ }
dj_hiddev->group = HID_GROUP_LOGITECH_DJ_DEVICE;
I'm going to drop the above chunk for v2 of this patch-set, replacing
it with an extra patch which solves this in a more generic manner.
I'm seeing a similar problem while adding support for Logitech bluetooth
receivers in HID proxy mode.
This more generic solution will also allow dropping of the
"HID: logitech-hidpp: create a name based on the type if non available",
we already have the type in the DEVICE CONNECTION report we received in
hid-logitech-dj.c, so there is no need to separately query this in
logitech-hidpp.c .
Regards,
Hans