Re: Logitech M705 thumb button

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

 



On Tue, 30 Mar 2010, Octoploid wrote:

> > Could you please provide output of
> >
> >        cat /sys/kernel/debug/hid/<device>/rdesc
> >
> > and
> >
> >        cat /sys/kernel/debug/hid/<device>/events
> >
> 
> Sure:
> 
> There are no events logged when I press the thumb button
> while running cat /sys/kernel/debug/hid/0003:046D:C52B.0002/events.
> 
> (The »unifying USB reciever« has three sub-devices. The first one is
> for keyboards, the second for mouses and the third is not used:
> usb 3-1: new full speed USB device using ohci_hcd and address 2
> input: Logitech USB Receiver as
> /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/input/input2
> generic-usb 0003:046D:C52B.0001: input,hidraw0: USB HID v1.11 Keyboard
> [Logitech USB Receiver] on usb-0000:00:12.0-1/input0
> input: Logitech USB Receiver as
> /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.1/input/input3
> generic-usb 0003:046D:C52B.0002: input,hiddev96,hidraw1: USB HID v1.11
> Mouse [Logitech USB Receiver] on usb-0000:00:12.0-1/input1
> generic-usb 0003:046D:C52B.0003: hiddev97,hidraw2: USB HID v1.11
> Device [Logitech USB Receiver] on usb-0000:00:12.0-1/input2)
> 
> The rdesc output for the mouse and the third device follows:

Thanks for providing the output.

The device defines 16 buttons in its report descriptor. How much does it 
actually physically have?

Is the other (non-used) interface also silent when you press the 
non-working button? (I can see that it is claimed by HID as well).

Could you please apply the patch below and check whether there is still no 
event present when you press the button?

Thanks.



>From 1caea61eda5c4d446147aa0e712ba395bb6b81c3 Mon Sep 17 00:00:00 2001
From: Jiri Kosina <jkosina@xxxxxxx>
Date: Thu, 18 Mar 2010 12:09:53 +0100
Subject: [PATCH] HID: output event in debugfs even if hid_get_report() fails

if hid_get_report() fails for whatever reason, the raw output of
the report doesn't make it into 'events' file in debugfs at all, because
we leave hid_input_report() too soon.

We want the report to be always present for debugging reasons. Move the
code around, so that the event makes it to 'events' file all the time,
even if we are going to discard the report.

Signed-off-by: Jiri Kosina <jkosina@xxxxxxx>
---
 drivers/hid/hid-core.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 368fbb0..c49aaa2 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1096,20 +1096,11 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
 		goto nomem;
 	}
 
-	snprintf(buf, HID_DEBUG_BUFSIZE - 1,
-			"\nreport (size %u) (%snumbered)\n", size, report_enum->numbered ? "" : "un");
-	hid_debug_event(hid, buf);
-
-	report = hid_get_report(report_enum, data);
-	if (!report) {
-		kfree(buf);
-		return -1;
-	}
-
 	/* dump the report */
 	snprintf(buf, HID_DEBUG_BUFSIZE - 1,
-			"report %d (size %u) = ", report->id, size);
+			"\nreport (size %u) (%snumbered) = ", size, report_enum->numbered ? "" : "un");
 	hid_debug_event(hid, buf);
+
 	for (i = 0; i < size; i++) {
 		snprintf(buf, HID_DEBUG_BUFSIZE - 1,
 				" %02x", data[i]);
@@ -1117,6 +1108,13 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
 	}
 	hid_debug_event(hid, "\n");
 
+	report = hid_get_report(report_enum, data);
+
+	if (!report) {
+		kfree(buf);
+		return -1;
+	}
+
 	kfree(buf);
 
 nomem:
-- 
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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