STRUCT TEGRA_I2C_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct tegra_i2c_dev(9) β€” the kernel API manual, bestie edition ✨

okay so this page is from the Kernel API Manual, and it's literally all about struct tegra_i2c_dev β€” the per device I2C context. yes, that's a whole struct of I2C vibes. let's get into it πŸŽ€


πŸ¦‹ NAME πŸ¦‹

struct tegra_i2c_dev β€” per device I2C context. that's it, that's the whole name. main character energy fr.


✨ SYNOPSIS ✨

here she is in all her glory, no cap, copy-pasted exactly:

struct tegra_i2c_dev {
    struct device *dev;
    struct i2c_adapter adapter;
    const struct tegra_i2c_hw_feature *hw;
    unsigned int cont_id;
    unsigned int irq;
    phys_addr_t base_phys;
    void __iomem *base;
    struct clk_bulk_data clocks[2];
    unsigned int nclocks;
    struct clk *div_clk;
    struct i2c_timings timings;
    struct completion msg_complete;
    size_t msg_buf_remaining;
    unsigned int msg_len;
    int msg_err;
    u8 *msg_buf;
    struct completion dma_complete;
    struct dma_chan *dma_chan;
    unsigned int dma_buf_size;
    struct device *dma_dev;
    dma_addr_t dma_phys;
    void *dma_buf;
    bool multimaster_mode;
    bool is_mctp;
    bool atomic_mode;
    bool dma_mode;
    bool msg_read;
 };

look at all those fields 😭 she's stunning. now let's meet every single member one by one, because we do not skip members here πŸ’–


🌸 Members 🌸

  • dev β€” device reference for power management. like the parent who signs the permission slip 🫢
  • adapter β€” core I2C layer adapter information. the actual I2C-ness of it all.
  • hw β€” Tegra I2C HW feature. the hardware tea β˜•
  • cont_id β€” I2C controller ID, used for packet header. literally the controller's name tag 🏷️
  • irq β€” IRQ number of transfer complete interrupt. the "we're done here!" buzzer πŸ””
  • base_phys β€” physical base address of the I2C controller. the real physical address, no fake vibes.
  • base β€” ioremapped registers cookie. yes, the manpage calls it a cookie πŸͺ iconic honestly.
  • clocks β€” array of I2C controller clocks. it's an array, clock besties πŸ•
  • nclocks β€” number of clocks in the array. gotta know how many clocks are clocking.
  • div_clk β€” clock reference for div clock of I2C controller. the divider clock, slaying divider duties.
  • timings β€” i2c timings information like bus frequency. all the timing deets, so punctual ✨
  • msg_complete β€” transfer completion notifier. the "message sent!!" notification πŸ’Œ
  • msg_buf_remaining β€” size of unsent data in the message buffer. how much message is still waiting to go out 😀
  • msg_len β€” length of message in current transfer. the current transfer's message length, periodt.
  • msg_err β€” error code for completed message. when the message says "well that happened" πŸ’€
  • msg_buf β€” pointer to current message data. pointing right at the message data, iykyk.
  • dma_complete β€” DMA completion notifier. the DMA version of "we're so back" πŸŽ€
  • dma_chan β€” DMA channel. the channel. the DMA one.
  • dma_buf_size β€” DMA buffer size. how big the DMA buffer is, obviously πŸ’…
  • dma_dev β€” DMA device used for transfers. the device doing the DMA transferring.
  • dma_phys β€” handle to DMA resources. handles to the DMA resources, held gently 🫢
  • dma_buf β€” pointer to allocated DMA buffer. pointing at the buffer we allocated, slay.
  • multimaster_mode β€” indicates that I2C controller is in multi-master mode. multiple masters, honestly chaotic but we love her 🌈
  • is_mctp β€” indicates that the I2C controller is used as an MCTP controller. MCTP mode: active or not, that's the question.
  • atomic_mode β€” indicates active atomic transfer. atomic transfer currently active, lowkey powerful ⭐
  • dma_mode β€” indicates active DMA transfer. DMA transfer currently active, highkey fast πŸ”₯
  • msg_read β€” indicates that the transfer is a read access. it's a read!! πŸ“–

πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./drivers/i2c/busses/i2c-tegra.c struct tegra_i2c_hw_feature(9)

go read those too bestie, they're the supporting cast πŸ’œ


🧚 Sign-off 🧚

this lil page lives in ./drivers/i2c/busses, and the version tag says October 2026 β€” so yeah, future vibes ✨. mwah, go forth and I2C πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from