Skip to content

Commit

Permalink
HID: hid-debug: Show rdesc for unclaimed devices
Browse files Browse the repository at this point in the history
Since commit a7197c2, the raw report descriptor is available also for
unclaimed devices. This patchs make it show in the rdesc debugfs node.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Henrik Rydberg authored and Jiri Kosina committed Aug 27, 2012
1 parent b0be5b3 commit 8db089d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/hid/hid-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,15 +911,21 @@ static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f)

}


static int hid_debug_rdesc_show(struct seq_file *f, void *p)
{
struct hid_device *hdev = f->private;
const __u8 *rdesc = hdev->rdesc;
unsigned rsize = hdev->rsize;
int i;

if (!rdesc) {
rdesc = hdev->dev_rdesc;
rsize = hdev->dev_rsize;
}

/* dump HID report descriptor */
for (i = 0; i < hdev->rsize; i++)
seq_printf(f, "%02x ", hdev->rdesc[i]);
for (i = 0; i < rsize; i++)
seq_printf(f, "%02x ", rdesc[i]);
seq_printf(f, "\n\n");

/* dump parsed data and input mappings */
Expand Down

0 comments on commit 8db089d

Please sign in to comment.