acpi_dev_pm_attach(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– acpi_dev_pm_attach(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” yes, that's the manual name, it's giving official, it's giving documentation-core, and we're about to make it make sense ✨


🌸 NAME 🌸

acpi_dev_pm_attach β€” get your device all cute and ready for ACPI power management πŸŽ€


✨ SYNOPSIS ✨

int acpi_dev_pm_attach (struct device *dev , bool power_on );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device you're preparing. the main character, honestly 🫢
  • power_on β€” a bool that literally just says whether or not we're powering the device on. yes or no, iconic behaviour πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

so here's the vibe: if dev has a valid ACPI handle, and that handle has a valid struct acpi_device object attached to it, then this function installs a wakeup notification handler for the device and adds it to the general ACPI PM domain. no cap, that's the whole move ✨

and if power_on is set, the device gets put into the ACPI D0 state before the function returns. so it's awake, it's refreshed, it's ready for its close-up πŸ‘‘

now the fine print, because we do read the fine print:

This assumes that dev's bus type uses generic power management callbacks (or doesn't use any power management callbacks at all). don't come for this function if your bus is doing its own custom thing 😭
Callers must ensure proper synchronization of this function with power management callbacks. fr fr, this one's on you β€” handle the sync, bestie, this function is not doing it for you πŸ™ˆ

🌈 SEE ALSO 🌈

the whole friend group, gathered for the group chat 🧚:

Kernel file ./drivers/acpi/device_pm.c β€” plus acpi_power_state_string(9), acpi_device_get_power(9), acpi_device_set_power(9), acpi_device_fix_up_power(9), acpi_device_fix_up_power_extended(9), acpi_device_fix_up_power_children(9), acpi_dev_power_up_children_with_adr(9), acpi_dev_power_state_for_wake(9), acpi_add_pm_notifier(9), acpi_remove_pm_notifier(9), acpi_dev_pm_get_state(9), acpi_pm_device_sleep_state(9), acpi_pm_notify_work_func(9), acpi_device_wakeup_enable(9), acpi_device_wakeup_disable(9), acpi_pm_set_device_wakeup(9), acpi_dev_pm_low_power(9), acpi_dev_pm_full_power(9), acpi_dev_suspend(9), acpi_dev_resume(9), acpi_subsys_runtime_suspend(9), acpi_subsys_runtime_resume(9), acpi_subsys_prepare(9), acpi_subsys_complete(9), acpi_subsys_suspend(9), acpi_subsys_suspend_late(9), acpi_subsys_suspend_noirq(9), acpi_subsys_resume_noirq(9), acpi_subsys_resume_early(9), acpi_subsys_resume(9), acpi_subsys_freeze(9), acpi_subsys_restore_early(9), acpi_subsys_poweroff(9), acpi_subsys_poweroff_late(9), acpi_subsys_poweroff_noirq(9), acpi_dev_pm_detach(9), acpi_storage_d3(9), acpi_dev_state_d0(9)


and that's the page, babe πŸ’œ sourcing from ./drivers/acpi, dated October 2026 β€” go forth and power-manage responsibly, mwah πŸ“πŸ’–

πŸ“¦ where this page comes from