STRUCT I2C_ATR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

struct i2c_atr β€” bestie, it's literally the I2C ATR instance πŸ‘‘

So like, this whole page lives in the Kernel API Manual (yes, the real one, we're fancy now πŸ’…). And the star of the show is struct i2c_atr, the actual instance of an I2C ATR. Iconic behavior only.


✨ SYNOPSIS ✨

struct i2c_atr {
    struct i2c_adapter *parent;
    struct device *dev;
    const struct i2c_atr_ops *ops;
    void *priv;
    struct i2c_algorithm algo;
    struct mutex lock;
    struct lock_class_key lock_key;
    int max_adapters;
    u32 flags;
    struct i2c_atr_alias_pool *alias_pool;
    struct notifier_block i2c_nb;
    struct i2c_adapter *adapter[];
};

Look at her. Struct royalty. The [] at the end is giving flexible array member main character energy 🫢


πŸŽ€ Members πŸŽ€

  • parent β€” the parent struct i2c_adapter. Every queen has a mothership πŸ’–
  • dev β€” the device that owns this I2C ATR instance. Like, the whole thing belongs to this device, no cap.
  • ops β€” a struct i2c_atr_ops. The vibe/behavior pack.
  • priv β€” private driver data, and you set it with i2c_atr_set_driver_data. Secret stash, iykyk πŸ™ˆ
  • algo β€” the struct i2c_algorithm for adapters.
  • lock β€” the lock for the I2C bus segment (peep struct i2c_lock_operations if you wanna go deeper). Protect the bus, protect your peace πŸ”’
  • lock_key β€” the lock key for lock. It's lock's plus-one.
  • max_adapters β€” maximum number of adapters this I2C ATR can have. Set the limit, bestie 🚦
  • flags β€” flags for ATR.
  • alias_pool β€” an optional common pool of available client aliases. Optional!! Not mandatory, she's flexible ✨
  • i2c_nb β€” the notifier for remote client add & del events. She's on notification duty πŸ“£
  • adapter β€” array of adapters. Plural. A whole squad 🌈

πŸ¦‹ SEE ALSO πŸ¦‹

The kernel file ./drivers/i2c/i2c-atr.c is where it all goes down, and you're gonna want to meet the whole friend group too:

  • struct i2c_atr_alias_pair(9)
  • struct i2c_atr_alias_pool(9)
  • struct i2c_atr_chan(9)

Ngl, if you're poking at ATR internals you should fr fr read the source alongside this. The struct doesn't gatekeep, but context is everything πŸ’œ

Okay that's the whole page, bestie β€” go slay some I2C πŸ§šπŸ’« This masterpiece came from ./drivers/i2c, dated October 2026, so you know it's fresh πŸ”₯

πŸ“¦ where this page comes from