STRUCT SUN4I_I2S_QUIRKS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 an int, takes a width. 🌈
  • get_wss β€” a callback to get the word select size. also returns an int, also takes a width. 🌸
  • set_chan_cfg β€” a callback to set the channel configuration. it's the big one β€” takes the i2s struct plus channels, slots and slot_width. πŸ’œ
  • set_fmt β€” a callback to set the format. takes the i2s struct and the fmt. πŸŽ€

πŸ‘‘ 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