Add patches accepted for 2.6.22-rc1 (not released yet)
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.22-rc1 / 0022-ACPI-thinkpad-acpi-improve-thinkpad-detection.patch
blob5af406a9f9ca81a760157c8738eb6a496b8f60f4
1 From 0dcef77c5b889338811d35e786b42046259fe433 Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Sat, 21 Apr 2007 11:08:34 -0300
4 Subject: ACPI: thinkpad-acpi: improve thinkpad detection
6 Improve the detection of ThinkPads, so as to reduce the chances of false
7 positives.
9 Since this could potentially add false negatives on the very old models,
10 add a module parameter to force the detection of a thinkpad.
12 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
13 Signed-off-by: Len Brown <len.brown@intel.com>
14 ---
15 Documentation/thinkpad-acpi.txt | 7 +++++++
16 drivers/misc/thinkpad_acpi.c | 13 +++++++++++++
17 drivers/misc/thinkpad_acpi.h | 1 +
18 3 files changed, 21 insertions(+), 0 deletions(-)
20 diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt
21 index 20d5ec3..1a42b77 100644
22 --- a/Documentation/thinkpad-acpi.txt
23 +++ b/Documentation/thinkpad-acpi.txt
24 @@ -716,3 +716,10 @@ to enable more than one output class, just add their values.
26 There is also a kernel build option to enable more debugging
27 information, which may be necessary to debug driver problems.
29 +Force loading of module
30 +-----------------------
32 +If thinkpad-acpi refuses to detect your ThinkPad, you can try to specify
33 +the module parameter force_load=1. Regardless of whether this works or
34 +not, please contact ibm-acpi-devel@lists.sourceforge.net with a report.
35 diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
36 index 5611268..cddf81b 100644
37 --- a/drivers/misc/thinkpad_acpi.c
38 +++ b/drivers/misc/thinkpad_acpi.c
39 @@ -2881,6 +2881,16 @@ static int __init probe_for_thinkpad(void)
40 return -ENODEV;
43 + /*
44 + * Risks a regression on very old machines, but reduces potential
45 + * false positives a damn great deal
46 + */
47 + if (!is_thinkpad)
48 + is_thinkpad = dmi_name_in_vendors("IBM");
50 + if (!is_thinkpad && !force_load)
51 + return -ENODEV;
53 return 0;
56 @@ -2986,6 +2996,9 @@ module_param(experimental, int, 0);
57 static u32 dbg_level;
58 module_param_named(debug, dbg_level, uint, 0);
60 +static int force_load;
61 +module_param(force_load, int, 0);
63 #define IBM_PARAM(feature) \
64 module_param_call(feature, set_ibm_param, NULL, NULL, 0)
66 diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
67 index 97467b7..2020398 100644
68 --- a/drivers/misc/thinkpad_acpi.h
69 +++ b/drivers/misc/thinkpad_acpi.h
70 @@ -128,6 +128,7 @@ static char *next_cmd(char **cmds);
71 /* Module */
72 static int experimental;
73 static u32 dbg_level;
74 +static int force_load;
75 static char *ibm_thinkpad_ec_found;
77 static char* check_dmi_for_ec(void);
78 --
79 1.5.1