mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
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>
This commit is contained in:
parent
122f26726b
commit
217f09631a
2 changed files with 24 additions and 22 deletions
|
@ -6216,28 +6216,6 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
|
|||
if (tp_features.bright_unkfw)
|
||||
return 1;
|
||||
|
||||
if (tp_features.bright_acpimode) {
|
||||
if (acpi_video_backlight_support()) {
|
||||
if (brightness_enable > 1) {
|
||||
printk(TPACPI_NOTICE
|
||||
"Standard ACPI backlight interface "
|
||||
"available, not loading native one.\n");
|
||||
return 1;
|
||||
} else if (brightness_enable == 1) {
|
||||
printk(TPACPI_NOTICE
|
||||
"Backlight control force enabled, even if standard "
|
||||
"ACPI backlight interface is available\n");
|
||||
}
|
||||
} else {
|
||||
if (brightness_enable > 1) {
|
||||
printk(TPACPI_NOTICE
|
||||
"Standard ACPI backlight interface not "
|
||||
"available, thinkpad_acpi native "
|
||||
"brightness control enabled\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!brightness_enable) {
|
||||
dbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT,
|
||||
"brightness support disabled by "
|
||||
|
@ -6245,6 +6223,26 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (acpi_video_backlight_support()) {
|
||||
if (brightness_enable > 1) {
|
||||
printk(TPACPI_INFO
|
||||
"Standard ACPI backlight interface "
|
||||
"available, not loading native one.\n");
|
||||
return 1;
|
||||
} else if (brightness_enable == 1) {
|
||||
printk(TPACPI_WARN
|
||||
"Cannot enable backlight brightness support, "
|
||||
"ACPI is already handling it. Refer to the "
|
||||
"acpi_backlight kernel parameter\n");
|
||||
return 1;
|
||||
}
|
||||
} else if (tp_features.bright_acpimode && brightness_enable > 1) {
|
||||
printk(TPACPI_NOTICE
|
||||
"Standard ACPI backlight interface not "
|
||||
"available, thinkpad_acpi native "
|
||||
"brightness control enabled\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for module parameter bogosity, note that we
|
||||
* init brightness_mode to TPACPI_BRGHT_MODE_MAX in order to be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue