[PATCH 4/7] Input: i8042 runtime debug switch

From: Dmitry Torokhov
Date: Thu Oct 21 2004 - 02:59:12 EST



===================================================================


ChangeSet@xxxxxx, 2004-10-19 00:49:51-05:00, dtor_core@xxxxxxxxxxxxx
Input: i8042 - allow turning debugging on and off "on-fly"
so people do not have to recompile their kernels to
provide debug info.

Adds new parameter i8042.debug also accessible through
sysfs.

Signed-off-by: Dmitry Torokhov <dtor@xxxxxxx>


i8042.c | 8 +++++++-
i8042.h | 8 ++++++--
2 files changed, 13 insertions(+), 3 deletions(-)


===================================================================



diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
--- a/drivers/input/serio/i8042.c 2004-10-21 02:10:38 -05:00
+++ b/drivers/input/serio/i8042.c 2004-10-21 02:10:38 -05:00
@@ -63,6 +63,13 @@
MODULE_PARM_DESC(noacpi, "Do not use ACPI to detect controller settings");
#endif

+#define DEBUG
+#ifdef DEBUG
+static int i8042_debug;
+module_param_named(debug, i8042_debug, bool, 600);
+MODULE_PARM_DESC(debug, "Turn i8042 debugging mode on and off");
+#endif
+
__obsolete_setup("i8042_noaux");
__obsolete_setup("i8042_nomux");
__obsolete_setup("i8042_unlock");
@@ -70,7 +77,6 @@
__obsolete_setup("i8042_direct");
__obsolete_setup("i8042_dumbkbd");

-#undef DEBUG
#include "i8042.h"

spinlock_t i8042_lock = SPIN_LOCK_UNLOCKED;
diff -Nru a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h
--- a/drivers/input/serio/i8042.h 2004-10-21 02:10:38 -05:00
+++ b/drivers/input/serio/i8042.h 2004-10-21 02:10:38 -05:00
@@ -119,8 +119,12 @@
#ifdef DEBUG
static unsigned long i8042_start;
#define dbg_init() do { i8042_start = jiffies; } while (0)
-#define dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format " [%d]\n" ,\
- ## arg, (int) (jiffies - i8042_start))
+#define dbg(format, arg...) \
+ do { \
+ if (i8042_debug) \
+ printk(KERN_DEBUG __FILE__ ": " format " [%d]\n" , \
+ ## arg, (int) (jiffies - i8042_start)); \
+ } while (0)
#else
#define dbg_init() do { } while (0)
#define dbg(format, arg...) do {} while (0)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/