device_wakeup_attach(9)
π device_wakeup_attach β the Kernel API Manual, section 9, bestie π
okay so real quick before we dive in: this is device_wakeup_attach(9), straight out of the Kernel API Manual (section 9, the kernel-functions girlies). it lives in ./drivers/base/power and it's dated October 2026 β bookmark that, we'll circle back at the end π
β¨ NAME β¨
device_wakeup_attach β attach a wakeup source object to a device object. that's it, that's the whole vibe. it's giving "matchmaker, but for kernel structs" π«Ά
πΈ SYNOPSIS πΈ
int device_wakeup_attach (struct device *dev , struct wakeup_source *ws
);
yes bestie, it returns an int β don't ignore the return value, that's not very main character of you π
π¦ ARGUMENTS π¦
devβ the device to handle. this is the one getting the glow-up, the one we're attaching stuff to. literally the main character of this function call π₯wsβ the wakeup source object to attach todev. this is the accessory, the it-girl bag, the thing being clipped ontodev. so cunty of them both tbh β¨
π DESCRIPTION π
so what does this actually do, you ask? it causes dev to be treated as a wakeup device. that's the whole description. no cap, no extra lore, that's the sentence π
like β dev is now Officially A Wakeup Deviceβ’. it's been added to the roster. it's on the list. it has woken up and chosen β¨itselfβ¨. the wakeup source object ws is now attached to it, and from this moment forward the kernel treats dev as a thing that can wake stuff up π
lowkey iconic behaviour, highkey exactly what the name says. device_wakeup_attach attaches. dev + ws = attached. the math is mathing π§
π SEE ALSO π
okay bestie, buckle up, because the see-also list here is long β like, "she brought her whole group chat to the function" long π every single one of these, no skipping:
first up, the kernel file itself:
./drivers/base/power/wakeup.cβ literally the file this whole situation lives in. the mothership π
then the wakeup_source_* girlies:
wakeup_source_create(9)wakeup_source_destroy(9)wakeup_source_add(9)wakeup_source_remove(9)wakeup_source_register(9)wakeup_source_unregister(9)
the read-lock / walk girlies:
wakeup_sources_read_lock(9)wakeup_sources_read_unlock(9)wakeup_sources_walk_start(9)wakeup_sources_walk_next(9)
the device_wakeup_* fam (we're literally one of these, hiii π
):
device_wakeup_enable(9)device_wakeup_attach_irq(9)device_wakeup_detach_irq(9)device_wakeup_arm_wake_irqs(9)device_wakeup_disarm_wake_irqs(9)device_wakeup_detach(9)device_wakeup_disable(9)
the device_set_wakeup_* duo:
the wakeup source state girlies:
wakeup_source_not_usable(9)wakeup_source_activate(9)wakeup_source_report_event(9)wakeup_source_deactivate(9)
the pm_stay_awake / pm_relax sacred texts (note the double-underscore versions, do NOT come for me):
the pm_wakeup_* section:
pm_wakeup_timer_fn(9)pm_wakeup_ws_event(9)pm_wakeup_dev_event(9)pm_wakeup_pending(9)pm_get_wakeup_count(9)pm_save_wakeup_count(9)pm_wakep_autosleep_enabled(9)β yes it's spelledwakep, don't @ me, that's genuinely the name π€‘
the stats girlies:
and finally the bpf girlies, bringing up the rear:
that's 39 references and i listed every single one, because we don't do "etc." in this house π
ngl bestie, the entire documented behaviour of device_wakeup_attach is one sentence long. don't overthink it, don't over-read it. it attaches. it's attached. periodt π
okay so like β that's the whole page!! and before i go, huge huge shoutout to the source it came from: ./drivers/base/power, dated October 2026, delivered to you in the Kernel API Manual, section 9. she's built different, she's been here since before you were compiling, and honestly? we stan πβ¨π
bye bestie, go attach something π¦π
π¦ 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