STRUCT AMD_I2C_COMMON(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct amd_i2c_common β€” NAME

okay so bestie, struct amd_i2c_common is the per bus/i2c adapter context β€” and the whole point of it is that it's shared between the pci driver and the platform driver 🫢 like yes, both of them, same struct, no cap.

(This is from the Kernel API Manual, section 9 β€” you're reading the struct amd_i2c_common(9) page, hi hi 🌸)


✨ SYNOPSIS ✨

struct amd_i2c_common {
    union i2c_event eventval;
    struct amd_mp2_dev *mp2_dev;
    struct i2c_msg *msg;
    void (*cmd_completion)(struct amd_i2c_common *i2c_common);
    enum i2c_cmd reqcmd;
    u8 cmd_success;
    u8 bus_id;
    enum speed_enum i2c_speed;
    u8 *dma_buf;
    dma_addr_t dma_addr;
  #ifdef CONFIG_PM;
    int (*suspend)(struct amd_i2c_common *i2c_common);
    int (*resume)(struct amd_i2c_common *i2c_common);
  #endif ;
 };

like, look at her. main character energy fr πŸ’œ

πŸŽ€ note that the suspend and resume pointers are only in there when CONFIG_PM is set β€” conditional icon behaviour, iykyk.

πŸ¦‹ Members πŸ¦‹

  • eventval β€” the MP2 event value, and it gets set by the IRQ handler ⚑
  • mp2_dev β€” the MP2 pci device that this adapter is part of (her home address basically 🏠)
  • msg β€” the i2c message πŸ’Œ
  • cmd_completion β€” a function the IRQ handler calls to signal the platform driver πŸ“£ like a little "hey girl, done!" callback
  • reqcmd β€” the requested i2c command type
  • cmd_success β€” set to true when the MP2 responded to a command with the expected status and the expected response type βœ… (both, bestie, not just one)
  • bus_id β€” the bus index πŸ”’
  • i2c_speed β€” the i2c bus speed, and it's determined by the slowest slave 🐒 (yes, the slowest one decides. we respect the slow queen's pace)
  • dma_buf β€” if the msg length is > 32, this holds the DMA buffer virtual address 🧚
  • dma_addr β€” if the msg length is > 32, this holds the DMA buffer address πŸ“

🌈 SEE ALSO 🌈

Kernel file ./drivers/i2c/busses/i2c-amd-mp2.h, plus these besties:

  • union i2c_cmd_base(9)
  • union i2c_event(9)
  • struct amd_mp2_dev(9)

and that's the whole vibe check πŸ’– this page lives over in ./drivers/i2c/busses, it's dated October 2026, and yeah β€” the header and footer are literally just struct amd_i2c_common(9) again, she's consistent like that πŸ‘‘ periodt.

πŸ“¦ where this page comes from