aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2007-04-21 10:08:30 -0400
committerLen Brown <len.brown@intel.com>2007-04-21 23:30:33 -0400
commit132ce09123755ec5e3d3a8ae22f4f753c3baac97 (patch)
treed5ed5b7216cf0743efe6659da74877fffbda866d
parentf51d1a39840ae5e8678d702ab57377c611fc3826 (diff)
ACPI: thinkpad-acpi: add debug mode
Add a debug mode parameter and verbose debug mode Kconfig option. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--Documentation/thinkpad-acpi.txt13
-rw-r--r--drivers/misc/Kconfig10
-rw-r--r--drivers/misc/thinkpad_acpi.c3
-rw-r--r--drivers/misc/thinkpad_acpi.h13
4 files changed, 39 insertions, 0 deletions
diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt
index af18d294cf1a..82fd8228fd41 100644
--- a/Documentation/thinkpad-acpi.txt
+++ b/Documentation/thinkpad-acpi.txt
@@ -699,3 +699,16 @@ for example:
699 699
700 modprobe thinkpad_acpi hotkey=enable,0xffff video=auto_disable 700 modprobe thinkpad_acpi hotkey=enable,0xffff video=auto_disable
701 701
702Enabling debugging output
703-------------------------
704
705The module takes a debug paramater which can be used to selectively
706enable various classes of debugging output, for example:
707
708 modprobe ibm_acpi debug=0xffff
709
710will enable all debugging output classes. It takes a bitmask, so
711to enable more than one output class, just add their values.
712
713There is also a kernel build option to enable more debugging
714information, which may be necessary to debug driver problems.
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 2cd96a3dff54..44e4c8fb7a74 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -137,6 +137,16 @@ config THINKPAD_ACPI
137 137
138 If you have an IBM or Lenovo ThinkPad laptop, say Y or M here. 138 If you have an IBM or Lenovo ThinkPad laptop, say Y or M here.
139 139
140config THINKPAD_ACPI_DEBUG
141 bool "Verbose debug mode"
142 depends on THINKPAD_ACPI
143 default n
144 ---help---
145 Enables extra debugging information, at the expense of a slightly
146 increase in driver size.
147
148 If you are not sure, say N here.
149
140config THINKPAD_ACPI_DOCK 150config THINKPAD_ACPI_DOCK
141 bool "Legacy Docking Station Support" 151 bool "Legacy Docking Station Support"
142 depends on THINKPAD_ACPI 152 depends on THINKPAD_ACPI
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 4131a7875ad7..7fa906fd45c0 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -2684,6 +2684,9 @@ static int __init set_ibm_param(const char *val, struct kernel_param *kp)
2684static int experimental; 2684static int experimental;
2685module_param(experimental, int, 0); 2685module_param(experimental, int, 0);
2686 2686
2687static u32 dbg_level;
2688module_param_named(debug, dbg_level, uint, 0);
2689
2687#define IBM_PARAM(feature) \ 2690#define IBM_PARAM(feature) \
2688 module_param_call(feature, set_ibm_param, NULL, NULL, 0) 2691 module_param_call(feature, set_ibm_param, NULL, NULL, 0)
2689 2692
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
index 02a297e0525f..b2348d7a07c4 100644
--- a/drivers/misc/thinkpad_acpi.h
+++ b/drivers/misc/thinkpad_acpi.h
@@ -74,6 +74,18 @@
74#define enabled(status,bit) ((status) & (1 << (bit)) ? "enabled" : "disabled") 74#define enabled(status,bit) ((status) & (1 << (bit)) ? "enabled" : "disabled")
75#define strlencmp(a,b) (strncmp((a), (b), strlen(b))) 75#define strlencmp(a,b) (strncmp((a), (b), strlen(b)))
76 76
77/* Debugging */
78#define TPACPI_DBG_ALL 0xffff
79#define dbg_printk(a_dbg_level, format, arg...) \
80 do { if (dbg_level & a_dbg_level) \
81 printk(IBM_DEBUG "%s: " format, __func__ , ## arg); } while (0)
82#ifdef CONFIG_THINKPAD_ACPI_DEBUG
83#define vdbg_printk(a_dbg_level, format, arg...) \
84 dbg_printk(a_dbg_level, format, ## arg)
85#else
86#define vdbg_printk(a_dbg_level, format, arg...)
87#endif
88
77/* ACPI HIDs */ 89/* ACPI HIDs */
78#define IBM_HKEY_HID "IBM0068" 90#define IBM_HKEY_HID "IBM0068"
79#define IBM_PCI_HID "PNP0A03" 91#define IBM_PCI_HID "PNP0A03"
@@ -112,6 +124,7 @@ static char *next_cmd(char **cmds);
112 124
113/* Module */ 125/* Module */
114static int experimental; 126static int experimental;
127static u32 dbg_level;
115static char *ibm_thinkpad_ec_found; 128static char *ibm_thinkpad_ec_found;
116 129
117static char* check_dmi_for_ec(void); 130static char* check_dmi_for_ec(void);