aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid/hid-zpff.c
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 /drivers/hid/usbhid/hid-zpff.c
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 'drivers/hid/usbhid/hid-zpff.c')
-rw-r--r--drivers/hid/usbhid/hid-zpff.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/hid/usbhid/hid-zpff.c b/drivers/hid/usbhid/hid-zpff.c
index a7fbffcdaf36..5a688274f6a3 100644
--- a/drivers/hid/usbhid/hid-zpff.c
+++ b/drivers/hid/usbhid/hid-zpff.c
@@ -21,10 +21,6 @@
21 */ 21 */
22 22
23 23
24/* #define DEBUG */
25
26#define debug(format, arg...) pr_debug("hid-zpff: " format "\n" , ## arg)
27
28#include <linux/input.h> 24#include <linux/input.h>
29#include <linux/usb.h> 25#include <linux/usb.h>
30#include <linux/hid.h> 26#include <linux/hid.h>
@@ -49,14 +45,14 @@ static int hid_zpff_play(struct input_dev *dev, void *data,
49 45
50 left = effect->u.rumble.strong_magnitude; 46 left = effect->u.rumble.strong_magnitude;
51 right = effect->u.rumble.weak_magnitude; 47 right = effect->u.rumble.weak_magnitude;
52 debug("called with 0x%04x 0x%04x", left, right); 48 dbg_hid("called with 0x%04x 0x%04x\n", left, right);
53 49
54 left = left * 0x7f / 0xffff; 50 left = left * 0x7f / 0xffff;
55 right = right * 0x7f / 0xffff; 51 right = right * 0x7f / 0xffff;
56 52
57 zpff->report->field[2]->value[0] = left; 53 zpff->report->field[2]->value[0] = left;
58 zpff->report->field[3]->value[0] = right; 54 zpff->report->field[3]->value[0] = right;
59 debug("running with 0x%02x 0x%02x", left, right); 55 dbg_hid("running with 0x%02x 0x%02x\n", left, right);
60 usbhid_submit_report(hid, zpff->report, USB_DIR_OUT); 56 usbhid_submit_report(hid, zpff->report, USB_DIR_OUT);
61 57
62 return 0; 58 return 0;