STRUCT AMD_MP2_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct amd_mp2_dev(9) β€” Kernel API Manual πŸ’–

okay so this is the whole page for struct amd_mp2_dev, straight out of the Kernel API Manual, and it's literally the per-PCI-device context bestie. the vibe? one struct, all the state for one MP2 device. iconic. πŸŽ€


✨ NAME ✨

struct amd_mp2_dev β€” per PCI device context 🫢


🌸 SYNOPSIS 🌸

struct amd_mp2_dev {
    struct pci_dev *pci_dev;
    struct amd_i2c_common *busses[2];
    void __iomem *mmio;
    struct mutex c2p_lock;
    u8 c2p_lock_busid;
    unsigned int probed;
    int dev_irq;
 };

no cap, that's the whole struct. every field, exactly as written. πŸ’…


πŸ¦‹ Members πŸ¦‹

let's do a little field-by-field vibe check, shall we? 🌈

  • pci_dev β€” the PCI driver node. that's it, that's the field. literally the handle to the PCI side of things. πŸ”₯
  • busses β€” MP2 devices may have up to two busses, and each bus corresponds to an i2c adapter. so it's busses[2], an array of struct amd_i2c_common *, and yes the array is the moment. πŸ‘‘
  • mmio β€” iommapped registers. void __iomem * energy. that's where the registers live after mapping. ⭐
  • c2p_lock β€” controls access to the C2P mailbox shared between the two adapters. two adapters, one mailbox, one mutex β€” you already know why this exists. πŸ”’
  • c2p_lock_busid β€” id of the adapter which locked c2p_lock. it's a u8, it's tracking who's holding the lock, and it's doing its little job. πŸ™ˆ
  • probed β€” an unsigned int. that's the field, that's all the page says about it. no description given here, so we're not gonna make one up. πŸ€·β€β™€οΈ
  • dev_irq β€” an int. same deal: it's in the struct, and the page doesn't describe it. showing up is enough. πŸ’€
lowkey important: the original text only describes pci_dev, busses, mmio, c2p_lock and c2p_lock_busid. probed and dev_irq are in the struct definition but have no description listed β€” so don't go around guessing at their behaviour fr fr. 🧚

πŸ’œ SEE ALSO πŸ’œ

the Kernel file ./drivers/i2c/busses/i2c-amd-mp2.h and its friends β€” go read these next, bestie, they're the whole friend group:

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

and that's the page!! πŸ’– this came from ./drivers/i2c/busses, dated October 2026, and the title at the top was struct amd_mp2_dev(9) β€” slay, you made it to the end, go touch some registers responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from