calc_rate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… calc_rate(9) β€” a Kernel API Manual moment πŸ’…

Okay bestie, welcome to the Kernel API Manual; this page is all about calc_rate(9). Grab your iced coffee, we're doing clock math. πŸ§‹βœ¨

🌸 NAME 🌸

calc_rate β€” calculate rate based on m/n:d values. That's the whole vibe. πŸ’–

✨ SYNOPSIS ✨

       unsigned long calc_rate (unsigned long rate , u32 m , u32 n , u32 mode ,
       u32 hid_div );

No cap, that's the signature. πŸ“

πŸŽ€ ARGUMENTS πŸŽ€

  • rate β€” the parent rate. πŸ’«
  • m β€” the multiplier. ⭐
  • n β€” the divisor</div> 🌈
  • mode β€” use zero to ignore the m/n calculation. Yes, 0 = "not today, m/n." πŸ’…
  • hid_div β€” the pre divisor register value. The pre divisor value relates to hid_div as pre_div = (hid_div + 1) / 2. That relation is iconic, memorize it. 🫢

πŸ”₯ DESCRIPTION πŸ”₯

This function returns the calculated rate according to this formula:

       parent_rate     m
       rate = ----------- x  ---
              pre_div       n

So it's literally parent_rate over pre_div, times m over n. Math ate, periodt. πŸ“

πŸ¦‹ SEE ALSO πŸ¦‹

Go read those next, bestie β€” the lore continues. πŸ“šβœ¨


This page is brought to you by the ./drivers/clk/qcom source/version, dated October 2026 β€” calc_rate(9), signing off πŸ’œπŸŽ€

πŸ“¦ where this page comes from