drivers/mfd/sm501.c

Source file repositories/reference/linux-study-clean/drivers/mfd/sm501.c

File Facts

System
Linux kernel
Corpus path
drivers/mfd/sm501.c
Extension
.c
Size
40099 bytes
Lines
1698
Domain
Driver Families
Bucket
drivers/mfd
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 sm501_pci_driver = {
	.name		= "sm501",
	.id_table	= sm501_pci_tbl,
	.probe		= sm501_pci_probe,
	.remove		= sm501_pci_remove,
};

MODULE_ALIAS("platform:sm501");

static const struct of_device_id of_sm501_match_tbl[] = {
	{ .compatible = "smi,sm501", },
	{ /* end */ }
};
MODULE_DEVICE_TABLE(of, of_sm501_match_tbl);

static struct platform_driver sm501_plat_driver = {
	.driver		= {
		.name	= "sm501",
		.of_match_table = of_sm501_match_tbl,
	},
	.probe		= sm501_plat_probe,
	.remove		= sm501_plat_remove,
	.suspend	= pm_sleep_ptr(sm501_plat_suspend),
	.resume		= pm_sleep_ptr(sm501_plat_resume),
};

static int __init sm501_base_init(void)
{
	int ret;

	ret = platform_driver_register(&sm501_plat_driver);
	if (ret < 0)
		return ret;

	return pci_register_driver(&sm501_pci_driver);
}

static void __exit sm501_base_exit(void)
{
	platform_driver_unregister(&sm501_plat_driver);
	pci_unregister_driver(&sm501_pci_driver);
}

module_init(sm501_base_init);
module_exit(sm501_base_exit);

MODULE_DESCRIPTION("SM501 Core Driver");
MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>, Vincent Sanders");
MODULE_LICENSE("GPL v2");

Annotation

Implementation Notes