From: Aaron Ma Date: Tue, 18 Aug 2020 09:49:19 +0000 (-0400) Subject: platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid X-Git-Tag: Ubuntu-5.4.0-49.53~992 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=81db70a650423c022868517f10217eee12716f59;p=mirror_ubuntu-focal-kernel.git platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid BugLink: https://bugs.launchpad.net/bugs/1892010 When _BCL invalid, disable thinkpad_acpi backlight brightness control. brightness_enable is already checked at the beginning. Most new thinkpads are using GPU driver to control brightness now, print notice when enabled brightness control even when brightness_enable = 1. Signed-off-by: Aaron Ma Signed-off-by: Andy Shevchenko (cherry picked from commit 46713aeee154205fc0285b0d9ac78cb4bdf246a7) Signed-off-by: Aaron Ma Acked-by: Stefan Bader Acked-by: Thadeu Lima de Souza Cascardo Signed-off-by: Ian May Signed-off-by: Kelsey Skunberg --- diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index da794dcfdd92..460584a5e86b 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -6997,10 +6997,13 @@ static int __init brightness_init(struct ibm_init_struct *iibm) pr_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) { - pr_notice("Standard ACPI backlight interface not available, thinkpad_acpi native brightness control enabled\n"); + } else if (!tp_features.bright_acpimode) { + pr_notice("ACPI backlight interface not available\n"); + return 1; } + pr_notice("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