STRUCT AMD_MP2_DEV(9)
π 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'sbusses[2], an array ofstruct 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 lockedc2p_lock. it's au8, it's tracking who's holding the lock, and it's doing its little job. πprobedβ anunsigned 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β anint. same deal: it's in the struct, and the page doesn't describe it. showing up is enough. π
lowkey important: the original text only describespci_dev,busses,mmio,c2p_lockandc2p_lock_busid.probedanddev_irqare 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
- 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