STRUCT RK3X_I2C(9)
π 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 controllersoc_dataβ related soc data struct (chain of structs, iykyk)regsβ virtual memory area π§clkβ function clk for rk3399 or function & Bus clks for otherspclkβ Bus clk for rk3399 (only for rk3399, not everybody gets one π )clk_rate_nbβ i2c clk rate change notify π£irqβ irq numbertβ 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 formsgβ current i2c message πaddrβ addr of i2c target devicemodeβ mode of i2c transferis_last_msgβ flag determines whether it is the last msg in this transfer πstateβ state of i2c transferprocessedβ 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:
struct i2c_spec_values(9)struct rk3x_i2c_calced_timings(9)struct rk3x_i2c_soc_data(9)rk3x_i2c_start(9)rk3x_i2c_stop(9)rk3x_i2c_prepare_read(9)rk3x_i2c_fill_transmit_buf(9)rk3x_i2c_get_spec(9)rk3x_i2c_v0_calc_timings(9)rk3x_i2c_v1_calc_timings(9)rk3x_i2c_clk_notifier_cb(9)rk3x_i2c_setup(9)
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
- 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