Skip to contentSkip to conversation

ACPI: Ignore _BQC object when registering backlight device

PATCH In review Zhao Yakui 3 participants 3 messages Jul 17, 2008 ACPI

lore
Share & tools
lore

Zhao Yakui

author
#0 lore raw

PATCH 1/1 ACPI: Ignore _BQC object when registering backlight device

Quoted 1 line

From : Zhao Yakui <[email protected]>

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

---
 drivers/acpi/video.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/acpi/video.c +12 -2
Index: linux-2.6/drivers/acpi/video.c
===================================================================
@@ -741,7 +741,7 @@ static void acpi_video_device_find_cap(s
 
 	max_level = acpi_video_init_brightness(device);
 
-	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;
 		static int count = 0;
 		char *name;
@@ -753,7 +753,17 @@ static void acpi_video_device_find_cap(s
 		device->backlight = backlight_device_register(name,
 			NULL, device, &acpi_backlight_ops);
 		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);
 		kfree(name);
 
#1 lore raw
Quoted 10 lines · Zhao Yakui
Quoted 1 line

From : Zhao Yakui <[email protected]>

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

Hmm, but the original patch was reverted. How is this patch better than the patch that was reverted by Linus?

-Andi

#2 lore raw
Quoted 2 lines · Andi Kleen

Hmm, but the original patch was reverted. How is this patch better than the patch that was reverted by Linus?

The initial patch would have resulted in the screen brightness being set to minimum (which may be off on some hardware). The new one sets it to maximum brightness if it's not possible to determine the current brightness.

Signature · 1 line
Matthew Garrett | [email protected]