drivers/regulator/mt6311-regulator.c

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

File Facts

System
Linux kernel
Corpus path
drivers/regulator/mt6311-regulator.c
Extension
.c
Size
4193 bytes
Lines
165
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(&i2c->dev,
				"Failed to register MT6311 regulator\n");
			return PTR_ERR(rdev);
		}
	}

	return 0;
}

static const struct i2c_device_id mt6311_i2c_id[] = {
	{ "mt6311" },
	{}
};
MODULE_DEVICE_TABLE(i2c, mt6311_i2c_id);

#ifdef CONFIG_OF
static const struct of_device_id mt6311_dt_ids[] = {
	{ .compatible = "mediatek,mt6311-regulator",
	  .data = &mt6311_i2c_id[0] },
	{},
};
MODULE_DEVICE_TABLE(of, mt6311_dt_ids);
#endif

static struct i2c_driver mt6311_regulator_driver = {
	.driver = {
		.name = "mt6311",
		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
		.of_match_table = of_match_ptr(mt6311_dt_ids),
	},
	.probe = mt6311_i2c_probe,
	.id_table = mt6311_i2c_id,
};

module_i2c_driver(mt6311_regulator_driver);

MODULE_AUTHOR("Henry Chen <henryc.chen@mediatek.com>");
MODULE_DESCRIPTION("Regulator device driver for Mediatek MT6311");
MODULE_LICENSE("GPL v2");

Annotation

Implementation Notes