STRUCT I2C_ATR(9)
πΈ 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 parentstruct i2c_adapter. Every queen has a mothership πdevβ thedevicethat owns this I2C ATR instance. Like, the whole thing belongs to this device, no cap.opsβ astruct i2c_atr_ops. The vibe/behavior pack.privβ private driver data, and you set it withi2c_atr_set_driver_data. Secret stash, iykyk πalgoβ thestruct i2c_algorithmfor adapters.lockβ the lock for the I2C bus segment (peepstruct i2c_lock_operationsif you wanna go deeper). Protect the bus, protect your peace πlock_keyβ the lock key forlock. It'slock'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
- 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