drivers/regulator/mp5416.c

Source file repositories/reference/linux-study-clean/drivers/regulator/mp5416.c

File Facts

System
Linux kernel
Corpus path
drivers/regulator/mp5416.c
Extension
.c
Size
7551 bytes
Lines
251
Domain
Driver Families
Bucket
drivers/regulator
Inferred role
Driver Families: implementation source
Status
source 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

if (IS_ERR(rdev)) {
			dev_err(dev, "Failed to register regulator!\n");
			return PTR_ERR(rdev);
		}
	}

	return 0;
}

static const struct of_device_id mp5416_of_match[] = {
	{ .compatible = "mps,mp5416", .data = &mp5416_regulators_desc },
	{ .compatible = "mps,mp5496", .data = &mp5496_regulators_desc },
	{}
};
MODULE_DEVICE_TABLE(of, mp5416_of_match);

static const struct i2c_device_id mp5416_id[] = {
	{ "mp5416", (kernel_ulong_t)&mp5416_regulators_desc },
	{ "mp5496", (kernel_ulong_t)&mp5496_regulators_desc },
	{}
};
MODULE_DEVICE_TABLE(i2c, mp5416_id);

static struct i2c_driver mp5416_regulator_driver = {
	.driver = {
		.name = "mp5416",
		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
		.of_match_table = of_match_ptr(mp5416_of_match),
	},
	.probe = mp5416_i2c_probe,
	.id_table = mp5416_id,
};
module_i2c_driver(mp5416_regulator_driver);

MODULE_AUTHOR("Saravanan Sekar <sravanhome@gmail.com>");
MODULE_DESCRIPTION("MP5416 PMIC regulator driver");
MODULE_LICENSE("GPL");

Annotation

Implementation Notes