[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5081593.31r3eYUQgx@rafael.j.wysocki>
Date: Fri, 02 Jan 2026 12:50:57 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Linux ACPI <linux-acpi@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Armin Wolf <w_armin@....de>,
Hans de Goede <hansg@...nel.org>
Subject:
[RESEND][PATCH v1 1/3] ACPI: scan: Register platform devices for backlight
device objects
From: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
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@...el.com>
---
drivers/acpi/acpi_platform.c | 4 ++--
drivers/acpi/bus.c | 3 +++
drivers/acpi/scan.c | 3 ++-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 52c8d602f3a5..377ca8324121 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -118,7 +118,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
int count = 0;
/* If the ACPI node already has a physical device attached, skip it. */
- if (adev->physical_node_count)
+ if (adev->physical_node_count && !adev->pnp.type.backlight)
return NULL;
match = acpi_match_acpi_device(forbidden_id_list, adev);
@@ -135,7 +135,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
}
}
- if (adev->device_type == ACPI_BUS_TYPE_DEVICE) {
+ if (adev->device_type == ACPI_BUS_TYPE_DEVICE && !adev->pnp.type.backlight) {
struct list_head resource_list = LIST_HEAD_INIT(resource_list);
count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL);
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index a984ccd4a2a0..574e190f6bf9 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -761,6 +761,9 @@ const struct acpi_device *acpi_companion_match(const struct device *dev)
if (list_empty(&adev->pnp.ids))
return NULL;
+ if (adev->pnp.type.backlight)
+ return adev;
+
return acpi_primary_dev_companion(adev, dev);
}
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index d0479ac40856..360d82378e56 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -2350,7 +2350,8 @@ static int acpi_bus_attach(struct acpi_device *device, void *first_pass)
if (ret < 0)
return 0;
- if (device->pnp.type.platform_id || device->flags.enumeration_by_parent)
+ if (device->pnp.type.platform_id || device->pnp.type.backlight ||
+ device->flags.enumeration_by_parent)
acpi_default_enumeration(device);
else
acpi_device_set_enumerated(device);
--
2.51.0
Powered by blists - more mailing lists