pm_clk_add_clk(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 calling clk_put on clk after 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