STRUCT ALTR_I2C_DEV(9)
Okay bestie, welcome to the Kernel API Manual β section 9 energy β where weβre decoding struct altr_i2c_dev and making it make sense π
β¨
π NAME π
struct altr_i2c_dev β the I2C device context. Thatβs the whole vibe: this struct is the little home base for an I2C deviceβs context π«Ά
πΈ SYNOPSIS πΈ
Hereβs the exact struct, no cap, every field kept safe and sound:
struct altr_i2c_dev {
void __iomem *base;
struct i2c_msg *msg;
size_t msg_len;
int msg_err;
struct completion msg_complete;
struct device *dev;
struct i2c_adapter adapter;
struct clk *i2c_clk;
u32 bus_clk_rate;
u8 *buf;
u32 fifo_size;
u32 isr_mask;
u32 isr_status;
struct mutex isr_mutex;
};
π Members π
Okay so hereβs the whole cast of this struct β every single one, none skipped π
baseβ pointer to the register struct. Like, the address-energy starting point β¨msgβ pointer to the current message. The message currently getting the spotlight π¨msg_lenβ number of bytes transferred inmsg. Byte count, very demure, very precise πmsg_errβ error code for a completed message. If something went off, this is where the tea is βmsg_completeβ thexfercompletion object. Completion object doing completion-object things π«devβ device reference. The device link-up π«Άadapterβ core i2c abstraction. The i2c core abstraction layer of it all πi2c_clkβ clock reference for the i2c input clock. Clock ref, iconic β°bus_clk_rateβ current i2c bus clock rate. The bus clockβs current rate, periodt πbufβ ptr to msg buffer for easier use. Buffer pointer, here to make life easier π§fifo_sizeβ size of the FIFO passed in. FIFO size, passed in, noted π¦isr_maskβ cached copy of local ISR enables. Cached local ISR enable copy, lowkey important π₯isr_statusβ cached copy of local ISR status. Cached local ISR status copy, also important πisr_mutexβ mutex for the IRQ thread. The IRQ threadβs mutex, keeping things from getting chaotic π
π₯ SEE ALSO π₯
- Kernel file
./drivers/i2c/busses/i2c-altera.cβ thatβs the one, bestie, go read it πβ¨
Catch you in the ./drivers/i2c/busses pages, dated October 2026 β struct altr_i2c_dev(9) out π
π
π¦ 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