STRUCT ALTR_I2C_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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 in msg. 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 β€” the xfer completion 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