STRUCT RK3X_I2C(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct rk3x_i2c(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual ✨ β€” this is the page for struct rk3x_i2c, and we're about to get so into it. no cap, this struct is the main character of the Rockchip I2C controller world πŸ‘‘


🌸 NAME 🌸

struct rk3x_i2c β€” literally just the private data of the controller 🫢 that's it, that's the whole vibe check.


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole glow-up, exactly as it lives in the kernel:

struct rk3x_i2c {
    struct i2c_adapter adap;
    struct device *dev;
    const struct rk3x_i2c_soc_data *soc_data;
    void __iomem *regs;
    struct clk *clk;
    struct clk *pclk;
    struct notifier_block clk_rate_nb;
    int irq;
    struct i2c_timings t;
    spinlock_t lock;
    wait_queue_head_t wait;
    bool busy;
    struct i2c_msg *msg;
    u8 addr;
    unsigned int mode;
    bool is_last_msg;
    enum rk3x_i2c_state state;
    unsigned int processed;
    int error;
 };

like, look at her. so organized. so structured. we stan πŸ’œ


πŸ¦‹ MEMBERS πŸ¦‹

every single field, one by one, no skips, no cuts, we're doing the full tour bestie πŸ’–

  • adap β€” the corresponding I2C adapter 🌈
  • dev β€” device for this controller
  • soc_data β€” related soc data struct (chain of structs, iykyk)
  • regs β€” virtual memory area 🧚
  • clk β€” function clk for rk3399 or function & Bus clks for others
  • pclk β€” Bus clk for rk3399 (only for rk3399, not everybody gets one πŸ’…)
  • clk_rate_nb β€” i2c clk rate change notify πŸ“£
  • irq β€” irq number
  • t β€” I2C known timing information ⭐
  • lock β€” spinlock for the i2c bus πŸ”’
  • wait β€” the waitqueue to wait for i2c transfer ⏳
  • busy β€” the condition for the event to wait for
  • msg β€” current i2c message πŸ’Œ
  • addr β€” addr of i2c target device
  • mode β€” mode of i2c transfer
  • is_last_msg β€” flag determines whether it is the last msg in this transfer 🏁
  • state β€” state of i2c transfer
  • processed β€” byte length which has been send or received (yes, "send" β€” we don't touch the original wording, periodt)
  • error β€” error code for i2c transfer 😭

πŸ‘‘ SEE ALSO πŸ‘‘

go read the Kernel file ./drivers/i2c/busses/i2c-rk3x.c β€” that's the mothership πŸ›Έ and then these icons too, fr fr:

like, the whole friend group πŸ’œ go say hi.


πŸ’€ reminder that this page is a snapshot from ./drivers/i2c/busses, dated October 2026 β€” so if the kernel's moved on since then, that's a you problem bestie, check the source πŸ™ˆ

and that's the page!! mwah πŸ’‹ go forth and I2C πŸ¦‹βœ¨

πŸ“¦ where this page comes from