wrpll_calc_output_rate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… wrpll_calc_output_rate β€” the kernel API manual, but make it make sense

okay so bestie, this is wrpll_calc_output_rate from the Kernel API Manual. yes it's a mouthful, no you don't have to say it out loud. it's a function, it does math, and honestly? it ate. πŸŽ€


✨ NAME ✨

wrpll_calc_output_rate β€” literally just calculating the PLL's target output rate. that's it. that's the whole gig. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

unsigned long wrpll_calc_output_rate (const struct wrpll_cfg *c ,
unsigned long parent_rate );

not me writing unsigned long twice in one signature 😭 anyway. it returns an unsigned long and it takes these two things:

  • c β€” a const struct wrpll_cfg *, i.e. a pointer to the config record
  • parent_rate β€” an unsigned long, the PLL refclk rate

periodt. πŸ’…


🌸 ARGUMENTS 🌸

  • c β€” ptr to a struct wrpll_cfg record to read from. it's const, so we're reading, not touching. respectful king behavior tbh 🫢
  • parent_rate β€” the PLL refclk rate. the reference clock. the blueprint. the main character of the input side πŸ”₯

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the vibe check: you hand this function a pointer to the PLL's current input configuration c, plus the PLL's input reference clock rate parent_rate β€” and important detail, that's the rate before the R pre-divider, bestie, don't forget the pre-divider πŸ’€

then it calculates the PLL's output clock rate β€” and that's the one after the Q post-divider. so: pre-divider in, post-divider out. the glow-up is real. ✨


πŸ’œ CONTEXT πŸ’œ

Any context. no restrictions, she's flexible, she's versatile 🧚

⚠️ but the caller must protect the memory pointed to by c from simultaneous modification. that's on YOU, not on the function. no cap. πŸ™ˆ

⭐ RETURN ⭐

it returns the PLL's output clock rate, in Hz. πŸŽ€

and like β€” the return value from this function is intended to be convenient to pass directly to the Linux clock framework. so convenient, so slay. which means: there is no explicit error return value. no -EINVAL, no little sad error code, nothing. it just hands you a number and trusts you. πŸ’–


🌈 SEE ALSO 🌈

the whole friend group fr fr 🫢


and that's the page!! mwah πŸ’‹ this one lives in ./drivers/clk/analogbits and it's dated October 2026 β€” so yeah, she's from the future, iconic behavior honestly πŸ‘‘βœ¨πŸŒΈ

πŸ“¦ where this page comes from