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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/i2c.hlinux/init.hlinux/interrupt.hlinux/module.hlinux/regmap.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/regulator/of_regulator.hlinux/regulator/mt6311.hlinux/slab.hmt6311-regulator.h
Detected Declarations
function mt6311_i2c_probe
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
- Immediate include surface: `linux/err.h`, `linux/i2c.h`, `linux/init.h`, `linux/interrupt.h`, `linux/module.h`, `linux/regmap.h`, `linux/regulator/driver.h`, `linux/regulator/machine.h`.
- Detected declarations: `function mt6311_i2c_probe`.
- Atlas domain: Driver Families / drivers/regulator.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.