lmk04832_calc_pll2_params(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… lmk04832_calc_pll2_params β€” the Kernel API Manual moment πŸŽ€

okay so bestie, this is a page straight out of the Kernel API Manual, and it's literally about getting your PLL2 parameters so the VCO frequency can be set. no cap, it's a whole function. let's get into it ✨


🌸 NAME 🌸

lmk04832_calc_pll2_params β€” get the PLL2 parameters that are used to set the VCO frequency. that's it, that's the vibe 🫢


⭐ SYNOPSIS ⭐

long lmk04832_calc_pll2_params (unsigned long prate , unsigned long rate
, unsigned int *n , unsigned int *p , unsigned int *r );

yep, she returns a long. noted. moving on πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • prate β€” the parent rate feeding into PLL2, usually OSCin. your starting point, bestie ✨
  • rate β€” the desired output rate for the VCO. what you want, the dream 🎯
  • n β€” a reference to PLL2_N. hand over the pointer, get the value πŸ‘‘
  • p β€” a reference to PLL2_P. same deal πŸ’…
  • r β€” a reference to PLL2_R. third one, iconic trio πŸŽ€

πŸ”₯ DESCRIPTION πŸ”₯

so this function assumes LMK04832_BIT_PLL2_MISC_REF_2X_EN is set β€” and honestly it should be, because the datasheet recommends it. the way that a higher phase detector frequency makes designing wider loop bandwidth filters possible?? obsessed. that's the whole reason, fr fr πŸ’œ

the VCO rate can be calculated using the following expression:

VCO = OSCin * 2 * PLL2_N * PLL2_P / PLL2_R

write it down, screenshot it, tattoo it, idc β€” it's giving main character math 🌈


πŸ’€ RETURN πŸ’€

the vco rate, or a negative errno if things go sideways. lowkey important to check which one you got πŸ™ˆ


🧚 SEE ALSO 🧚


πŸ’– that's the whole page bestie. all the facts, none of the boring. slay.

and finally, a cute little sign-off for the footer: this one lives under ./drivers/clk, dated October 2026, and it's titled lmk04832_calc_pll2_params(9) β€” periodt πŸ‘‘πŸ’…

πŸ“¦ where this page comes from