diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2007-07-18 22:45:43 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-07-21 23:49:03 -0400 |
commit | 24d3b77467b6aaf59e38dce4aa86d05541858195 (patch) | |
tree | 92975c9c2d4b37922d25782bd02d7076d77e817e /drivers/misc/thinkpad_acpi.h | |
parent | d5a2f2f1d68e2da538ac28540cddd9ccc733b001 (diff) |
ACPI: thinkpad-acpi: allow use of CMOS NVRAM for brightness control
It appears that Lenovo decided to break the EC brightness control interface
in a weird way in their latest BIOSes. Fortunately, the old CMOS NVRAM
interface works just fine in such BIOSes.
Add a module parameter that allows the user to select which strategy to use
for brightness control: EC, NVRAM, or both. By default, do both (which is
the way thinkpad-acpi used to work until now) on IBM ThinkPads, and use
NVRAM only on Lenovo ThinkPads.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/thinkpad_acpi.h')
-rw-r--r-- | drivers/misc/thinkpad_acpi.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h index 09b2282fed0b..b7a4a888cc8b 100644 --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/list.h> | 32 | #include <linux/list.h> |
33 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
34 | 34 | ||
35 | #include <linux/nvram.h> | ||
35 | #include <linux/proc_fs.h> | 36 | #include <linux/proc_fs.h> |
36 | #include <linux/sysfs.h> | 37 | #include <linux/sysfs.h> |
37 | #include <linux/backlight.h> | 38 | #include <linux/backlight.h> |
@@ -80,6 +81,11 @@ | |||
80 | #define TP_CMOS_BRIGHTNESS_UP 4 | 81 | #define TP_CMOS_BRIGHTNESS_UP 4 |
81 | #define TP_CMOS_BRIGHTNESS_DOWN 5 | 82 | #define TP_CMOS_BRIGHTNESS_DOWN 5 |
82 | 83 | ||
84 | /* ThinkPad CMOS NVRAM constants */ | ||
85 | #define TP_NVRAM_ADDR_BRIGHTNESS 0x5e | ||
86 | #define TP_NVRAM_MASK_LEVEL_BRIGHTNESS 0x07 | ||
87 | #define TP_NVRAM_POS_LEVEL_BRIGHTNESS 0 | ||
88 | |||
83 | #define onoff(status,bit) ((status) & (1 << (bit)) ? "on" : "off") | 89 | #define onoff(status,bit) ((status) & (1 << (bit)) ? "on" : "off") |
84 | #define enabled(status,bit) ((status) & (1 << (bit)) ? "enabled" : "disabled") | 90 | #define enabled(status,bit) ((status) & (1 << (bit)) ? "enabled" : "disabled") |
85 | #define strlencmp(a,b) (strncmp((a), (b), strlen(b))) | 91 | #define strlencmp(a,b) (strncmp((a), (b), strlen(b))) |
@@ -323,6 +329,7 @@ static int bluetooth_write(char *buf); | |||
323 | 329 | ||
324 | static struct backlight_device *ibm_backlight_device; | 330 | static struct backlight_device *ibm_backlight_device; |
325 | static int brightness_offset = 0x31; | 331 | static int brightness_offset = 0x31; |
332 | static int brightness_mode; | ||
326 | 333 | ||
327 | static int brightness_init(struct ibm_init_struct *iibm); | 334 | static int brightness_init(struct ibm_init_struct *iibm); |
328 | static void brightness_exit(void); | 335 | static void brightness_exit(void); |