pwrdm_clear_all_prev_pwrst(9)
β¨ pwrdm_clear_all_prev_pwrst(9) β¨
okay so this one lives in the Kernel API Manual and it's lowkey one of those tiny cleanup functions that saves your whole vibe check. it clears the previous powerstate register for a pwrdm. that's it. that's the whole assignment. and yet?? iconic. π
πΈ NAME πΈ
pwrdm_clear_all_prev_pwrst β clear the previous powerstate register for a pwrdm π§Ήβ¨
π SYNOPSIS π
int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm);
π¦ ARGUMENTS π¦
pwrdmβ astruct powerdomain *, aka the powerdomain you're about to wipe clean. this is the main character of the function, bestie π«Ά
π DESCRIPTION π
so basically you hand it a powerdomain and it clears that powerdomain's previous power state register β pwrdm. and when we say clears, we mean it clears the entire register, no crumbs left. π that includes both the logic previous power states and the memory bank previous power states. all of it. gone. slay.
return value tea β:
- if the powerdomain pointer is null β it returns
-EINVAL(rude, but fair) π - otherwise β it returns
0on success, which is the good ending π
ngl, always check for that -EINVAL before you start celebrating. null pointers are not the moment. π
π₯ SEE ALSO π₯
this function rolls deep, so here's the whole friend group β kernel file ./arch/arm/mach-omap2/powerdomain.c:
_pwrdm_register(9)_pwrdm_save_clkdm_state_and_activate(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_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're now officially fluent in clearing previous powerstates. go forth and be iconic π
source: ./arch/arm/mach-omap2 β dated October 2026, manual pwrdm_clear_all_prev_pwrst(9) π catch u in the next one π
π¦ 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