STRUCT XIIC_I2C(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ struct xiic_i2c(9) πŸ’œ

okay so bestie, welcome to the Kernel API Manual ✨ β€” this one's all about struct xiic_i2c, which is literally the internal representation of the XIIC I2C bus. think of it as the backstage pass πŸŽ€ to how the driver keeps track of itself. no cap, it's a whole vibe.


🌸 SYNOPSIS 🌸

so here's the whole struct, and yes you're gonna want to read every line because it's all load-bearing, iykyk:

struct xiic_i2c {
    struct device *dev;
    void __iomem *base;
    struct completion completion;
    struct i2c_adapter adap;
    struct i2c_msg *tx_msg;
    struct mutex lock;
    unsigned int tx_pos;
    unsigned int nmsgs;
    struct i2c_msg *rx_msg;
    int rx_pos;
    enum xiic_endian endianness;
    struct clk *clk;
    int irq;
    enum xilinx_i2c_state state;
    bool singlemaster;
    bool dynamic;
    bool prev_msg_tx;
    u32 quirks;
    bool smbus_block_read;
    unsigned int smbus_actual_len;
    unsigned long input_clk;
    unsigned int i2c_clk;
    bool atomic;
    spinlock_t atomic_lock;
    enum xilinx_i2c_state atomic_xfer_state;
 };

πŸ¦‹ MEMBERS πŸ¦‹

okay this is the fun part β€” every single field, explained with the love and care it deserves πŸ’–

  • dev β€” pointer to the device structure 🫢
  • base β€” the memory base of the HW registers, that's where the hardware lives fr
  • completion β€” completion for callers, so the callers can chill until it's done
  • adap β€” the kernel adapter representation, main character energy ngl
  • tx_msg β€” messages from above that need to be sent πŸ’Œ
  • lock β€” mutual exclusion, keepin' things polite
  • tx_pos β€” current pos in the TX message, like a little cursor
  • nmsgs β€” number of messages in tx_msg
  • rx_msg β€” the current RX message
  • rx_pos β€” position within the current RX message
  • endianness β€” big/little-endian byte order πŸŒ€
  • clk β€” pointer to the AXI4-lite input clock ⏰
  • irq β€” interrupt number
  • state β€” see STATE_ πŸ‘€
  • singlemaster β€” indicates the bus is single master πŸ‘‘
  • dynamic β€” mode of the controller
  • prev_msg_tx β€” previous message is Tx
  • quirks β€” to hold platform specific bug info πŸ™ˆ (yes, a whole field for bug lore)
  • smbus_block_read β€” flag to handle block read
  • smbus_actual_len β€” valid byte count (length + payload + optional PEC) of a padded SMBus block read. msg->len is trimmed to this on completion. Zero when no trimming is needed. βœ‚οΈ
  • input_clk β€” input clock to the I2C controller
  • i2c_clk β€” the I2C SCL frequency 🌈
  • atomic β€” mode of transfer
  • atomic_lock β€” lock for atomic transfer mode πŸ”’
  • atomic_xfer_state β€” see STATE_ πŸ‘€ (yes, again β€” it's giving twin energy)

⭐ SEE ALSO ⭐

go check out the kernel file ./drivers/i2c/busses/i2c-xiic.c, plus struct timing_regs(9) and xiic_setclk(9) β€” all iconic, all worth your time 🧚


bestie reminder: nothing here is invented, this is all straight from the source, I would never do you like that πŸ’…

and that's a wrap! 🌸 this page came from ./drivers/i2c/busses, dated October 2026, and it's struct xiic_i2c(9) in the Kernel API Manual β€” slay, go read the actual kernel now, periodt πŸŽ€πŸ”₯

πŸ“¦ where this page comes from