===================================================================
@@ -87,6 +87,12 @@ static const struct acpi_device_id video
};
MODULE_DEVICE_TABLE(acpi, video_device_ids);
+/*
+ * For some buggy _BQC methods, we need to add a constant value to
+ * the _BQC return value to get the actual current brightness level
+ */
+static int bqc_offset_idiotic_aml_workaround;
+
static struct acpi_driver acpi_video_bus = {
.name = "video",
.class = ACPI_VIDEO_CLASS,
@@ -556,7 +562,8 @@ acpi_video_device_lcd_get_level_current(
- 3 - (*level);
*level = device->brightness->levels[*level + 2];
- }
+ } else if (bqc_offset_idiotic_aml_workaround)
+ *level += bqc_offset_idiotic_aml_workaround;
device->brightness->curr = *level;
return 0;
} else {
@@ -698,6 +705,29 @@ acpi_video_bus_DOS(struct acpi_video_bus
return status;
}
+static int video_set_bqc_offset(const struct dmi_system_id *d)
+{
+ bqc_offset_idiotic_aml_workaround = 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_set_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 +2317,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;