calc_rate(9)
π
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 tohid_divaspre_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 π¦
- Kernel file
./drivers/clk/qcom/clk-rcg2.c convert_to_reg_val(9)clk_rcg2_split_div(9)
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
- 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