STRUCT STM32_I2S_DATA(9)
β¨ 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 abool, 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/stmand it's datedOctober 2026β so yeah, that's the source, that's the version, that's the timestamp. structstm32_i2s_data(9), out ππ¦β¨ periodt.
π¦ 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