]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ACPI: scan: Register platform devices for fixed event buttons
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 15 Dec 2025 13:52:45 +0000 (14:52 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 26 Dec 2025 14:08:56 +0000 (15:08 +0100)
commitab06eb9204010c61e754bf4e71ee6f554584714d
tree0a73e7d462d79dce1b7fdf2469e4a64064e1fdfe
parent03667e146f815d5de8d2d8c85ced39791fb2b373
ACPI: scan: Register platform devices for fixed event buttons

On platforms using ACPI, power and sleep buttons may be so called "fixed
event devices" in which case they are hooked up directly to the Fixed
Events register in the platform via dedicated lines and there are no
corresponding device objects in the ACPI namespace.  Nevertheless, in
Linux they get corresponding struct acpi_device objects with special
device IDs, either LNXPWRBN or LNXSLPBN, which are then used for driver
binding in a ususal way.

However, the function creating those struct acpi_device objects for
"fixed event device" buttons, acpi_bus_scan_fixed(), does not register
platform devices for them, unlike the generic code handling device
enumeration based on the ACPI namespace.  Consequently, if an ACPI power
or sleep button is represented by a device object in the ACPI namespace,
it will get a corresponding platform device, but if it is a "fixed event
device", it will not get one, which is inconsistent and prevents the
ACPI power button driver from being converted into a platform driver.

For the sake of consistency and to allow the ACPI power button driver to
become a platform one going forward, modify acpi_bus_scan_fixed() to
register platform devices for "fixed event device" buttons and update
ACPI platform device registration code to work with non-device ACPI
object types, so it can handle the buttons in question.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3731144.R56niFO833@rafael.j.wysocki
drivers/acpi/acpi_platform.c
drivers/acpi/scan.c