Blob Blame History Raw
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 3 Nov 2021 15:26:20 +0100
Subject: ACPI: video: use platform backlight driver on Xiaomi Mi Pad 2
Patch-mainline: v5.16-rc1
Git-commit: 60e6655f0a6c6e4604e4b89444e5fb8e3d43a67b
References: jsc#PED-1408

The Xiaomi Mi Pad 2 is a Cherry Trail based x86 tablet which does not
use the i915's driver backlight control support:
 i915 0000:00:02.0: [drm:intel_panel_setup_backlight [i915]] no backlight present per VBT

Like all Cherry Trail devices the ACPI tables on the Xiaomi Mi Pad 2
contain a broken ACPI-video implementation which causes 6 different
acpi_video backlights to get registered when used.

The lack of the i915 driver registering a BACKLIGHT_RAW (aka native) type
backlight causes acpi_video_get_backlight_type() to pick the broken
acpi_video backlight code as the backlight driver to use.

There actually is a separate lp8556 backlight controller connected
over I2C which gets registered as a BACKLIGHT_PLATFORM (aka vendor).

Add a quirk to force acpi_video_get_backlight_type() to return
acpi_backlight_vendor, so that the broken acpi_video backlight
interfaces do not get registered.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
---
 drivers/acpi/video_detect.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -154,6 +154,14 @@ static const struct dmi_system_id video_
 		DMI_MATCH(DMI_PRODUCT_NAME, "VPCEH3U1E"),
 		},
 	},
+	{
+	.callback = video_detect_force_vendor,
+	/* Xiaomi Mi Pad 2 */
+	.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Xiaomi Inc"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"),
+		},
+	},
 
 	/*
 	 * These models have a working acpi_video backlight control, and using