STRUCT SDMA_PERIPHERAL_CONFIG(9)
β¨ struct sdma_peripheral_config(9) β¨
okay so bestie, welcome to the Kernel API Manual π this one's a struct page and honestly it's kind of a baddie β it's literally the little note you pass to the SDMA engine so it knows how many channels are doing the thing. let's get into it π
πΈ NAME πΈ
struct sdma_peripheral_config β the SDMA config for audio, no cap π§
π¦ SYNOPSIS π¦
struct sdma_peripheral_config {
int n_fifos_src;
int n_fifos_dst;
int stride_fifos_src;
int stride_fifos_dst;
int words_per_fifo;
bool sw_done;
};
that's the whole vibe right there β six fields, all iconic, all necessary π
π Members π
n_fifos_srcβ how many FIFOs are doing the recording πΈ this is the mic side, iykyk.n_fifos_dstβ how many FIFOs are doing the playback π₯ the speaker side, main character energy fr fr.stride_fifos_srcβ the FIFO address stride for recording. so like,0means all the FIFOs are continuous (one big happy family π«Ά), and1means there's a 1 word stride between FIFOs. and bestie, listen β all the strides between FIFOs should be the same. don't be chaotic about it πstride_fifos_dstβ the FIFO address stride for playback. same deal, other direction πwords_per_fifoβ the number of words per FIFO fetch/fill.1means one channel per FIFO,2means 2 channels per FIFO.. ok so picture this: if'n_fifos_src = 4'and'words_per_fifo = 2', that means the first two words (channels) fetch from FIFO0 and then it jumps to FIFO1 for the next two words, and so on β and after the last FIFO3 gets fetched, it rolls back around to FIFO0 π it's giving carousel, it's giving round-robin, it's giving β¨graceful wraparoundβ¨sw_doneβ use software done. Needed for PDM (micfil) β οΈ like, actually needed, not optional-vibes. so if you're on micfil, don't skip it π
π« Description π«
so here's the lore π β some i.MX Audio devices (SAI, micfil) have multiple successive FIFO registers. for multichannel recording/playback, the SAI/micfil have one FIFO register per channel, and the SDMA engine has to read/write the next channel from/to the next register, and then wrap around to the first register when all the channels are handled π
and the number of active channels must be communicated to the SDMA engine using this struct. like, that's the whole point of it, that's its job, that's its moment π
π§ SEE ALSO π§
- Kernel file
./include/linux/dma/imx-dma.hβ go read it, bestie, it's right there π
lowkey a reminder: sw_done is needed for PDM (micfil). this isn't a "maybe" situation, it's a "you will absolutely need this" situation π
and that's the page!! source is ./include/linux/dma, dated October 2026 β periodt, slay, go handle your channels correctly π
ππ¦
π¦ 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