diff options
author | Zhao Yakui <yakui.zhao@intel.com> | 2008-07-16 22:46:05 -0400 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2008-07-17 19:41:49 -0400 |
commit | c2c789057f075022658b38b498755c29c1ba8055 (patch) | |
tree | 04108f7ebd123e826c490add44797c89260db927 /drivers/acpi/video.c | |
parent | 4a5e3638b11978262ab76bbb2062e57fefaaedba (diff) |
ACPI: Ignore _BQC object when registering backlight device
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=10206
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 64c889331f3b..e32b6c14d928 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -741,7 +741,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
741 | 741 | ||
742 | max_level = acpi_video_init_brightness(device); | 742 | max_level = acpi_video_init_brightness(device); |
743 | 743 | ||
744 | if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){ | 744 | if (device->cap._BCL && device->cap._BCM && max_level > 0) { |
745 | int result; | 745 | int result; |
746 | static int count = 0; | 746 | static int count = 0; |
747 | char *name; | 747 | char *name; |
@@ -753,7 +753,17 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
753 | device->backlight = backlight_device_register(name, | 753 | device->backlight = backlight_device_register(name, |
754 | NULL, device, &acpi_backlight_ops); | 754 | NULL, device, &acpi_backlight_ops); |
755 | device->backlight->props.max_brightness = device->brightness->count-3; | 755 | device->backlight->props.max_brightness = device->brightness->count-3; |
756 | device->backlight->props.brightness = acpi_video_get_brightness(device->backlight); | 756 | /* |
757 | * If there exists the _BQC object, the _BQC object will be | ||
758 | * called to get the current backlight brightness. Otherwise | ||
759 | * the brightness will be set to the maximum. | ||
760 | */ | ||
761 | if (device->cap._BQC) | ||
762 | device->backlight->props.brightness = | ||
763 | acpi_video_get_brightness(device->backlight); | ||
764 | else | ||
765 | device->backlight->props.brightness = | ||
766 | device->backlight->props.max_brightness; | ||
757 | backlight_update_status(device->backlight); | 767 | backlight_update_status(device->backlight); |
758 | kfree(name); | 768 | kfree(name); |
759 | 769 | ||