si570_calc_divs(9)
π NAME π
si570_calc_divs β the little function that does your clock divider math for you, bestie β¨
Oh, and real quick β this page lives in the Kernel API Manual, so you know it's the real deal. π
π¦ SYNOPSIS π¦
int si570_calc_divs (unsigned long frequency , struct clk_si570 *data ,
u64 *out_rfreq , unsigned int *out_n1 , unsigned int *out_hs_div );
Like, that's the whole vibe right there. Five args, one int back. Iconic.
πΈ ARGUMENTS πΈ
Okay so here's the rundown on each one, no cap:
frequencyβ the target frequency you're aiming for. The dream. The goal. Your main character number. π₯dataβ the driver data structure. It's astruct clk_si570, and yes you must bring it, it's not optional. π€out_rfreqβ the RFREG fractional multiplier, and heads up, this one's an output π (it's au64 *, so it writes back into whatever you point at).out_n1β Clock divider N1, also an output β¨ (unsigned int *, get those pointers ready).out_hs_divβ Clock divider HSDIV, another output π«Ά (alsounsigned int *).
And bestie, listen βout_hs_divcarries the return info too: Returns0on success, negativeerrnootherwise. So check it. Fr fr. π
π DESCRIPTION π
So what does it actually do? It calculates the clock dividers (out_hs_div, out_n1) and the clock multiplier (out_rfreq) for a given target frequency. That's it. That's the whole job. And honestly? It ate. π
Like, you hand it a frequency, it does the math on the dividers and the multiplier, and it drops the answers into your output pointers. Respect the pipeline. π
β SEE ALSO β
Go read these next, iykyk:
- The kernel file
./drivers/clk/clk-si570.cβ that's where the source lives, go peek π struct clk_si570_info(9)struct clk_si570(9)si570_get_divs(9)si570_get_defaults(9)si570_update_rfreq(9)si570_set_frequency(9)si570_set_frequency_small(9)
That's the page, babes π
This lil' slice of kernel API manual goodness came from ./drivers/clk, dated October 2026 β and it's called si570_calc_divs(9), in case you forgot already π. Go calculate some dividers, you've got this ππβ¨
π¦ 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