__wrpll_calc_divq(9)
π __wrpll_calc_divq β the kernel API manual, but make it make sense
okay so bestie, welcome to the __wrpll_calc_divq(9) page β yes that's the whole function name, it's giving "my parents let the keyboard mash pick my name" but honestly? iconic. this is a Kernel API Manual entry and it's about figuring out one (1) number for a PLL. that's it. that's the vibe. π
β¨ NAME β¨
__wrpll_calc_divq β literally just: determine DIVQ based on target PLL output clock rate π«
like, the function's entire personality is "what should DIVQ be?" and honestly same.
πΈ SYNOPSIS πΈ
u8 __wrpll_calc_divq (u32 target_rate , u64 *vco_rate );
look at her. she takes two things and she gives you back a u8. no cap. π¦
π«Ά ARGUMENTS π«Ά
target_rateβ the target PLL output clock rate. this is the rate you want, the dream, the goal, the main character energy of the whole call πvco_rateβ a pointer to au64where the computed VCO rate gets stored. it's an out-param bestie, she writes into it π
π DESCRIPTION π
so here's what's happening: this function determines a reasonable value for the PLL Q post-divider, based on the target output rate target_rate for the PLL. that's the Q post-divider. yes. we love her. π₯
and it doesn't just do one thing β she's multi-talented (main character energy fr fr):
- it returns the computed Q divider value as the return value
- it also stores the desired target VCO rate into the variable pointed to by
vco_rate
two jobs, one function, ate and left no crumbs π
β CONTEXT β
any context. literally any. she's flexible like that π«
okay but the important part: the caller must protect the memory pointed to by vco_rate from simultaneous access or modification. like, no sharing without permission bestie, that's undefined-behavior territory and we don't do that here π
π RETURN π
- success β a positive integer DIVQ value, to be programmed into the hardware. slay, go program it π
- error β
0
and yes, 0 is the error signal specifically because 0 is an invalid DIVQ value. so if you see a zero coming back, that's not a divider, that's a "nope." π
π¦ SEE ALSO π¦
- Kernel file
./drivers/clk/analogbits/wrpll-cln28hpc.cβ the whole friend group lives here π __wrpll_calc_filter_range(9)__wrpll_calc_fbdiv(9)__wrpll_update_parent_rate(9)wrpll_configure_for_rate(9)wrpll_calc_output_rate(9)wrpll_calc_max_lock_us(9)
go read them all, iykyk πΈ
π and that's the page!! brought to you by./drivers/clk/analogbits, dated October 2026, filed under__wrpll_calc_divq(9)β stan the clock framework, mwah π§β¨
π¦ 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