acpi_dev_state_d0(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 true if the device's current ACPI power state is D0, and false otherwise. 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:


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