STRUCT CODEC_PRIV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 for hw_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 for set_sysclk. this is how you tell it which main clock you mean. πŸ”₯
  • fll_id β€” the FLL (or secondary clock) id for set_sysclk. same deal but for the FLL / secondary clock situation. ✨
  • pll_id β€” the PLL id for set_pll. yup, PLLs get an id too. πŸ’œ
  • pll_ratio_s24 β€” the PLL output ratio for S24_LE format, and the math is literally PLL_freq = sample_rate Γ— ratio. the default is 384, 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