STRUCT I2C_ATR_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct i2c_atr_ops(9)

okay so this is a page from the Kernel API Manual and bestie, it's literally the callback menu that ATR hands to your device driver ✨ like, "here's what you gotta do when stuff happens," and you go slay. no cap.


🌸 NAME 🌸

struct i2c_atr_ops β€” Callbacks from ATR to the device driver 🫢


✨ SYNOPSIS ✨

struct i2c_atr_ops {
    int (*attach_addr)(struct i2c_atr *atr, u32 chan_id, u16 addr, u16 alias);
    void (*detach_addr)(struct i2c_atr *atr, u32 chan_id, u16 addr);
};

πŸŽ€ Members πŸŽ€

  • attach_addr β€” this one's like the group-chat notification for a new device πŸ’– it notifies the driver that a new device connected on a child bus, and it comes with the alias that got assigned to it. the driver must configure the hardware to use the alias β€” like, non-negotiable, that's the whole vibe.
  • detach_addr β€” the breakup text 😭 it notifies the driver that a device is getting disconnected. the driver must configure the hardware to stop using the alias. no lingering situationships with stale aliases, periodt.

πŸ”₯ Description πŸ”₯

All these functions return 0 on success, and a negative error code otherwise. that's it, that's the rule πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/i2c-atr.h, plus the whole friend group: enum i2c_atr_flags(9), struct i2c_atr_adap_desc(9), i2c_atr_new(9), i2c_atr_delete(9), i2c_atr_add_adapter(9), i2c_atr_del_adapter(9), i2c_atr_set_driver_data(9), i2c_atr_get_driver_data(9) 🌈


ngl this page lives at ./include/linux, dated October 2026, and it's serving struct i2c_atr_ops(9) energy from the KAPI manual. mwah πŸ’‹ go configure that hardware bestie πŸ’œ
πŸ“¦ where this page comes from