48f65f6
From: Hans de Goede <hdegoede@redhat.com>
48f65f6
Date: Tue, 3 Mar 2015 08:31:24 +0100
48f65f6
Subject: [PATCH] acpi: video: Add force native backlight quirk for Lenovo
48f65f6
 Ideapad Z570
48f65f6
48f65f6
The Lenovo Ideapad Z570 (which is an Acer in disguise like some other Ideapads)
48f65f6
has a broken acpi_video interface, this was fixed in commmit a11d342fb8
48f65f6
("ACPI / video: force vendor backlight on Lenovo Ideapad Z570").
48f65f6
48f65f6
Which stops acpi_video from registering a backlight interface, but this is
48f65f6
only a partial fix, because for people who have the ideapad-laptop module
48f65f6
installed that module will now register a backlight interface, which also
48f65f6
does not work, so we need to use the native intel_backlight interface.
48f65f6
48f65f6
The Lenovo Ideapad 570 is a pre-win8 laptop / too old for the acpi-video code
48f65f6
to automatically prefer the native backlight interface, so add a quirk for it.
48f65f6
48f65f6
This commit also removes the previous incomplete fix.
48f65f6
48f65f6
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1187004
48f65f6
Cc: Stepan Bujnak <stepanbujnak@fastmail.fm>
48f65f6
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
48f65f6
---
48f65f6
 drivers/acpi/video.c        | 17 +++++++++++++++++
48f65f6
 drivers/acpi/video_detect.c |  8 --------
48f65f6
 2 files changed, 17 insertions(+), 8 deletions(-)
48f65f6
48f65f6
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
48f65f6
index 70ea37bea84f..d9bf8ba7d848 100644
48f65f6
--- a/drivers/acpi/video.c
48f65f6
+++ b/drivers/acpi/video.c
48f65f6
@@ -425,6 +425,12 @@ static int __init video_disable_native_backlight(const struct dmi_system_id *d)
48f65f6
 	return 0;
48f65f6
 }
48f65f6
 
48f65f6
+static int __init video_enable_native_backlight(const struct dmi_system_id *d)
48f65f6
+{
48f65f6
+	use_native_backlight_dmi = NATIVE_BACKLIGHT_ON;
48f65f6
+	return 0;
48f65f6
+}
48f65f6
+
48f65f6
 static struct dmi_system_id video_dmi_table[] __initdata = {
48f65f6
 	/*
48f65f6
 	 * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
48f65f6
@@ -566,6 +572,17 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
48f65f6
 		DMI_MATCH(DMI_PRODUCT_NAME, "XPS L521X"),
48f65f6
 		},
48f65f6
 	},
48f65f6
+
48f65f6
+	/* Non win8 machines which need native backlight nevertheless */
48f65f6
+	{
48f65f6
+	 /* https://bugzilla.redhat.com/show_bug.cgi?id=1187004 */
48f65f6
+	 .callback = video_enable_native_backlight,
48f65f6
+	 .ident = "Lenovo Ideapad Z570",
48f65f6
+	 .matches = {
48f65f6
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
48f65f6
+		DMI_MATCH(DMI_PRODUCT_NAME, "102434U"),
48f65f6
+		},
48f65f6
+	},
48f65f6
 	{}
48f65f6
 };
48f65f6
 
48f65f6
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
48f65f6
index 27c43499977a..c42feb2bacd0 100644
48f65f6
--- a/drivers/acpi/video_detect.c
48f65f6
+++ b/drivers/acpi/video_detect.c
48f65f6
@@ -174,14 +174,6 @@ static struct dmi_system_id video_detect_dmi_table[] = {
48f65f6
 		DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 5737"),
48f65f6
 		},
48f65f6
 	},
48f65f6
-	{
48f65f6
-	.callback = video_detect_force_vendor,
48f65f6
-	.ident = "Lenovo IdeaPad Z570",
48f65f6
-	.matches = {
48f65f6
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
48f65f6
-		DMI_MATCH(DMI_PRODUCT_VERSION, "Ideapad Z570"),
48f65f6
-		},
48f65f6
-	},
48f65f6
 	{ },
48f65f6
 };
48f65f6