acpi_device_sleep_wake(9)
π€ acpi_device_sleep_wake(9) π€
okay so bestie, welcome to acpi_device_sleep_wake β it's a Kernel API Manual page, section 9, and it's literally all about poking your device's sleep/wake vibes into place. let's go π«Ά
β¨ NAME β¨
acpi_device_sleep_wake β executes _DSW (Device Sleep Wake), or the lowkey deprecated-in-ACPI-3.0 _PSW (Power State Wake). that's the whole mission, no cap π
πΈ SYNOPSIS πΈ
int acpi_device_sleep_wake (struct acpi_device *dev , int enable , int
sleep_state , int dev_state );
π ARGUMENTS π
devβ the device you're handling. the main character of this whole function, fr.enableβ0disables,1enables the wake capabilities of the device. simple as that, bestie. β¨sleep_stateβ the target sleep state of the system. iykyk.dev_stateβ the target power state of the device. π¦
π DESCRIPTION π
so what it does is: it executes _DSW (Device Sleep Wake) β or _PSW (Power State Wake), which is deprecated in ACPI 3.0, just so we're clear π«Ά β for the device, if present.
β οΈ if it fails, it resets the device's wakeup.flags.valid flag. like, resets it to invalid. that's the cleanup, no notes.
π RETURN VALUE π
0β if either_DSWor_PSWhas been successfully executed0β if neither_DSWnor_PSWhas been found (yes, also zero, that's not a typo, that's the manpage π)-ENODEVβ if the execution of either_DSWor_PSWhas failed π
π₯ SEE ALSO π₯
- kernel file
./drivers/acpi/power.cβ that's where the magic lives acpi_device_power_add_dependent(9)acpi_device_power_remove_dependent(9)acpi_turn_off_unused_power_resources(9)
π§ and that's the page! go forth and wake your devices responsibly, bestie π
source: ./drivers/acpi β dated October 2026 β the whole thing is filed under acpi_device_sleep_wake(9), 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