UNION I2C_CMD_BASE(9)
π 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>(au8, 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
- 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