From: Zhang Rui <rui.zhang@intel.com>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi <linux-acpi@vger.kernel.org>,
"Zhang, Rui" <rui.zhang@intel.com>,
maximlevitsky@gmail.com
Subject: [PATCH] ACPI video: dmi check for broken _BQC on Acer Aspire 5720
Date: Fri, 24 Apr 2009 13:29:40 +0800 [thread overview]
Message-ID: <1240550980.7661.544.camel@rzhang-dt> (raw)
On Acer Aspire 5720, _BQC always returns a value 9 smaller than
the actual brightness level.
Add dmi quirk for this laptop.
http://bugzilla.kernel.org/show_bug.cgi?id=13121
Tested-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
drivers/acpi/video.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
Index: linux-2.6/drivers/acpi/video.c
===================================================================
--- linux-2.6.orig/drivers/acpi/video.c
+++ linux-2.6/drivers/acpi/video.c
@@ -87,6 +87,8 @@ static const struct acpi_device_id video
};
MODULE_DEVICE_TABLE(acpi, video_device_ids);
+static int bqc_offset;
+
static struct acpi_driver acpi_video_bus = {
.name = "video",
.class = ACPI_VIDEO_CLASS,
@@ -556,7 +558,8 @@ acpi_video_device_lcd_get_level_current(
- 3 - (*level);
*level = device->brightness->levels[*level + 2];
- }
+ } else if (bqc_offset)
+ *level += bqc_offset;
device->brightness->curr = *level;
return 0;
} else {
@@ -698,6 +701,29 @@ acpi_video_bus_DOS(struct acpi_video_bus
return status;
}
+static int video_bqc_offset(const struct dmi_system_id *d)
+{
+ bqc_offset = 9;
+ return 0;
+}
+
+static struct dmi_system_id video_dmi_table[] __initdata = {
+ /*
+ * Acer Aspire 5720 _BQC method is broken,
+ * it always returns a value smaller than the actual brightness level
+ * http://bugzilla.kernel.org/show_bug.cgi?id=13121
+ */
+ {
+ .callback = video_bqc_offset,
+ .ident = "Acer Aspire 5720",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
+ },
+ },
+ {}
+};
+
/*
* Simple comparison function used to sort backlight levels.
*/
@@ -2287,6 +2313,8 @@ EXPORT_SYMBOL(acpi_video_register);
static int __init acpi_video_init(void)
{
+ dmi_check_system(video_dmi_table);
+
if (intel_opregion_present())
return 0;
next reply other threads:[~2009-04-24 5:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-24 5:29 Zhang Rui [this message]
2009-04-24 6:15 ` [PATCH] ACPI video: dmi check for broken _BQC on Acer Aspire 5720 Len Brown
2009-04-24 6:40 ` Zhang Rui
2009-04-24 16:17 ` Len Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1240550980.7661.544.camel@rzhang-dt \
--to=rui.zhang@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=maximlevitsky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox