diff options
Diffstat (limited to 'drivers/hid/hid-debug.c')
| -rw-r--r-- | drivers/hid/hid-debug.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 83c4126b37c3..a13757b78980 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c | |||
| @@ -347,6 +347,9 @@ static void resolv_usage_page(unsigned page) { | |||
| 347 | void hid_resolv_usage(unsigned usage) { | 347 | void hid_resolv_usage(unsigned usage) { |
| 348 | const struct hid_usage_entry *p; | 348 | const struct hid_usage_entry *p; |
| 349 | 349 | ||
| 350 | if (!hid_debug) | ||
| 351 | return; | ||
| 352 | |||
| 350 | resolv_usage_page(usage >> 16); | 353 | resolv_usage_page(usage >> 16); |
| 351 | printk("."); | 354 | printk("."); |
| 352 | for (p = hid_usage_table; p->description; p++) | 355 | for (p = hid_usage_table; p->description; p++) |
| @@ -369,6 +372,9 @@ __inline__ static void tab(int n) { | |||
| 369 | void hid_dump_field(struct hid_field *field, int n) { | 372 | void hid_dump_field(struct hid_field *field, int n) { |
| 370 | int j; | 373 | int j; |
| 371 | 374 | ||
| 375 | if (!hid_debug) | ||
| 376 | return; | ||
| 377 | |||
| 372 | if (field->physical) { | 378 | if (field->physical) { |
| 373 | tab(n); | 379 | tab(n); |
| 374 | printk("Physical("); | 380 | printk("Physical("); |
| @@ -466,6 +472,9 @@ void hid_dump_device(struct hid_device *device) { | |||
| 466 | unsigned i,k; | 472 | unsigned i,k; |
| 467 | static char *table[] = {"INPUT", "OUTPUT", "FEATURE"}; | 473 | static char *table[] = {"INPUT", "OUTPUT", "FEATURE"}; |
| 468 | 474 | ||
| 475 | if (!hid_debug) | ||
| 476 | return; | ||
| 477 | |||
| 469 | for (i = 0; i < HID_REPORT_TYPES; i++) { | 478 | for (i = 0; i < HID_REPORT_TYPES; i++) { |
| 470 | report_enum = device->report_enum + i; | 479 | report_enum = device->report_enum + i; |
| 471 | list = report_enum->report_list.next; | 480 | list = report_enum->report_list.next; |
| @@ -489,6 +498,9 @@ void hid_dump_device(struct hid_device *device) { | |||
| 489 | EXPORT_SYMBOL_GPL(hid_dump_device); | 498 | EXPORT_SYMBOL_GPL(hid_dump_device); |
| 490 | 499 | ||
| 491 | void hid_dump_input(struct hid_usage *usage, __s32 value) { | 500 | void hid_dump_input(struct hid_usage *usage, __s32 value) { |
| 501 | if (!hid_debug) | ||
| 502 | return; | ||
| 503 | |||
| 492 | printk("hid-debug: input "); | 504 | printk("hid-debug: input "); |
| 493 | hid_resolv_usage(usage->hid); | 505 | hid_resolv_usage(usage->hid); |
| 494 | printk(" = %d\n", value); | 506 | printk(" = %d\n", value); |
| @@ -758,6 +770,9 @@ static char **names[EV_MAX + 1] = { | |||
| 758 | 770 | ||
| 759 | void hid_resolv_event(__u8 type, __u16 code) { | 771 | void hid_resolv_event(__u8 type, __u16 code) { |
| 760 | 772 | ||
| 773 | if (!hid_debug) | ||
| 774 | return; | ||
| 775 | |||
| 761 | printk("%s.%s", events[type] ? events[type] : "?", | 776 | printk("%s.%s", events[type] ? events[type] : "?", |
| 762 | names[type] ? (names[type][code] ? names[type][code] : "?") : "?"); | 777 | names[type] ? (names[type][code] ? names[type][code] : "?") : "?"); |
| 763 | } | 778 | } |
