diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2010-08-09 22:48:19 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2010-08-16 11:54:50 -0400 |
commit | 217f09631a420295a9688e18aa4dbad1b385e56c (patch) | |
tree | 4b3f7890f28abad25c1bf3ff2b4b60499c06765d /drivers/platform | |
parent | 122f26726b5e16174bf8a707df14be1d93c49d62 (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>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 42 |
1 files changed, 20 insertions, 22 deletions
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 |