aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2014-10-28 02:35:59 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-10-29 20:30:24 -0400
commitdce4ec2e452fddb7542b5fc15d0e6b8531f6d5eb (patch)
tree12590b7ace0d4f59b8cb6f8e6a820204b2be4aa7 /drivers
parentcac7f2429872d3733dc3f9915857b1691da2eb2f (diff)
ACPI / video: Run _BCL before deciding registering backlight
The ASUS K53SM's ACPI table queries _OSI("Windows 2012") in the video output device's _BCL and _BCM control method instead of the usual _INI functions of the _SB or PCI host bridge PCI0 devices. This made our video module thought this is a pre-Win8 system when deciding if we should register a backlight interface for it and the end result is that a non-working acpi_video interface is registered and user is unable to control backlight from GUI. Solve this problem by evaluating _BCL control method before doing the decision. Note that for some Thinkpad systems, the _BCL is also required to be evaluated for the hotkey event to be generated no matter if we will register an ACPI video backlight interface for it or not. Since the thinkpad_acpi module will do this anyway we didn't add such a thing in the video module previously. But now with this change here, the thinkpad_acpi module is no more necessary for those systems regarding backlight functionality. Link: https://bugzilla.kernel.org/show_bug.cgi?id=85051 Reported-and-tested-by: Ralf Jung <post+kernel@ralfj.de> Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/video.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 807a88a0f394..41e6b977ceb2 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1680,6 +1680,19 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
1680 printk(KERN_ERR PREFIX "Create sysfs link\n"); 1680 printk(KERN_ERR PREFIX "Create sysfs link\n");
1681} 1681}
1682 1682
1683static void acpi_video_run_bcl_for_osi(struct acpi_video_bus *video)
1684{
1685 struct acpi_video_device *dev;
1686 union acpi_object *levels;
1687
1688 mutex_lock(&video->device_list_lock);
1689 list_for_each_entry(dev, &video->video_device_list, entry) {
1690 if (!acpi_video_device_lcd_query_levels(dev, &levels))
1691 kfree(levels);
1692 }
1693 mutex_unlock(&video->device_list_lock);
1694}
1695
1683static int acpi_video_bus_register_backlight(struct acpi_video_bus *video) 1696static int acpi_video_bus_register_backlight(struct acpi_video_bus *video)
1684{ 1697{
1685 struct acpi_video_device *dev; 1698 struct acpi_video_device *dev;
@@ -1687,6 +1700,8 @@ static int acpi_video_bus_register_backlight(struct acpi_video_bus *video)
1687 if (video->backlight_registered) 1700 if (video->backlight_registered)
1688 return 0; 1701 return 0;
1689 1702
1703 acpi_video_run_bcl_for_osi(video);
1704
1690 if (!acpi_video_verify_backlight_support()) 1705 if (!acpi_video_verify_backlight_support())
1691 return 0; 1706 return 0;
1692 1707