public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 24/26] ACPI: Ignore _BQC object when registering backlight device
       [not found] ` <20081018184708.GA301@suse.de>
@ 2008-10-18 18:48   ` Greg KH
  0 siblings, 0 replies; only message in thread
From: Greg KH @ 2008-10-18 18:48 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	Chuck Ebbert, Domenico Andreoli, Willy Tarreau,
	Rodrigo Rubira Branco, Jake Edge, Eugene Teo, torvalds, akpm,
	alan, Zhao Yakui, linux-acpi, Zhang Rui, Andi Kleen, Len Brown

[-- Attachment #1: acpi-ignore-_bqc-object-when-registering-backlight-device.patch --]
[-- Type: text/plain, Size: 2043 bytes --]


2.6.26-stable review patch.  If anyone has any objections, please let us 
know.

------------------
From: Zhao Yakui <yakui.zhao@intel.com>

upstream commmit: c2c789057f075022658b38b498755c29c1ba8055

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>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/acpi/video.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -720,7 +720,7 @@ static void acpi_video_device_find_cap(s
 
 	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;
 		static int count = 0;
 		char *name;
@@ -732,7 +732,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);
 

-- 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-18 19:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20081018183853.004667035@mini.kroah.org>
     [not found] ` <20081018184708.GA301@suse.de>
2008-10-18 18:48   ` [patch 24/26] ACPI: Ignore _BQC object when registering backlight device Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox