_pwrdm_save_...and_activate(9)
π¦ _pwrdm_save_...and_activate(9) β like, the Kernel API Manual bestie edition π
okay so quick intro before we get into it: this is a page from the Kernel API Manual, and the star of the show is _pwrdm_save_clkdm_state_and_activate. yes the header lowkey truncates it to _pwrdm_save_...and_activate(9) and honestly? everyone just calls it by the nickname, it's fine π«Ά
β¨ NAME β¨
_pwrdm_save_clkdm_state_and_activate β prepare for power state change πΈ
π SYNOPSIS π
u8 _pwrdm_save_clkdm_state_and_activate (struct powerdomain *pwrdm , u8
curr_pwrst , u8 pwrst );
like yes she returns a u8, no cap π
β ARGUMENTS β
pwrdmβ thestruct powerdomain *you're operating on. that's the main character here πcurr_pwrstβ the current power state ofpwrdm(where it's at right now, not where it's going)pwrstβ the power state you wanna switch to. the destination. the vibe. β¨
π DESCRIPTION π
so basically this function's whole job is to figure out whether the powerdomain needs to be turned on before anything even attempts to switch power states. like, vibe check first, state change second, iykyk. π₯
it's called by omap_set_pwrdm_state, so if you're tracing the call chain, that's your upstream bestie.
β οΈ okay important note, bestie, do NOT skip this one: NOTE that if the powerdomain contains multiple clockdomains, this code assumes that the first clockdomain supports software-supervised wakeup mode β which is potentially a problem. like, it's a real caveat, not me being dramatic. π
and it returns the power state switch mode currently in use β for the deets on that, see the "Types of sleep_switch" comment above. it's up there, go look, it's iconic. π
π§ SEE ALSO π§
the kernel file is ./arch/arm/mach-omap2/powerdomain.c, and literally all of these are family:
_pwrdm_register(9)_pwrdm_restore_clkdm_state(9)pwrdm_register_platform_funcs(9)pwrdm_register_pwrdms(9)pwrdm_complete_init(9)pwrdm_lock(9)pwrdm_unlock(9)pwrdm_lookup(9)pwrdm_for_each(9)pwrdm_add_clkdm(9)pwrdm_get_mem_bank_count(9)pwrdm_set_next_pwrst(9)pwrdm_read_next_pwrst(9)pwrdm_read_pwrst(9)pwrdm_read_prev_pwrst(9)pwrdm_set_logic_retst(9)pwrdm_set_mem_onst(9)pwrdm_set_mem_retst(9)pwrdm_read_logic_pwrst(9)pwrdm_read_prev_logic_pwrst(9)pwrdm_read_logic_retst(9)pwrdm_read_mem_pwrst(9)pwrdm_read_prev_mem_pwrst(9)pwrdm_read_mem_retst(9)pwrdm_clear_all_prev_pwrst(9)pwrdm_enable_hdwr_sar(9)pwrdm_disable_hdwr_sar(9)pwrdm_has_hdwr_sar(9)pwrdm_get_valid_lp_state(9)omap_set_pwrdm_state(9)pwrdm_save_context(9)pwrdm_restore_context(9)
and that's the whole page, bestie, you ate it up π β¨
cute little sign-off before you close the tab: this one lives under ./arch/arm/mach-omap2, dated October 2026, and it's the _pwrdm_save_...and_activate(9) page ππ¦ go forth and switch those power states responsibly π
π¦ 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