Add patches accepted for 2.6.26-rc1
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.24-rc4 / 0003-ACPI-thinkpad-acpi-add-brightness_force-parameter.patch
blob5f439b70156693a150494031a6796789b7f075b7
1 From 87cc537a54fc017d998cf603f5fab9ca4a85d668 Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Tue, 30 Oct 2007 18:02:07 -0200
4 Subject: [PATCH 18/23] ACPI: thinkpad-acpi: add brightness_force parameter
6 Add a "brightness_enable" module parameter that allows the local admin to
7 force the backlight support to not be enabled.
9 It can also be used to force the backlight support to be enabled, but that
10 is currently a no-op as the backlight support is enabled by default when
11 available. This will be changed by a different patch.
13 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
14 Signed-off-by: Len Brown <len.brown@intel.com>
15 ---
16 Documentation/thinkpad-acpi.txt | 4 ++++
17 drivers/misc/thinkpad_acpi.c | 9 +++++++++
18 drivers/misc/thinkpad_acpi.h | 1 +
19 3 files changed, 14 insertions(+), 0 deletions(-)
21 diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt
22 index a743bfa..f877c13 100644
23 --- a/Documentation/thinkpad-acpi.txt
24 +++ b/Documentation/thinkpad-acpi.txt
25 @@ -944,6 +944,10 @@ When display backlight brightness controls are available through the
26 standard ACPI interface, it is best to use it instead of this direct
27 ThinkPad-specific interface.
29 +The brightness_enable module parameter can be used to control whether
30 +the LCD brightness control feature will be enabled when available.
31 +brightness_enable=0 forces it to be disabled.
33 Procfs notes:
35 The available commands are:
36 diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
37 index 322ba25..56a21e6 100644
38 --- a/drivers/misc/thinkpad_acpi.c
39 +++ b/drivers/misc/thinkpad_acpi.c
40 @@ -3182,6 +3182,12 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
42 mutex_init(&brightness_mutex);
44 + if (!brightness_enable) {
45 + dbg_printk(TPACPI_DBG_INIT,
46 + "brightness support disabled by module parameter\n");
47 + return 1;
48 + }
50 if (!brightness_mode) {
51 if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO)
52 brightness_mode = 2;
53 @@ -4803,6 +4809,9 @@ module_param_named(fan_control, fan_control_allowed, bool, 0);
54 static int brightness_mode;
55 module_param_named(brightness_mode, brightness_mode, int, 0);
57 +static unsigned int brightness_enable = 2; /* 2 = auto, 0 = no, 1 = yes */
58 +module_param(brightness_enable, uint, 0);
60 static unsigned int hotkey_report_mode;
61 module_param(hotkey_report_mode, uint, 0);
63 diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
64 index 8ca19c3..8fba2bb 100644
65 --- a/drivers/misc/thinkpad_acpi.h
66 +++ b/drivers/misc/thinkpad_acpi.h
67 @@ -339,6 +339,7 @@ static int bluetooth_write(char *buf);
68 static struct backlight_device *ibm_backlight_device;
69 static int brightness_offset = 0x31;
70 static int brightness_mode;
71 +static unsigned int brightness_enable; /* 0 = no, 1 = yes, 2 = auto */
73 static int brightness_init(struct ibm_init_struct *iibm);
74 static void brightness_exit(void);
75 --
76 1.5.3.4