si570_calc_divs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 a struct 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 a u64 *, 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 🫢 (also unsigned int *).
And bestie, listen β€” out_hs_div carries the return info too: Returns 0 on success, negative errno otherwise. 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:


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