snd_soc_dai_set_tdm_slot(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… snd_soc_dai_set_tdm_slot(9)

okay so bestie, this is a page from the Kernel API Manual and it's about snd_soc_dai_set_tdm_slot β€” literally the glow-up your DAI needs to go full TDM mode ✨ grab a strawberry drink and let's get into it πŸ“


✨ NAME ✨

snd_soc_dai_set_tdm_slot β€” configures a DAI for TDM operation πŸŽ€


🌸 SYNOPSIS 🌸

int snd_soc_dai_set_tdm_slot (struct snd_soc_dai *dai , unsigned int
tx_mask , unsigned int rx_mask , int slots , int slot_width );

no cap, that's the whole signature β€” five args, one int coming back at you πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dai β€” the DAI you're configuring, i.e. the main character of this whole function πŸ‘‘
  • tx_mask β€” bitmask representing active TX slots πŸ”₯
  • rx_mask β€” bitmask representing active RX slots 🌈
  • slots β€” number of slots in use
  • slot_width β€” width in bits for each slot πŸ“

🧚 DESCRIPTION 🧚

so this function configures the DAI you passed in for TDM operation, periodt ✨

slot contains the total number of slots of the TDM stream, and slot_with the width of each slot in bit clock cycles 🌸 (yes, the manual literally writes slot_with there β€” not me, not fixing it, copying it exactly, iykyk πŸ’€).

tx_mask and rx_mask are bitmasks specifying the active slots of the TDM stream for the specified DAI β€” as in, which slots the DAI should write to or read from 🫢. The bit rules, bestie, are giving extremely clean logic:

  • if a bit is set, the corresponding slot is active βœ…
  • if a bit is cleared, the corresponding slot is inactive ❌
  • bit 0 maps to the first slot, bit 1 to the second slot, and so on πŸ”’
  • the first active slot maps to the first channel of the DAI, the second active slot to the second channel, and so on 🎯
🚨 and here's the escape hatch: TDM mode can be disabled by passing 0 for slots. In this case tx_mask, rx_mask and slot_width will be ignored β€” like, fully ignored, don't even worry about them πŸ™ˆ

returns 0 on success, a negative error code otherwise 😭 (so 0 = slay, negative = not slay)


πŸ’œ SEE ALSO πŸ’œ

kernel file ./sound/soc/soc-dai.c plus the whole friend group bestie:


and that's the page babes πŸŽ€ this lil manual lives at ./sound/soc and it's dated October 2026 β€” screenshot it, cite it, cite me, mwah πŸ’‹ go configure some slots πŸ¦‹βœ¨

πŸ“¦ where this page comes from