All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 6/7] ACPI video: support buggy BIOSes with _BCQ implemented
@ 2009-03-12  8:57 Zhang Rui
  2009-03-17  5:05 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Rui @ 2009-03-12  8:57 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Matthew Garrett, Thomas Renninger, Zhang, Rui

Some buggy BIOSes implements _BCQ instead of _BQC.
Support these buggy BIOSes in ACPI video driver.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/acpi/video.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/acpi/video.c
===================================================================
--- linux-2.6.orig/drivers/acpi/video.c
+++ linux-2.6/drivers/acpi/video.c
@@ -162,6 +162,7 @@ struct acpi_video_device_cap {
 	u8 _BCL:1;		/*Query list of brightness control levels supported */
 	u8 _BCM:1;		/*Set the brightness level */
 	u8 _BQC:1;		/* Get current brightness level */
+	u8 _BCQ:1;		/* Some buggy BIOS uses _BCQ instead of _BQC */
 	u8 _DDC:1;		/*Return the EDID for this device */
 	u8 _DCS:1;		/*Return status of output device */
 	u8 _DGS:1;		/*Query graphics state */
@@ -523,8 +524,10 @@ acpi_video_device_lcd_get_level_current(
 {
 	acpi_status status = AE_OK;
 
-	if (device->cap._BQC) {
-		status = acpi_evaluate_integer(device->dev->handle, "_BQC",
+	if (device->cap._BQC || device->cap._BCQ) {
+		char *buf = device->cap._BQC ? "_BQC" : "_BCQ";
+
+		status = acpi_evaluate_integer(device->dev->handle, buf,
 						NULL, level);
 		if (ACPI_SUCCESS(status)) {
 			if (device->brightness->flags._BQC_use_index) {
@@ -544,8 +547,8 @@ acpi_video_device_lcd_get_level_current(
 			 * ACPI video backlight still works w/ buggy _BQC.
 			 * http://bugzilla.kernel.org/show_bug.cgi?id=12233
 			 */
-			ACPI_WARNING((AE_INFO, "Evaluating _BQC failed"));
-			device->cap._BQC = 0;
+			ACPI_WARNING((AE_INFO, "Evaluating %s failed", buf));
+			device->cap._BQC = device->cap._BCQ = 0;
 		}
 	}
 
@@ -861,6 +864,11 @@ static void acpi_video_device_find_cap(s
 	}
 	if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle,"_BQC",&h_dummy1)))
 		device->cap._BQC = 1;
+	else if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle,"_BCQ",&h_dummy1))) {
+		printk(KERN_WARNING FW_BUG "_BCQ is used instead of _BQC\n");
+		device->cap._BCQ = 1;
+	}
+
 	if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DDC", &h_dummy1))) {
 		device->cap._DDC = 1;
 	}



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RESEND PATCH 6/7] ACPI video: support buggy BIOSes with _BCQ implemented
  2009-03-12  8:57 [RESEND PATCH 6/7] ACPI video: support buggy BIOSes with _BCQ implemented Zhang Rui
@ 2009-03-17  5:05 ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2009-03-17  5:05 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-acpi, Matthew Garrett, Thomas Renninger

WARNING: line over 80 characters
#55: FILE: drivers/acpi/video.c:867:
+	else if 
(ACPI_SUCCESS(acpi_get_handle(device->dev->handle,"_BCQ",&h_dummy1))) {

ERROR: space required after that ',' (ctx:VxV)
#55: FILE: drivers/acpi/video.c:867:
+	else if 
(ACPI_SUCCESS(acpi_get_handle(device->dev->handle,"_BCQ",&h_dummy1))) {
 	                                                         ^

ERROR: space required after that ',' (ctx:VxO)
#55: FILE: drivers/acpi/video.c:867:
+	else if 
(ACPI_SUCCESS(acpi_get_handle(device->dev->handle,"_BCQ",&h_dummy1))) {
 	                                                                ^

ERROR: space required before that '&' (ctx:OxV)
#55: FILE: drivers/acpi/video.c:867:
+	else if 
(ACPI_SUCCESS(acpi_get_handle(device->dev->handle,"_BCQ",&h_dummy1))) {
 	                                                                 ^

total: 3 errors, 1 warnings, 40 lines checked


--
Len Brown, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-17  5:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12  8:57 [RESEND PATCH 6/7] ACPI video: support buggy BIOSes with _BCQ implemented Zhang Rui
2009-03-17  5:05 ` Len Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.