STRUCT CDNS_I2C(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… struct cdns_i2c(9) โ€” I2C device private data structure ๐ŸŽ€

okay bestie, welcome to the struct cdns_i2c(9) page from the Kernel API Manual โœจ we are in section 9, deep in kernel territory, and this is the I2C device private data structure. it's giving backstage-pass energy, and we are obsessed ๐Ÿ’– no field left behind, periodt.

โœจ NAME โœจ

struct cdns_i2c โ€” I2C device private data structure ๐ŸŒธ

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

       struct cdns_i2c {
           struct device           *dev;
           void __iomem *membase;
           struct i2c_adapter adap;
           struct i2c_msg *p_msg;
           int err_status;
           struct completion xfer_done;
           unsigned char *p_send_buf;
           unsigned char *p_recv_buf;
           unsigned int send_count;
           unsigned int recv_count;
           unsigned int curr_recv_count;
           unsigned long input_clk;
           unsigned int i2c_clk;
           unsigned int bus_hold_flag;
           struct clk *clk;
           struct notifier_block clk_rate_change_nb;
           struct reset_control *reset;
           u32 quirks;
           u32 ctrl_reg;
           struct i2c_bus_recovery_info rinfo;
         #if IS_ENABLED(CONFIG_I2C_SLAVE);
           u16 ctrl_reg_diva_divb;
           struct i2c_client *slave;
           enum cdns_i2c_mode dev_mode;
           enum cdns_i2c_slave_state slave_state;
         #endif;
           u32 fifo_depth;
           unsigned int transfer_size;
           bool atomic;
           int err_status_atomic;
        };

here's the whole struct in all its glory, bestie โ€” read it like a group-chat screenshot ๐Ÿซถ now let's meet every member one by one.

๐ŸŽ€ Members ๐ŸŽ€

  • dev โ€” pointer to the device structure ๐Ÿ 
  • membase โ€” base address of the I2C device ๐Ÿ“
  • adap โ€” I2C adapter instance ๐Ÿ”Œ
  • p_msg โ€” message pointer ๐Ÿ’Œ
  • err_status โ€” error status in Interrupt Status Register ๐Ÿ˜ญ
  • xfer_done โ€” transfer complete status โœ…
  • p_send_buf โ€” pointer to transmit buffer ๐Ÿ“ค
  • p_recv_buf โ€” pointer to receive buffer ๐Ÿ“ฅ
  • send_count โ€” number of bytes still expected to send ๐Ÿ”ข
  • recv_count โ€” number of bytes still expected to receive ๐Ÿงฎ
  • curr_recv_count โ€” number of bytes to be received in current transfer ๐ŸŽฏ
  • input_clk โ€” input clock to I2C controller โฐ
  • i2c_clk โ€” maximum I2C clock speed ๐Ÿš€
  • bus_hold_flag โ€” flag used in repeated start for clearing HOLD bit โœ‹
  • clk โ€” pointer to struct clk ๐Ÿ•ฐ๏ธ
  • clk_rate_change_nb โ€” notifier block for clock rate changes ๐Ÿ””
  • reset โ€” reset control for the device ๐Ÿ”„
  • quirks โ€” flag for broken hold bit usage in r1p10 ๐Ÿšฉ
  • ctrl_reg โ€” cached value of the control register. ๐Ÿ“
  • rinfo โ€” I2C GPIO recovery information ๐Ÿ›Ÿ
  • ctrl_reg_diva_divb โ€” value of fields DIV_A and DIV_B from CR register ๐Ÿงฎ
  • slave โ€” registered slave instance. ๐Ÿค
  • dev_mode โ€” I2C operating role(master/slave). ๐Ÿ‘‘
  • slave_state โ€” I2C Slave state(idle/read/write). ๐Ÿ’ค
  • fifo_depth โ€” the depth of the transfer FIFO ๐Ÿงบ
  • transfer_size โ€” the maximum number of bytes in one transfer ๐Ÿ“
  • atomic โ€” mode of transfer โš›๏ธ
  • err_status_atomic โ€” error status in atomic mode ๐Ÿ’ฅ

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

kernel file: ./drivers/i2c/busses/i2c-cadence.c ๐Ÿ“


mwah ๐Ÿ’‹ this page came from ./drivers/i2c/busses, dated October 2026, and it's the struct cdns_i2c(9) manpage from the Kernel API Manual โ€” byeee, go read some kernel source for me ๐Ÿ’œโœจ

๐Ÿ“ฆ where this page comes from