aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hid.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2007-05-30 09:07:13 -0400
committerJiri Kosina <jkosina@suse.cz>2007-07-09 08:03:35 -0400
commit58037eb961f859607b161c50d9d4ecb374de1e8f (patch)
treec192854fa4cfc16cce272b800a0393e21429191e /include/linux/hid.h
parent7dcca30a32aadb0520417521b0c44f42d09fe05c (diff)
HID: make debugging output runtime-configurable
There have been many reports recently about broken HID devices, the diagnosis of which required users to recompile their kernels in order to be able to provide debugging output needed for coding a quirk for a particular device. This patch makes CONFIG_HID_DEBUG default y if !EMBEDDED and makes it possible to control debugging output produced by HID code by supplying 'debug=1' module parameter. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r--include/linux/hid.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 827ee748fd4c..eb53d9a9ae54 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -488,6 +488,11 @@ struct hid_descriptor {
488#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) 488#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
489 489
490/* HID core API */ 490/* HID core API */
491
492#ifdef CONFIG_HID_DEBUG
493extern int hid_debug;
494#endif
495
491extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); 496extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
492extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); 497extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
493extern int hidinput_connect(struct hid_device *); 498extern int hidinput_connect(struct hid_device *);
@@ -523,14 +528,19 @@ static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; }
523#else 528#else
524static inline int hid_ff_init(struct hid_device *hid) { return -1; } 529static inline int hid_ff_init(struct hid_device *hid) { return -1; }
525#endif 530#endif
526#ifdef DEBUG 531
527#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \ 532#ifdef CONFIG_HID_DEBUG
528 __FILE__ , ## arg) 533#define dbg_hid(format, arg...) if (hid_debug) \
534 printk(KERN_DEBUG "%s: " format ,\
535 __FILE__ , ## arg)
536#define dbg_hid_line(format, arg...) if (hid_debug) \
537 printk(format, ## arg)
529#else 538#else
530#define dbg(format, arg...) do {} while (0) 539#define dbg_hid(format, arg...) do {} while (0)
540#define dbg_hid_line dbg_hid
531#endif 541#endif
532 542
533#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ 543#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
534 __FILE__ , ## arg) 544 __FILE__ , ## arg)
535#endif 545#endif
536 546