acpi_dev_state_d0(9)
π acpi_dev_state_d0 β a.k.a. the "is this device literally awake rn" check
okay bestie gather round, this is a kernel API manual page (acpi_dev_state_d0(9)) and it's genuinely so much less scary than it sounds, i promise π«Ά
β¨ NAME β¨
acpi_dev_state_d0 β tells you whether the device is in the D0 power state, no cap π€β‘οΈβ‘
πΈ SYNOPSIS πΈ
bool acpi_dev_state_d0 (struct device *dev );
π ARGUMENTS π
devβ the physical device whose ACPI power state you wanna check π like, this specific one, bestie.
π¦ DESCRIPTION π¦
So here's the tea β β the behaviour splits depending on whether your system even has ACPI:
- On a system without ACPI: it returns
true. That's it. Done. Slay. - On a system with ACPI: it returns
trueif the device's current ACPI power state is D0, andfalseotherwise. Simple as that π
β οΈ big important caveat, do not skip this one: the power state of a device is not well-defined after it's been passed to acpi_device_set_power and before that function returns. So it is not valid to ask for the ACPI power state of the device in that time frame. Like, the vibes are simply undefined in that window, bestie, don't do it π
This function is intended to be used in a driver's probe or remove function. For more info, see Documentation/firmware-guide/acpi/non-d0-probe.rst πβ¨
π₯ SEE ALSO π₯
Kernel file ./drivers/acpi/device_pm.c β and honestly the whole friend group shows up here, so:
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_dev_pm_attach(9)acpi_storage_d3(9)
and that's the whole page, bestie β go forth and check your power states responsibly π
π§ cute lil sign-off: this one lives in ./drivers/acpi, and the version you're reading is dated October 2026. periodt. β
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms