diff options
author | Henrik Rydberg <rydberg@bitmath.se> | 2012-08-21 14:22:44 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-08-27 11:01:21 -0400 |
commit | 8db089d1b08209c04cd130e49fa4796b5513ce7f (patch) | |
tree | 6223490bd6bbbd60dde6cbe3ac25c17e39a6dce0 /drivers/hid/hid-debug.c | |
parent | b0be5b3bac6376ea55bfcbac04cc521428043742 (diff) |
HID: hid-debug: Show rdesc for unclaimed devices
Since commit a7197c2e, 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>
Diffstat (limited to 'drivers/hid/hid-debug.c')
-rw-r--r-- | drivers/hid/hid-debug.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 01dd9a7daf7a..933fff0fff1f 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c | |||
@@ -911,15 +911,21 @@ static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f) | |||
911 | 911 | ||
912 | } | 912 | } |
913 | 913 | ||
914 | |||
915 | static int hid_debug_rdesc_show(struct seq_file *f, void *p) | 914 | static int hid_debug_rdesc_show(struct seq_file *f, void *p) |
916 | { | 915 | { |
917 | struct hid_device *hdev = f->private; | 916 | struct hid_device *hdev = f->private; |
917 | const __u8 *rdesc = hdev->rdesc; | ||
918 | unsigned rsize = hdev->rsize; | ||
918 | int i; | 919 | int i; |
919 | 920 | ||
921 | if (!rdesc) { | ||
922 | rdesc = hdev->dev_rdesc; | ||
923 | rsize = hdev->dev_rsize; | ||
924 | } | ||
925 | |||
920 | /* dump HID report descriptor */ | 926 | /* dump HID report descriptor */ |
921 | for (i = 0; i < hdev->rsize; i++) | 927 | for (i = 0; i < rsize; i++) |
922 | seq_printf(f, "%02x ", hdev->rdesc[i]); | 928 | seq_printf(f, "%02x ", rdesc[i]); |
923 | seq_printf(f, "\n\n"); | 929 | seq_printf(f, "\n\n"); |
924 | 930 | ||
925 | /* dump parsed data and input mappings */ | 931 | /* dump parsed data and input mappings */ |