aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c56
1 files changed, 55 insertions, 1 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index d7ff61c0d571..1bdfb37377e3 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -538,6 +538,57 @@ 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
546static int bqc_offset_aml_bug_workaround;
547static 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
553static 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 .callback = video_set_bqc_offset,
567 .ident = "Acer Aspire 5710Z",
568 .matches = {
569 DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
570 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710Z"),
571 },
572 },
573 {
574 .callback = video_set_bqc_offset,
575 .ident = "eMachines E510",
576 .matches = {
577 DMI_MATCH(DMI_BOARD_VENDOR, "EMACHINES"),
578 DMI_MATCH(DMI_PRODUCT_NAME, "eMachines E510"),
579 },
580 },
581 {
582 .callback = video_set_bqc_offset,
583 .ident = "Acer Aspire 5315",
584 .matches = {
585 DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
586 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"),
587 },
588 },
589 {}
590};
591
541static int 592static int
542acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, 593acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
543 unsigned long long *level) 594 unsigned long long *level)
@@ -557,6 +608,7 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
557 *level = device->brightness->levels[*level + 2]; 608 *level = device->brightness->levels[*level + 2];
558 609
559 } 610 }
611 *level += bqc_offset_aml_bug_workaround;
560 device->brightness->curr = *level; 612 device->brightness->curr = *level;
561 return 0; 613 return 0;
562 } else { 614 } else {
@@ -2290,13 +2342,15 @@ EXPORT_SYMBOL(acpi_video_register);
2290 2342
2291static int __init acpi_video_init(void) 2343static int __init acpi_video_init(void)
2292{ 2344{
2345 dmi_check_system(video_dmi_table);
2346
2293 if (intel_opregion_present()) 2347 if (intel_opregion_present())
2294 return 0; 2348 return 0;
2295 2349
2296 return acpi_video_register(); 2350 return acpi_video_register();
2297} 2351}
2298 2352
2299void __exit acpi_video_exit(void) 2353void acpi_video_exit(void)
2300{ 2354{
2301 2355
2302 acpi_bus_unregister_driver(&acpi_video_bus); 2356 acpi_bus_unregister_driver(&acpi_video_bus);