Re: [PATCH v4] HID: logitech-dj: Add support for a new lightspeed receiver iteration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2025-09-09 02.59, Stuart wrote:
> What does logitech-dj do differently to the generic HID driver around the LEDs?
> The caps lock LED works perfectly fine with the generic driver.
> 
> If that goes nowhere, surely I could do a packet capture from Linux, with and
> without the logitech-dj driver active?
> 
> Stuart

Since the first diff you tested was supposed to send the exact same 
report as the generic hid driver, I incorrectly came to the conclusion 
that the Logitech kernel driver must be doing something different.

Turns out the report ID was being forced to 0 when it should have been 1.

Can you try applying the following?

diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 00a975b70f59..9b3b00d69079 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -78,6 +78,7 @@
 #define REPORT_TYPE_SYSTEM_CONTROL		0x04
 #define REPORT_TYPE_MEDIA_CENTER		0x08
 #define REPORT_TYPE_LEDS			0x0E
+#define REPORT_TYPE_LEDS_LIGHTSPEED		0x01
 
 /* RF Report types bitfield */
 #define STD_KEYBOARD				BIT(1)
@@ -1455,16 +1456,28 @@ static int logi_dj_ll_raw_request(struct hid_device *hid,
 				count, report_type, reqtype);
 	}
 
-	if (buf[0] != REPORT_TYPE_LEDS)
-		return -EINVAL;
+	/* This Lightspeed receiver type uses a different LED report ID */
+	if (djrcv_dev->type == recvr_type_gaming_hidpp_ls_1_3) {
+		if (buf[0] != REPORT_TYPE_LEDS_LIGHTSPEED)
+			return -EINVAL;
+	} else {
+		if (buf[0] != REPORT_TYPE_LEDS)
+			return -EINVAL;
+	}
 
 	if (djrcv_dev->type != recvr_type_dj && count >= 2) {
+		unsigned char reportnum_led = 0;
 		if (!djrcv_dev->keyboard) {
 			hid_warn(hid, "Received REPORT_TYPE_LEDS request before the keyboard interface was enumerated\n");
 			return 0;
 		}
+
+		/* This Lightspeed receiver expects LED reports with the ID defined in the HID descriptor */
+		if (djrcv_dev->type == recvr_type_gaming_hidpp_ls_1_3)
+			reportnum_led = reportnum;
+
 		/* usbhid overrides the report ID and ignores the first byte */
-		return hid_hw_raw_request(djrcv_dev->keyboard, 0, buf, count,
+		return hid_hw_raw_request(djrcv_dev->keyboard, reportnum_led, buf, count,
 					  report_type, reqtype);
 	}
 







[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux