mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
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>
This commit is contained in:
parent
7dcca30a32
commit
58037eb961
12 changed files with 122 additions and 107 deletions
|
@ -488,6 +488,11 @@ struct hid_descriptor {
|
|||
#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
|
||||
|
||||
/* HID core API */
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
extern int hid_debug;
|
||||
#endif
|
||||
|
||||
extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
|
||||
extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
|
||||
extern int hidinput_connect(struct hid_device *);
|
||||
|
@ -523,14 +528,19 @@ static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; }
|
|||
#else
|
||||
static inline int hid_ff_init(struct hid_device *hid) { return -1; }
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
#define dbg_hid(format, arg...) if (hid_debug) \
|
||||
printk(KERN_DEBUG "%s: " format ,\
|
||||
__FILE__ , ## arg)
|
||||
#define dbg_hid_line(format, arg...) if (hid_debug) \
|
||||
printk(format, ## arg)
|
||||
#else
|
||||
#define dbg(format, arg...) do {} while (0)
|
||||
#define dbg_hid(format, arg...) do {} while (0)
|
||||
#define dbg_hid_line dbg_hid
|
||||
#endif
|
||||
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
|
||||
#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue