Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ACPI: scan: Register platform devices for backlight device objects

ACPI device objects associated with backlight interfaces are special
because they are ACPI companions of PCI devices (GPUs), but the
interfaces exposed by them resemble platform device one.

Currently, the ACPI video driver binds to them with the help of a
special "synthetic" device ID regardless of the pairing with the PCI
devices, but since it is generally better to use platform drivers for
handling such interfaces, the plan is to convert that drviver into a
platform one.

However, for this purpose, platform devices corresponding to the
ACPI backlight device objects need to be registered, so update
acpi_bus_attach() to apply the default ACPI enumeration to them
and modify acpi_create_platform_device() to avoid bailing out early
if a "physical" device is already attached to a backlight ACPI device
object.

In addition, update acpi_companion_match() to return a valid struct
acpi_device pointer if the ACPI companion of the given device is a
backlight ACPI device object, which will facilitate driver matching
for platform devices corresponding to those objects.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/5081593.31r3eYUQgx@rafael.j.wysocki

+7 -3
+2 -2
drivers/acpi/acpi_platform.c
··· 118 118 int count = 0; 119 119 120 120 /* If the ACPI node already has a physical device attached, skip it. */ 121 - if (adev->physical_node_count) 121 + if (adev->physical_node_count && !adev->pnp.type.backlight) 122 122 return NULL; 123 123 124 124 match = acpi_match_acpi_device(forbidden_id_list, adev); ··· 135 135 } 136 136 } 137 137 138 - if (adev->device_type == ACPI_BUS_TYPE_DEVICE) { 138 + if (adev->device_type == ACPI_BUS_TYPE_DEVICE && !adev->pnp.type.backlight) { 139 139 struct list_head resource_list = LIST_HEAD_INIT(resource_list); 140 140 141 141 count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL);
+3
drivers/acpi/bus.c
··· 761 761 if (list_empty(&adev->pnp.ids)) 762 762 return NULL; 763 763 764 + if (adev->pnp.type.backlight) 765 + return adev; 766 + 764 767 return acpi_primary_dev_companion(adev, dev); 765 768 } 766 769
+2 -1
drivers/acpi/scan.c
··· 2350 2350 if (ret < 0) 2351 2351 return 0; 2352 2352 2353 - if (device->pnp.type.platform_id || device->flags.enumeration_by_parent) 2353 + if (device->pnp.type.platform_id || device->pnp.type.backlight || 2354 + device->flags.enumeration_by_parent) 2354 2355 acpi_default_enumeration(device); 2355 2356 else 2356 2357 acpi_device_set_enumerated(device);