From patchwork Thu Mar 12 08:57:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 11298 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2C8u29F007246 for ; Thu, 12 Mar 2009 08:56:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754279AbZCLI4R (ORCPT ); Thu, 12 Mar 2009 04:56:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754253AbZCLI4Q (ORCPT ); Thu, 12 Mar 2009 04:56:16 -0400 Received: from mga09.intel.com ([134.134.136.24]:51451 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753997AbZCLI4N (ORCPT ); Thu, 12 Mar 2009 04:56:13 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 12 Mar 2009 01:48:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,349,1233561600"; d="scan'208";a="497174759" Received: from rzhang-dt.sh.intel.com (HELO [10.239.36.58]) ([10.239.36.58]) by orsmga001.jf.intel.com with ESMTP; 12 Mar 2009 01:55:47 -0700 Subject: [RESEND PATCH 6/7] ACPI video: support buggy BIOSes with _BCQ implemented From: Zhang Rui To: Len Brown Cc: linux-acpi , Matthew Garrett , Thomas Renninger , "Zhang, Rui" Date: Thu, 12 Mar 2009 16:57:10 +0800 Message-Id: <1236848230.2807.75.camel@rzhang-dt> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Some buggy BIOSes implements _BCQ instead of _BQC. Support these buggy BIOSes in ACPI video driver. Signed-off-by: Zhang Rui --- drivers/acpi/video.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }