aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2010-08-09 22:48:19 -0400
committerMatthew Garrett <mjg@redhat.com>2010-08-16 11:54:50 -0400
commit217f09631a420295a9688e18aa4dbad1b385e56c (patch)
tree4b3f7890f28abad25c1bf3ff2b4b60499c06765d
parent122f26726b5e16174bf8a707df14be1d93c49d62 (diff)
thinkpad-acpi: untangle ACPI/vendor backlight selection
acpi_video_backlight_support() already tells us if ACPI is handling backlight control through the generic ACPI handle. It is better to just trust it. While at it, adjust down a printk priority, and test earlier for brightness_enable=0. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Matthew Garrett <mjg@redhat.com>
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt4
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c42
2 files changed, 24 insertions, 22 deletions
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index f6f80257addb..1565eefd6fd5 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -1024,6 +1024,10 @@ ThinkPad-specific interface. The driver will disable its native
1024backlight brightness control interface if it detects that the standard 1024backlight brightness control interface if it detects that the standard
1025ACPI interface is available in the ThinkPad. 1025ACPI interface is available in the ThinkPad.
1026 1026
1027If you want to use the thinkpad-acpi backlight brightness control
1028instead of the generic ACPI video backlight brightness control for some
1029reason, you should use the acpi_backlight=vendor kernel parameter.
1030
1027The brightness_enable module parameter can be used to control whether 1031The brightness_enable module parameter can be used to control whether
1028the LCD brightness control feature will be enabled when available. 1032the LCD brightness control feature will be enabled when available.
1029brightness_enable=0 forces it to be disabled. brightness_enable=1 1033brightness_enable=0 forces it to be disabled. brightness_enable=1
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 9d6fc4c7c08e..b9430e887e95 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6216,28 +6216,6 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
6216 if (tp_features.bright_unkfw) 6216 if (tp_features.bright_unkfw)
6217 return 1; 6217 return 1;
6218 6218
6219 if (tp_features.bright_acpimode) {
6220 if (acpi_video_backlight_support()) {
6221 if (brightness_enable > 1) {
6222 printk(TPACPI_NOTICE
6223 "Standard ACPI backlight interface "
6224 "available, not loading native one.\n");
6225 return 1;
6226 } else if (brightness_enable == 1) {
6227 printk(TPACPI_NOTICE
6228 "Backlight control force enabled, even if standard "
6229 "ACPI backlight interface is available\n");
6230 }
6231 } else {
6232 if (brightness_enable > 1) {
6233 printk(TPACPI_NOTICE
6234 "Standard ACPI backlight interface not "
6235 "available, thinkpad_acpi native "
6236 "brightness control enabled\n");
6237 }
6238 }
6239 }
6240
6241 if (!brightness_enable) { 6219 if (!brightness_enable) {
6242 dbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT, 6220 dbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT,
6243 "brightness support disabled by " 6221 "brightness support disabled by "
@@ -6245,6 +6223,26 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
6245 return 1; 6223 return 1;
6246 } 6224 }
6247 6225
6226 if (acpi_video_backlight_support()) {
6227 if (brightness_enable > 1) {
6228 printk(TPACPI_INFO
6229 "Standard ACPI backlight interface "
6230 "available, not loading native one.\n");
6231 return 1;
6232 } else if (brightness_enable == 1) {
6233 printk(TPACPI_WARN
6234 "Cannot enable backlight brightness support, "
6235 "ACPI is already handling it. Refer to the "
6236 "acpi_backlight kernel parameter\n");
6237 return 1;
6238 }
6239 } else if (tp_features.bright_acpimode && brightness_enable > 1) {
6240 printk(TPACPI_NOTICE
6241 "Standard ACPI backlight interface not "
6242 "available, thinkpad_acpi native "
6243 "brightness control enabled\n");
6244 }
6245
6248 /* 6246 /*
6249 * Check for module parameter bogosity, note that we 6247 * Check for module parameter bogosity, note that we
6250 * init brightness_mode to TPACPI_BRGHT_MODE_MAX in order to be 6248 * init brightness_mode to TPACPI_BRGHT_MODE_MAX in order to be