STRUCT CODEC_PRIV(9)
π struct codec_priv β CODEC private data π
okay bestie, so this is a page from the Kernel API Manual (section 9, kernel API stuff) and it's literally just one little struct that holds all the private CODEC data. tiny struct, big main-character energy. let's get into it π
β¨ NAME β¨
struct codec_priv β the CODEC private data struct. that's it, that's the vibe. π
πΈ SYNOPSIS πΈ
here's the whole thing, copy-paste ready, no cap:
struct codec_priv {
unsigned long mclk_freq;
unsigned long free_freq;
u32 mclk_id;
int fll_id;
int pll_id;
int pll_ratio_s24;
};
like, six fields. six. iconique. π
π¦ Members π¦
okay so let's go through every single one because we don't skip anything in this house:
mclk_freqβ the clock rate of MCLK. that's the master clock frequency, periodt. β°free_freqβ the clock rate of MCLK forhw_free. yes, it gets its own separate rate for when the hardware is being freed. lowkey thoughtful. π«Άmclk_idβ the MCLK (or main clock) id forset_sysclk. this is how you tell it which main clock you mean. π₯fll_idβ the FLL (or secondary clock) id forset_sysclk. same deal but for the FLL / secondary clock situation. β¨pll_idβ the PLL id forset_pll. yup, PLLs get an id too. πpll_ratio_s24β the PLL output ratio forS24_LEformat, and the math is literallyPLL_freq = sample_rate Γ ratio. the default is384, but some codecs (e.g.WM8904) need lower values so they stay within the PLL frequency limits. so like, don't just assume 384 is always the move, bestie β check your codec. π
ngl the pll_ratio_s24 one is the one that'll get you. it's giving "default is fine until it isn't." π©·
β SEE ALSO β
go look at these if you want the full lore, iykyk:
- Kernel file
./sound/soc/fsl/fsl-asoc-card.c struct cpu_priv(9)struct fsl_asoc_card_priv(9)
and that's the whole page, bestie, we ate and left no crumbs ππ
this little gem lives in ./sound/soc/fsl and it's dated October 2026 πΈ β mwah, go forth and configure your clocks responsibly β¨π§
π¦ 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