Skip to content

Commit 99b572e

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: x86: Add DELL0501 handling to acpi_quirk_skip_serdev_enumeration()
Some recent(ish) Dell AIO devices have a backlight controller board connected to an UART. This UART has a DELL0501 HID with CID set to PNP0501 so that the UART is still handled by 8250_pnp.c. Unfortunately there is no separate ACPI device with an UartSerialBusV2() resource to model the backlight-controller. This causes the kernel to create a /dev/ttyS0 char-device for the UART instead of creating an in kernel serdev-controller + serdev-device pair for a kernel backlight driver. Use the existing acpi_quirk_skip_serdev_enumeration() mechanism to work around this by returning skip=true for tty-ctrl parents with a HID of DELL0501. Like other cases where the UartSerialBusV2() resource is missing or broken this will only create the serdev-controller device and the serdev-device itself will need to be instantiated by platform code. Unfortunately in this case there is no device for the platform-code instantiating the serdev-device to bind to. So also create a platform_device for this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 7c86e17 commit 99b572e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/acpi/x86/utils.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,28 @@ static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bo
484484

485485
int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip)
486486
{
487+
struct acpi_device *adev = ACPI_COMPANION(controller_parent);
488+
487489
*skip = false;
488490

491+
/*
492+
* The DELL0501 ACPI HID represents an UART (CID is set to PNP0501) with
493+
* a backlight-controller attached. There is no separate ACPI device with
494+
* an UartSerialBusV2() resource to model the backlight-controller.
495+
* Set skip to true so that the tty core creates a serdev ctrl device.
496+
* The backlight driver will manually create the serdev client device.
497+
*/
498+
if (acpi_dev_hid_match(adev, "DELL0501")) {
499+
*skip = true;
500+
/*
501+
* Create a platform dev for dell-uart-backlight to bind to.
502+
* This is a static device, so no need to store the result.
503+
*/
504+
platform_device_register_simple("dell-uart-backlight", PLATFORM_DEVID_NONE,
505+
NULL, 0);
506+
return 0;
507+
}
508+
489509
return acpi_dmi_skip_serdev_enumeration(controller_parent, skip);
490510
}
491511
EXPORT_SYMBOL_GPL(acpi_quirk_skip_serdev_enumeration);

0 commit comments

Comments
 (0)