Skip to content

Commit 0b8db27

Browse files
Aaron Lurafaeljw
Aaron Lu
authored andcommitted
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: [email protected] Signed-off-by: Aaron Lu <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent a11d342 commit 0b8db27

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

drivers/acpi/video.c

+26
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,23 @@ acpi_video_device_bind(struct acpi_video_bus *video,
11461146
}
11471147
}
11481148

1149+
static bool acpi_video_device_in_dod(struct acpi_video_device *device)
1150+
{
1151+
struct acpi_video_bus *video = device->video;
1152+
int i;
1153+
1154+
/* If we have a broken _DOD, no need to test */
1155+
if (!video->attached_count)
1156+
return true;
1157+
1158+
for (i = 0; i < video->attached_count; i++) {
1159+
if (video->attached_array[i].bind_info == device)
1160+
return true;
1161+
}
1162+
1163+
return false;
1164+
}
1165+
11491166
/*
11501167
* Arg:
11511168
* video : video bus device
@@ -1585,6 +1602,15 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
15851602
static int count;
15861603
char *name;
15871604

1605+
/*
1606+
* Do not create backlight device for video output
1607+
* device that is not in the enumerated list.
1608+
*/
1609+
if (!acpi_video_device_in_dod(device)) {
1610+
dev_dbg(&device->dev->dev, "not in _DOD list, ignore\n");
1611+
return;
1612+
}
1613+
15881614
result = acpi_video_init_brightness(device);
15891615
if (result)
15901616
return;

0 commit comments

Comments
 (0)