Commit 217f0963 authored by Henrique de Moraes Holschuh's avatar Henrique de Moraes Holschuh Committed by Matthew Garrett

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: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 122f2672
...@@ -1024,6 +1024,10 @@ ThinkPad-specific interface. The driver will disable its native ...@@ -1024,6 +1024,10 @@ ThinkPad-specific interface. The driver will disable its native
backlight brightness control interface if it detects that the standard backlight brightness control interface if it detects that the standard
ACPI interface is available in the ThinkPad. ACPI interface is available in the ThinkPad.
If you want to use the thinkpad-acpi backlight brightness control
instead of the generic ACPI video backlight brightness control for some
reason, you should use the acpi_backlight=vendor kernel parameter.
The brightness_enable module parameter can be used to control whether The brightness_enable module parameter can be used to control whether
the LCD brightness control feature will be enabled when available. the LCD brightness control feature will be enabled when available.
brightness_enable=0 forces it to be disabled. brightness_enable=1 brightness_enable=0 forces it to be disabled. brightness_enable=1
......
...@@ -6216,34 +6216,32 @@ static int __init brightness_init(struct ibm_init_struct *iibm) ...@@ -6216,34 +6216,32 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
if (tp_features.bright_unkfw) if (tp_features.bright_unkfw)
return 1; return 1;
if (tp_features.bright_acpimode) { if (!brightness_enable) {
dbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT,
"brightness support disabled by "
"module parameter\n");
return 1;
}
if (acpi_video_backlight_support()) { if (acpi_video_backlight_support()) {
if (brightness_enable > 1) { if (brightness_enable > 1) {
printk(TPACPI_NOTICE printk(TPACPI_INFO
"Standard ACPI backlight interface " "Standard ACPI backlight interface "
"available, not loading native one.\n"); "available, not loading native one.\n");
return 1; return 1;
} else if (brightness_enable == 1) { } else if (brightness_enable == 1) {
printk(TPACPI_NOTICE printk(TPACPI_WARN
"Backlight control force enabled, even if standard " "Cannot enable backlight brightness support, "
"ACPI backlight interface is available\n"); "ACPI is already handling it. Refer to the "
"acpi_backlight kernel parameter\n");
return 1;
} }
} else { } else if (tp_features.bright_acpimode && brightness_enable > 1) {
if (brightness_enable > 1) {
printk(TPACPI_NOTICE printk(TPACPI_NOTICE
"Standard ACPI backlight interface not " "Standard ACPI backlight interface not "
"available, thinkpad_acpi native " "available, thinkpad_acpi native "
"brightness control enabled\n"); "brightness control enabled\n");
} }
}
}
if (!brightness_enable) {
dbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT,
"brightness support disabled by "
"module parameter\n");
return 1;
}
/* /*
* Check for module parameter bogosity, note that we * Check for module parameter bogosity, note that we
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment