pm_clk_add_clk(9)
π pm_clk_add_clk(9)
ok so bestie, welcome to the Kernel API Manual entry for pm_clk_add_clk(9) β this one's short and sweet and honestly kind of a vibe. it's all about telling the power management girlies that yes, this device clock is officially invited to the party π
β¨ NAME β¨
pm_clk_add_clk β start using a device clock for power management, bestie. that's it, that's the whole job π
πΈ SYNOPSIS πΈ
int pm_clk_add_clk (struct device *dev , struct clk *clk );
like, you hand it a dev and a clk and it gives you back an int. simple. iconic. no notes β¨
π¦ ARGUMENTS π¦
devβ the device whose clock is gonna be used for power management. this is the main character of the operation π«Άclkβ the clock pointer. literally just a pointer to the clock. that's it, that's the whole description π
π DESCRIPTION π
okay so what actually happens: this function adds the clock to the list of clocks that get used for the power management of dev. so like, it's joining the group chat π
now here's the part you actually need to remember, so listen up: the power-management code will take control of the clock reference. meaning once this function has successfully returned, the caller should not call clk_put on clk. it's not yours anymore, bestie. hands off. π
no cap, if you go callingclk_putonclkafter this returns successfully, that's you ignoring the entire point of the function. don't do it π
π SEE ALSO π
the kernel file is ./drivers/base/power/clock_ops.c β that's where all the lore lives π and here's the whole friend group, fr fr:
pm_clk_list_lock(9), pm_clk_list_unlock(9), pm_clk_op_lock(9), pm_clk_op_unlock(9), __pm_clk_enable(9), pm_clk_acquire(9), pm_clk_add(9), of_pm_clk_add_clks(9), __pm_clk_remove(9), pm_clk_remove_clk(9), pm_clk_init(9), pm_clk_create(9), pm_clk_destroy(9), pm_clk_suspend(9), pm_clk_resume(9), pm_clk_notify(9), enable_clock(9), disable_clock(9), pm_clk_notify(9), pm_clk_add_notifier(9)
(yes, pm_clk_notify(9) shows up twice. it's just that popular. we don't question it π
)
and that's the page!! this lil gem comes to you from ./drivers/base/power, dated October 2026, filed under pm_clk_add_clk(9). go forth and manage your clocks responsibly, bestie π§π
π¦ 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