From nobody Tue Dec 16 16:40:46 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 680E1182D2; Wed, 10 Dec 2025 14:51:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765378310; cv=none; b=VreU+IupALBMi6HyX6Mh0QAId7ijsbRNlFkVUWmG5DBHT9Xx3Sq7z2WrHjxCK2LqiYzp1Cls2Ny+TAbBeeP/KKTUkVxkXR1eWPoI8cmU56kCIlQ7veUwGilfUpsOH2f+OjDxSwQKm2XOXWIRhpk4Jc9ZOmlnkmO2bLYMg6Bf6WU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765378310; c=relaxed/simple; bh=SYv0H0lZoj3lrl3sdPTiWtjC5eWPebsA8f4rqhvvT2o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IoVhJ8DGQaq9/C21wZ/lmvdjr3hlw6YSZ2aW7uWN6vpj/CzVI4rfCz7yqgBYLQJdRAYCY0DNGT5qkWw+38RXaU6KZ4JXbXEppu8kGfJZN2qgNfkIigG+csb1yCX8zpIQLs4SiR1SE9iAW+l8Y/PKSLrd8fz2+Cjaw9bwpc1guj8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mel6ryE6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mel6ryE6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E54CC19421; Wed, 10 Dec 2025 14:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765378309; bh=SYv0H0lZoj3lrl3sdPTiWtjC5eWPebsA8f4rqhvvT2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mel6ryE6jGiUjZhdo1SnymOKGroh9Hm83asqFbuzJ/X7iDoBiUCrQTY3kxF+R3Eql Ga2b6o57bR4Or4GOFE+YS8ud1QlMWAnZHaB5Vr9DXJ08mG6bfY9bnNUHvydr+UL2wu IjLWXi915RQO4WinWgbPOVoDnAZK2F9omAv9KJfMTx3oC9SgN83KI6t3wm7E5EmoWm KlvzEaUGsNcEyZKM2XKP844mjKghHw03hMpJ15JmQkgqN6pm+02cbaLh1QH3WhY1m1 H8rZfUnMkuv/+xt5iL1oNDWD+3gdQXZeAjl6mkCl/FdphWIXe7RAC8IXOY/RPHR10l z4w5p/AVSYe+w== From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PM , Armin Wolf , Hans de Goede Subject: [PATCH v1 1/3] ACPI: scan: Register platform devices for backlight device objects Date: Wed, 10 Dec 2025 15:48:29 +0100 Message-ID: <2335304.iZASKD2KPV@rafael.j.wysocki> Organization: Linux Kernel Development In-Reply-To: <8617910.T7Z3S40VBb@rafael.j.wysocki> References: <8617910.T7Z3S40VBb@rafael.j.wysocki> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Rafael J. Wysocki 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 --- drivers/acpi/acpi_platform.c | 5 +++-- drivers/acpi/bus.c | 3 +++ drivers/acpi/scan.c | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -120,7 +120,7 @@ struct platform_device *acpi_create_plat int count; =20 /* 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; =20 match =3D acpi_match_acpi_device(forbidden_id_list, adev); @@ -138,7 +138,8 @@ struct platform_device *acpi_create_plat } =20 INIT_LIST_HEAD(&resource_list); - if (adev->device_type =3D=3D ACPI_BUS_TYPE_DEVICE) { + if (adev->device_type =3D=3D ACPI_BUS_TYPE_DEVICE && + !adev->pnp.type.backlight) { count =3D acpi_dev_get_resources(adev, &resource_list, NULL, NULL); if (count < 0) return NULL; --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -761,6 +761,9 @@ const struct acpi_device *acpi_companion if (list_empty(&adev->pnp.ids)) return NULL; =20 + if (adev->pnp.type.backlight) + return adev; + return acpi_primary_dev_companion(adev, dev); } =20 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2320,7 +2320,8 @@ static int acpi_bus_attach(struct acpi_d if (ret < 0) return 0; =20 - 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);