diff options
author | Zhang Rui <rui.zhang@intel.com> | 2009-04-24 12:13:18 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-04-24 12:13:18 -0400 |
commit | 45cb50e646d1560eff01c5ad0f0df3c7fd6148dd (patch) | |
tree | fafdf26badb8ae56b92e014f9d925878a16b6770 /drivers/acpi | |
parent | 091069740304c979f957ceacec39c461d0192158 (diff) |
ACPI video: dmi check for broken _BQC on Acer Aspire 5720
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>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/video.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index cd4fb7543a90..7e8ee49ebd40 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -538,6 +538,33 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level) | |||
538 | return -EINVAL; | 538 | return -EINVAL; |
539 | } | 539 | } |
540 | 540 | ||
541 | /* | ||
542 | * For some buggy _BQC methods, we need to add a constant value to | ||
543 | * the _BQC return value to get the actual current brightness level | ||
544 | */ | ||
545 | |||
546 | static int bqc_offset_aml_bug_workaround; | ||
547 | static int __init video_set_bqc_offset(const struct dmi_system_id *d) | ||
548 | { | ||
549 | bqc_offset_aml_bug_workaround = 9; | ||
550 | return 0; | ||
551 | } | ||
552 | |||
553 | static struct dmi_system_id video_dmi_table[] __initdata = { | ||
554 | /* | ||
555 | * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 | ||
556 | */ | ||
557 | { | ||
558 | .callback = video_set_bqc_offset, | ||
559 | .ident = "Acer Aspire 5720", | ||
560 | .matches = { | ||
561 | DMI_MATCH(DMI_BOARD_VENDOR, "Acer"), | ||
562 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"), | ||
563 | }, | ||
564 | }, | ||
565 | {} | ||
566 | }; | ||
567 | |||
541 | static int | 568 | static int |
542 | acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, | 569 | acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, |
543 | unsigned long long *level) | 570 | unsigned long long *level) |
@@ -557,6 +584,7 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, | |||
557 | *level = device->brightness->levels[*level + 2]; | 584 | *level = device->brightness->levels[*level + 2]; |
558 | 585 | ||
559 | } | 586 | } |
587 | *level += bqc_offset_aml_bug_workaround; | ||
560 | device->brightness->curr = *level; | 588 | device->brightness->curr = *level; |
561 | return 0; | 589 | return 0; |
562 | } else { | 590 | } else { |
@@ -2287,6 +2315,8 @@ EXPORT_SYMBOL(acpi_video_register); | |||
2287 | 2315 | ||
2288 | static int __init acpi_video_init(void) | 2316 | static int __init acpi_video_init(void) |
2289 | { | 2317 | { |
2318 | dmi_check_system(video_dmi_table); | ||
2319 | |||
2290 | if (intel_opregion_present()) | 2320 | if (intel_opregion_present()) |
2291 | return 0; | 2321 | return 0; |
2292 | 2322 | ||