STRUCT STM32_I2S_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct stm32_i2s_data ✨

okay bestie, welcome to the Kernel API Manual section 9 β€” yes, the fancy manpage shelf where all the kernel internals live πŸ’… this one's all about struct stm32_i2s_data, and no cap, it is the private data of I2S. like, the whole backstage dressing room of the thing πŸŽ€


🌸 NAME 🌸

struct stm32_i2s_data β€” private data of I2S. that's it, that's the whole vibe. it's the struct where the I2S driver keeps all its little secrets 🫢


πŸ’– SYNOPSIS πŸ’–

here's the whole cast, exactly as written, no edits, we do not touch the code 😌

struct stm32_i2s_data {
    const struct stm32_i2s_conf *conf;
    struct regmap *regmap;
    struct platform_device *pdev;
    struct snd_soc_dai_driver *dai_drv;
    struct snd_dmaengine_dai_dma_data dma_data_tx;
    struct snd_dmaengine_dai_dma_data dma_data_rx;
    struct snd_pcm_substream *substream;
    struct clk *i2sclk;
    struct clk *i2smclk;
    struct clk *pclk;
    struct clk *x8kclk;
    struct clk *x11kclk;
    void __iomem *base;
    dma_addr_t phys_addr;
    spinlock_t lock_fd;
    spinlock_t irq_lock;
    unsigned int mclk_rate;
    unsigned int fmt;
    unsigned int divider;
    unsigned int div;
    bool odd;
    bool i2s_clk_flg;
    int refcount;
    int ms_flg;
    int (*set_i2s_clk_rate)(struct stm32_i2s_data *i2s, unsigned int
rate);
    void (*put_i2s_clk_rate)(struct stm32_i2s_data *i2s);
 };

she's long, she's detailed, she's iconic πŸ‘‘


πŸ¦‹ Members πŸ¦‹

okay so now we go field by field, main character by main character β€” grab a snack, this is the fun part πŸ“

  • conf β€” I2S configuration pointer. this is the blueprint bestie, the config source of truth ✨
  • regmap β€” I2S register map pointer. all roads to the registers go through here.
  • pdev β€” device data pointer. the platform device's little home address 🏠
  • dai_drv β€” DAI driver pointer. the DAI driver, right there in pointer form.
  • dma_data_tx β€” dma configuration data for tx channel. transmit side, doing the most πŸ’…
  • dma_data_rx β€” dma configuration data for tx channel. and yes, fr fr, the page says tx channel here too πŸ™ˆ i'm not gaslighting you, that's just what's written.
  • substream β€” PCM substream data pointer. the substream hangs out here.
  • i2sclk β€” kernel clock feeding the I2S clock generator. the clock that feeds the clock generator, clocks all the way down πŸ•°οΈ
  • i2smclk β€” master clock from I2S mclk provider. mclk, provided by the mclk provider, as one does.
  • pclk β€” peripheral clock driving bus interface. this one drives the bus interface, lowkey essential 🚌
  • x8kclk β€” I2S parent clock for sampling frequencies multiple of 8kHz. the 8k family's parent clock 🎡
  • x11kclk β€” I2S parent clock for sampling frequencies multiple of 11kHz. and the 11k family's parent clock. equal treatment, we love to see it 🌈
  • base β€” mmio register base virtual address. the virtual address where the mmio registers start.
  • phys_addr β€” I2S registers physical base address. the physical address of those same I2S registers.
  • lock_fd β€” lock to manage race conditions in full duplex mode. full duplex said "let's race" and this lock said "not today" πŸ”’
  • irq_lock β€” prevent race condition with IRQ. keeps the IRQ from causing chaos.
  • mclk_rate β€” master clock frequency (Hz). in hertz, bestie, not vibes πŸ“
  • fmt β€” DAI protocol. literally just the DAI protocol.
  • divider β€” prescaler division ratio. the ratio, divvied up.
  • div β€” prescaler div field. the div field of the prescaler.
  • odd β€” prescaler odd field. the odd field of the prescaler. (she's a bool, she's quirky)
  • i2s_clk_flg β€” flag set while exclusivity on I2S kernel clock is active. exclusivity era πŸ’…
  • refcount β€” keep count of opened streams on I2S. one, two, three open streams, ah ah ah 🧚
  • ms_flg β€” master mode flag. note the period at the end, it's in the original, we respect it.
  • set_i2s_clk_rate β€” set I2S kernel clock rate. a function pointer that goes and sets it.
  • put_i2s_clk_rate β€” put I2S kernel clock rate. and its partner in crime, who puts it 🫱

πŸ”₯ SEE ALSO πŸ”₯

the receipts, go look at them yourself, iykyk:

  • Kernel file ./sound/soc/stm/stm32_i2s.c
  • struct stm32_i2s_conf(9)

ngl bestie this whole thing comes from ./sound/soc/stm and it's dated October 2026 β€” so yeah, that's the source, that's the version, that's the timestamp. struct stm32_i2s_data(9), out πŸ’œπŸ¦‹βœ¨ periodt.
πŸ“¦ where this page comes from