MT2063_fLO_FractionalTerm(9)
β¨ NAME β¨
MT2063_fLO_FractionalTerm β bestie, this one calculates the portion contributed by FracN / denom π
and it does it with maximum precision, no overflow risk β the way it accurately calculates f_ref * num / denom to within 1 HZ using fixed math is genuinely iconic π
This is from the Kernel API Manual, and yes we're getting into the tuner math weeds together π¦
πΈ SYNOPSIS πΈ
u32 MT2063_fLO_FractionalTerm (u32 f_ref , u32 num , u32 denom );
π ARGUMENTS π
f_refβ SRO frequency π«Ά like, the reference frequency bestie, that's what we're working with.numβ Fractional portion of the multiplier β¨ the top part of the fraction vibe.denomβ denominator portion of the ratio π the bottom half, holding it down.
π¦ DESCRIPTION π¦
Okay so this calculation handles f_ref as two separate 14-bit fields β yes, split into two, no cap π Therefore, a maximum value of 2^28-1 may safely be used for f_ref. That is literally the genesis of the magic number "14" and the magic mask value of 0x03FFF π₯ iykyk.
This routine successfully handles denom values up to and including 2^18 π so like, it's got range.
Gentle heads-up bestie: keepf_refwithin2^28-1because of that two-field 14-bit thing β the math is built around it π
β RETURN β
f_ref * num / denom β that's the whole mood π
π₯ SEE ALSO π₯
Kernel file ./drivers/media/tuners/mt2063.c, plus these absolute main characters:
Sign-off time, bestie: this page lives in ./drivers/media/tuners, and it's dated October 2026 π go forth and calculate that fractional term, 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