HID: logitech-hidpp: Don't use the USB serial for USB devices
authorBastien Nocera <hadess@hadess.net>
Thu, 2 Mar 2023 13:01:16 +0000 (14:01 +0100)
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>
Mon, 3 Apr 2023 11:29:06 +0000 (13:29 +0200)
commit7ad1fe0da0fa91bf920b79ab05ae97bfabecc4f4
treef19c9a77f994cb40b735c6813de2f5a6698e6030
parent2653e3fe33f411227296552b2e5f9c2640924900
HID: logitech-hidpp: Don't use the USB serial for USB devices

For devices that support the 0x0003 feature (Device Information) version 4,
set the serial based on the output of that feature, rather than relying
on the usbhid code setting the USB serial.

This should allow the serial when connected through USB to (nearly)
match the one when connected through a unifying receiver.

For example, on the serials on a G903 wired/wireless mouse:
- Unifying: 4067-e8-ce-cd-45
- USB before patch: 017C385C3837
- USB after patch: c086-e8-ce-cd-45

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Link: https://lore.kernel.org/r/20230302130117.3975-1-hadess@hadess.net
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
drivers/hid/hid-logitech-hidpp.c