diff options
author | Borislav Petkov <bp@suse.de> | 2022-07-11 10:58:01 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2022-07-11 10:58:01 +0300 |
commit | 5a88c48f4146de2c8c2ed7ddcaa76f898869f3a3 (patch) | |
tree | fc501a1b940026cbd5316f8665236c109d5f1a2e /drivers/acpi/acpi_video.c | |
parent | b69a2afd5afce9bf6d56e349d6ab592c916e20f2 (diff) | |
parent | 32346491ddf24599decca06190ebca03ff9de7f8 (diff) | |
download | linux-5a88c48f4146de2c8c2ed7ddcaa76f898869f3a3.tar.xz |
Merge tag 'v5.19-rc6' into tip:x86/kdump
Merge rc6 to pick up dependent changes to the bootparam UAPI header.
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/acpi/acpi_video.c')
-rw-r--r-- | drivers/acpi/acpi_video.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index e07782b1fbb6..43177c20ce4f 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -73,6 +73,7 @@ module_param(device_id_scheme, bool, 0444); static int only_lcd = -1; module_param(only_lcd, int, 0444); +static bool has_backlight; static int register_count; static DEFINE_MUTEX(register_count_mutex); static DEFINE_MUTEX(video_list_lock); @@ -1222,6 +1223,9 @@ acpi_video_bus_get_one_device(struct acpi_device *device, acpi_video_device_bind(video, data); acpi_video_device_find_cap(data); + if (data->cap._BCM && data->cap._BCL) + has_backlight = true; + mutex_lock(&video->device_list_lock); list_add_tail(&data->entry, &video->video_device_list); mutex_unlock(&video->device_list_lock); @@ -2249,6 +2253,7 @@ void acpi_video_unregister(void) if (register_count) { acpi_bus_unregister_driver(&acpi_video_bus); register_count = 0; + has_backlight = false; } mutex_unlock(®ister_count_mutex); } @@ -2270,13 +2275,7 @@ void acpi_video_unregister_backlight(void) bool acpi_video_handles_brightness_key_presses(void) { - bool have_video_busses; - - mutex_lock(&video_list_lock); - have_video_busses = !list_empty(&video_bus_head); - mutex_unlock(&video_list_lock); - - return have_video_busses && + return has_backlight && (report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS); } EXPORT_SYMBOL(acpi_video_handles_brightness_key_presses); |