UNION I2C_CMD_BASE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… union i2c_cmd_base ✨ <small>Kernel API Manual</small>

okay so bestie, gather round 🫢 this is union i2c_cmd_base from the Kernel API Manual, and it is exactly what it sounds like: a union that lets you poke at C2P commands bit by bit. that's it, that's the vibe. no cap, it's giving "tiny little bitfield icon" πŸ”₯


🌸 NAME 🌸

union i2c_cmd_base β€” bit access of C2P commands πŸ’«


✨ SYNOPSIS ✨

union i2c_cmd_base {
    u32 ul;
    struct {
      enum i2c_cmd i2c_cmd : 4;
      u8 bus_id : 4;
      u32 slave_addr : 8;
      u32 length : 12;
      enum speed_enum i2c_speed : 3;
      enum mem_type mem_type : 1;
    } s;
 };

so you've got two ways to look at the same thing, and they overlap on purpose πŸ’…

  • u32 ul β€” the whole thing as one raw 32-bit word, one chunky little unit, main character energy πŸ‘‘
  • struct s β€” the same bits, sliced up into fields βœ‚οΈ literally the "both? both. both is good" meme

and the slices inside s? let's count the bits together, it's a whole thing 🧚:

  • enum i2c_cmd i2c_cmd : 4 β€” 4 bits of <mint>i2c_cmd</mint>
  • u8 bus_id : 4 β€” 4 bits of <mint>bus_id</mint> (a u8, yes, with 4 bits, the page said what it said πŸ™ˆ)
  • u32 slave_addr : 8 β€” 8 bits of <mint>slave_addr</mint>
  • u32 length : 12 β€” 12 bits of <mint>length</mint>, the biggest slice, she ate πŸ’€
  • enum speed_enum i2c_speed : 3 β€” 3 bits of <mint>i2c_speed</mint>
  • enum mem_type mem_type : 1 β€” a whole 1 bit of <mint>mem_type</mint>, tiny but iconic πŸŽ€

that's 4 + 4 + 8 + 12 + 3 + 1 = the 32 you already met in ul 🌈 cute when math works out.


πŸŽ€ MEMBERS πŸŽ€

so the Members heading is literally up in the original page and then… nothing. no entries. just vibes and empty space 🫠 bestie i'm not gonna lie to you and make stuff up β€” the only member info you're getting is the ul / s situation spelled out in the struct above ⭐ everything literal lives in the SYNOPSIS, periodt.


πŸ¦‹ SEE ALSO πŸ¦‹

like, go look at these, they're the friend group πŸ’œ

  • Kernel file ./drivers/i2c/busses/i2c-amd-mp2.h πŸ“
  • union i2c_event(9)
  • struct amd_i2c_common(9)
  • struct amd_mp2_dev(9)
side note: yes, all of these live in ./drivers/i2c/busses β€” same neighborhood, same friend group, iykyk πŸ¦‹

and that's the whole page, bestie 🫢 the source path is ./drivers/i2c/busses, it's dated October 2026, and it's filed under union i2c_cmd_base(9) β€” slay, go read a struct, ily πŸ˜­πŸ’–πŸŽ€

πŸ“¦ where this page comes from