STRUCT SUN4I_I2S_QUIRKS(9)
π struct sun4i_i2s_quirks(9) β the Kernel API Manual, bestie edition π
okay so first of all, this is a page from the Kernel API Manual, and the whole thing is literally just a big ol' struct called sun4i_i2s_quirks. no cap, it's the vibe-check struct for the sun4i i2s driver. π
β¨ NAME β¨
struct sun4i_i2s_quirks β Differences between SoC variants. that's it. that's the whole name. it's the "every SoC is a lil different" struct and honestly? iconic. π
πΈ SYNOPSIS πΈ
struct sun4i_i2s_quirks {
bool has_reset;
u64 pcm_formats;
unsigned int reg_offset_txdata;
const struct regmap_config *sun4i_i2s_regmap;
struct reg_field field_clkdiv_mclk_en;
struct reg_field field_fmt_wss;
struct reg_field field_fmt_sr;
unsigned int num_din_pins;
unsigned int num_dout_pins;
const struct sun4i_i2s_clk_div *bclk_dividers;
unsigned int num_bclk_dividers;
const struct sun4i_i2s_clk_div *mclk_dividers;
unsigned int num_mclk_dividers;
unsigned long (*get_bclk_parent_rate)(const struct sun4i_i2s *i2s);
int (*get_sr)(unsigned int width);
int (*get_wss)(unsigned int width);
int (*set_chan_cfg)(const struct sun4i_i2s *i2s, unsigned int channels, unsigned int slots, unsigned int slot_width);
int (*set_fmt)(const struct sun4i_i2s *i2s, unsigned int fmt);
};
like look at all those function pointers. main character energy fr fr. π₯
π¦ MEMBERS π¦
each of these is one field of the struct, and yes we are covering every single one, no skipping, we don't do that here:
has_resetβ tells you whether this SoC needs its reset deasserted. so like, if it's true, go deassert that reset bestie. βpcm_formatsβ the PCM formats that are available. the menu of formats, basically. πreg_offset_txdataβ the offset of the tx fifo. yes, the fifo. the tx one. that offset. πsun4i_i2s_regmapβ the regmap config to use. pointer to it, obviously. πfield_clkdiv_mclk_enβ a regmap field, and it enables mclk output. that's the whole job. β¨field_fmt_wssβ a regmap field that sets the word select size. wss = word select size, iykyk. πΈfield_fmt_srβ a regmap field that sets the sample resolution. sr = sample resolution, we love an abbreviation. πnum_din_pinsβ the input pins. that's it, that's the description. π«Άnum_dout_pinsβ the output pins, and ngl it's currently set but unused. so like, it's there, it's chilling, nobody's calling it. πbclk_dividersβ the bit clock dividers array. an array of them. πnum_bclk_dividersβ the number of bit clock dividers. the count. the quantity. π₯mclk_dividersβ the mclk dividers array. same energy, different clock. π¦num_mclk_dividersβ the number of mclk dividers. yes, again, the count. πget_bclk_parent_rateβ a callback to get the bclk parent rate. callback!! it's a function pointer, it does a thing. βget_srβ a callback to get the sample resolution. returns anint, takes awidth. πget_wssβ a callback to get the word select size. also returns anint, also takes awidth. πΈset_chan_cfgβ a callback to set the channel configuration. it's the big one β takes thei2sstruct pluschannels,slotsandslot_width. πset_fmtβ a callback to set the format. takes thei2sstruct and thefmt. π
π SEE ALSO π
- Kernel file
./sound/soc/sunxi/sun4i-i2s.cβ that's where all the real action lives, go read it bestie. π
lowkey reminder: this whole struct is just the differences between SoC variants, so if something behaves differently on your board than on someone else's, it's probably one of these fields being extra. π
and that's the page!! it lives in ./sound/soc/sunxi, it's dated October 2026, and the manual page itself is titled struct sun4i_i2s_quirks(9) β okay bye bestie, go deassert some resets πβ¨ππ¦
π¦ 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