]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/6.8.6/acpi-x86-add-dell0501-handling-to-acpi_quirk_skip_se.patch
Linux 6.8.6
[thirdparty/kernel/stable-queue.git] / releases / 6.8.6 / acpi-x86-add-dell0501-handling-to-acpi_quirk_skip_se.patch
1 From 877522169dbf76d5aec093fee58ecf835169dd0f Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Sun, 18 Feb 2024 16:15:33 +0100
4 Subject: ACPI: x86: Add DELL0501 handling to
5 acpi_quirk_skip_serdev_enumeration()
6
7 From: Hans de Goede <hdegoede@redhat.com>
8
9 [ Upstream commit 99b572e6136eab69a8c91d72cf8595b256e304b5 ]
10
11 Some recent(ish) Dell AIO devices have a backlight controller board
12 connected to an UART.
13
14 This UART has a DELL0501 HID with CID set to PNP0501 so that the UART is
15 still handled by 8250_pnp.c. Unfortunately there is no separate ACPI device
16 with an UartSerialBusV2() resource to model the backlight-controller.
17 This causes the kernel to create a /dev/ttyS0 char-device for the UART
18 instead of creating an in kernel serdev-controller + serdev-device pair
19 for a kernel backlight driver.
20
21 Use the existing acpi_quirk_skip_serdev_enumeration() mechanism to work
22 around this by returning skip=true for tty-ctrl parents with a HID
23 of DELL0501.
24
25 Like other cases where the UartSerialBusV2() resource is missing or broken
26 this will only create the serdev-controller device and the serdev-device
27 itself will need to be instantiated by platform code.
28
29 Unfortunately in this case there is no device for the platform-code
30 instantiating the serdev-device to bind to. So also create
31 a platform_device for this.
32
33 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
34 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
35 Signed-off-by: Sasha Levin <sashal@kernel.org>
36 ---
37 drivers/acpi/x86/utils.c | 20 ++++++++++++++++++++
38 1 file changed, 20 insertions(+)
39
40 diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
41 index 8829a907eee02..90c3d2eab9e99 100644
42 --- a/drivers/acpi/x86/utils.c
43 +++ b/drivers/acpi/x86/utils.c
44 @@ -484,8 +484,28 @@ static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bo
45
46 int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip)
47 {
48 + struct acpi_device *adev = ACPI_COMPANION(controller_parent);
49 +
50 *skip = false;
51
52 + /*
53 + * The DELL0501 ACPI HID represents an UART (CID is set to PNP0501) with
54 + * a backlight-controller attached. There is no separate ACPI device with
55 + * an UartSerialBusV2() resource to model the backlight-controller.
56 + * Set skip to true so that the tty core creates a serdev ctrl device.
57 + * The backlight driver will manually create the serdev client device.
58 + */
59 + if (acpi_dev_hid_match(adev, "DELL0501")) {
60 + *skip = true;
61 + /*
62 + * Create a platform dev for dell-uart-backlight to bind to.
63 + * This is a static device, so no need to store the result.
64 + */
65 + platform_device_register_simple("dell-uart-backlight", PLATFORM_DEVID_NONE,
66 + NULL, 0);
67 + return 0;
68 + }
69 +
70 return acpi_dmi_skip_serdev_enumeration(controller_parent, skip);
71 }
72 EXPORT_SYMBOL_GPL(acpi_quirk_skip_serdev_enumeration);
73 --
74 2.43.0
75