aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2014-09-30 02:10:17 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-09-30 14:49:19 -0400
commit0b8db271f1592e118feef7300f6da85bea9366da (patch)
tree1701b43f8b4b9a557719b753d04797917390085b
parenta11d342fb89aedec5003d116e7427d43cbba714d (diff)
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: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/video.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 5a98e1db68c0..015b93df5201 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1146,6 +1146,23 @@ acpi_video_device_bind(struct acpi_video_bus *video,
1146 } 1146 }
1147} 1147}
1148 1148
1149static 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
1149/* 1166/*
1150 * Arg: 1167 * Arg:
1151 * video : video bus device 1168 * video : video bus device
@@ -1585,6 +1602,15 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
1585 static int count; 1602 static int count;
1586 char *name; 1603 char *name;
1587 1604
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
1588 result = acpi_video_init_brightness(device); 1614 result = acpi_video_init_brightness(device);
1589 if (result) 1615 if (result)
1590 return; 1616 return;