Commit 0b8db271 authored by Aaron Lu's avatar Aaron Lu Committed by Rafael J. Wysocki

ACPI / video: check _DOD list when creating backlight devices

The _DOD method lists which video output device is currently attached so
we should only care about them and ignore others. An user recently
reported that there are two acpi_video interfaces appeared on his system
and one of them doesn't work. From the acpidump, it is found that there
are more than one video output devices that have _BCM control method but
the _DOD lists only one of them. So this patch checks if the video output
device is in the _DOD list and will not create backlight device if it is
not in the list. Also, we consider the broken _DOD case(reflected by the
video->attached_count is 0) and do not change behaviour for those broken
_DOD systems.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=84111
Reported-and-tested-by: ntrrgc@gmail.com
Signed-off-by: default avatarAaron Lu <aaron.lu@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent a11d342f
...@@ -1146,6 +1146,23 @@ acpi_video_device_bind(struct acpi_video_bus *video, ...@@ -1146,6 +1146,23 @@ acpi_video_device_bind(struct acpi_video_bus *video,
} }
} }
static bool acpi_video_device_in_dod(struct acpi_video_device *device)
{
struct acpi_video_bus *video = device->video;
int i;
/* If we have a broken _DOD, no need to test */
if (!video->attached_count)
return true;
for (i = 0; i < video->attached_count; i++) {
if (video->attached_array[i].bind_info == device)
return true;
}
return false;
}
/* /*
* Arg: * Arg:
* video : video bus device * video : video bus device
...@@ -1585,6 +1602,15 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device) ...@@ -1585,6 +1602,15 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
static int count; static int count;
char *name; char *name;
/*
* Do not create backlight device for video output
* device that is not in the enumerated list.
*/
if (!acpi_video_device_in_dod(device)) {
dev_dbg(&device->dev->dev, "not in _DOD list, ignore\n");
return;
}
result = acpi_video_init_brightness(device); result = acpi_video_init_brightness(device);
if (result) if (result)
return; return;
......
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