Commit 40e24cff authored by Zhao Yakui's avatar Zhao Yakui Committed by Greg Kroah-Hartman

ACPI: Ignore _BQC object when registering backlight device

upstream commmit: c2c78905

According to acpi spec , the objectes of  _BCL and _BCM are required if
integrated LCD is present and supports brightness level and the _BQC is
the optional object. So the _BQC object will be ignored when the backlight
device is registered.
At the same time when there is no _BQC object, the current brightness will be
set to the maximum.

http://bugzilla.kernel.org/show_bug.cgi?id=10206Signed-off-by: default avatarZhao Yakui <yakui.zhao@intel.com>
Signed-off-by: default avatarZhang Rui  <rui.zhang@intel.com>
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 11601895
...@@ -720,7 +720,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) ...@@ -720,7 +720,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
kfree(obj); kfree(obj);
if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){ if (device->cap._BCL && device->cap._BCM && max_level > 0) {
int result; int result;
static int count = 0; static int count = 0;
char *name; char *name;
...@@ -732,7 +732,17 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) ...@@ -732,7 +732,17 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
device->backlight = backlight_device_register(name, device->backlight = backlight_device_register(name,
NULL, device, &acpi_backlight_ops); NULL, device, &acpi_backlight_ops);
device->backlight->props.max_brightness = device->brightness->count-3; device->backlight->props.max_brightness = device->brightness->count-3;
device->backlight->props.brightness = acpi_video_get_brightness(device->backlight); /*
* If there exists the _BQC object, the _BQC object will be
* called to get the current backlight brightness. Otherwise
* the brightness will be set to the maximum.
*/
if (device->cap._BQC)
device->backlight->props.brightness =
acpi_video_get_brightness(device->backlight);
else
device->backlight->props.brightness =
device->backlight->props.max_brightness;
backlight_update_status(device->backlight); backlight_update_status(device->backlight);
kfree(name); kfree(name);
......
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