drivers/i2c/busses/i2c-amd-mp2-pci.c

Source file repositories/reference/linux-study-clean/drivers/i2c/busses/i2c-amd-mp2-pci.c

File Facts

System
Linux kernel
Corpus path
drivers/i2c/busses/i2c-amd-mp2-pci.c
Extension
.c
Size
12152 bytes
Lines
480
Domain
Driver Families
Bucket
drivers/i2c
Inferred role
Driver Families: operation-table or driver-model contract
Status
pattern implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

static struct pci_driver amd_mp2_pci_driver = {
	.name		= "i2c_amd_mp2",
	.id_table	= amd_mp2_pci_tbl,
	.probe		= amd_mp2_pci_probe,
	.remove		= amd_mp2_pci_remove,
#ifdef CONFIG_PM
	.driver = {
		.pm	= &amd_mp2_pci_pm_ops,
	},
#endif
};
module_pci_driver(amd_mp2_pci_driver);

struct amd_mp2_dev *amd_mp2_find_device(void)
{
	struct amd_mp2_dev *privdata;
	struct device *dev;
	struct pci_dev *pci_dev;

	dev = driver_find_next_device(&amd_mp2_pci_driver.driver, NULL);
	if (!dev)
		return NULL;

	pci_dev = to_pci_dev(dev);
	privdata = pci_get_drvdata(pci_dev);

	put_device(dev);

	return privdata;
}
EXPORT_SYMBOL_GPL(amd_mp2_find_device);

MODULE_DESCRIPTION("AMD(R) PCI-E MP2 I2C Controller Driver");
MODULE_AUTHOR("Shyam Sundar S K <Shyam-sundar.S-k@amd.com>");
MODULE_AUTHOR("Elie Morisse <syniurge@gmail.com>");
MODULE_LICENSE("Dual BSD/GPL");

Annotation

Implementation Notes