drivers/regulator/mt6332-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/mt6332-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/mt6332-regulator.c- Extension
.c- Size
- 13413 bytes
- Lines
- 424
- 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/module.hlinux/of.hlinux/platform_device.hlinux/regmap.hlinux/mfd/mt6397/core.hlinux/mfd/mt6332/registers.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/regulator/mt6332-regulator.hlinux/regulator/of_regulator.h
Detected Declarations
struct mt6332_regulator_infofunction mt6332_get_statusfunction mt6332_ldo_set_modefunction mt6332_ldo_get_modefunction mt6332_set_buck_vosel_regfunction mt6332_regulator_probe
Annotated Snippet
struct mt6332_regulator_info {
struct regulator_desc desc;
u32 qi;
u32 vselon_reg;
u32 vselctrl_reg;
u32 vselctrl_mask;
u32 modeset_reg;
u32 modeset_mask;
u32 status_reg;
u32 status_mask;
};
#define MT6332_BUCK(match, vreg, min, max, step, volt_ranges, enreg, \
vosel, vosel_mask, voselon, vosel_ctrl) \
[MT6332_ID_##vreg] = { \
.desc = { \
.name = #vreg, \
.of_match = of_match_ptr(match), \
.ops = &mt6332_buck_volt_range_ops, \
.type = REGULATOR_VOLTAGE, \
.id = MT6332_ID_##vreg, \
.owner = THIS_MODULE, \
.n_voltages = (max - min)/step + 1, \
.linear_ranges = volt_ranges, \
.n_linear_ranges = ARRAY_SIZE(volt_ranges), \
.vsel_reg = vosel, \
.vsel_mask = vosel_mask, \
.enable_reg = enreg, \
.enable_mask = BIT(0), \
}, \
.qi = BIT(13), \
.vselon_reg = voselon, \
.vselctrl_reg = vosel_ctrl, \
.vselctrl_mask = BIT(1), \
.status_mask = 0, \
}
#define MT6332_LDO_LINEAR(match, vreg, min, max, step, volt_ranges, \
enreg, vosel, vosel_mask, voselon, \
vosel_ctrl, _modeset_reg, _modeset_mask) \
[MT6332_ID_##vreg] = { \
.desc = { \
.name = #vreg, \
.of_match = of_match_ptr(match), \
.ops = &mt6332_ldo_volt_range_ops, \
.type = REGULATOR_VOLTAGE, \
.id = MT6332_ID_##vreg, \
.owner = THIS_MODULE, \
.n_voltages = (max - min)/step + 1, \
.linear_ranges = volt_ranges, \
.n_linear_ranges = ARRAY_SIZE(volt_ranges), \
.vsel_reg = vosel, \
.vsel_mask = vosel_mask, \
.enable_reg = enreg, \
.enable_mask = BIT(0), \
}, \
.qi = BIT(15), \
.vselon_reg = voselon, \
.vselctrl_reg = vosel_ctrl, \
.vselctrl_mask = BIT(1), \
.modeset_reg = _modeset_reg, \
.modeset_mask = _modeset_mask, \
.status_mask = 0, \
}
#define MT6332_LDO_AO(match, vreg, ldo_volt_table, vosel, vosel_mask) \
[MT6332_ID_##vreg] = { \
.desc = { \
.name = #vreg, \
.of_match = of_match_ptr(match), \
.ops = &mt6332_volt_table_ao_ops, \
.type = REGULATOR_VOLTAGE, \
.id = MT6332_ID_##vreg, \
.owner = THIS_MODULE, \
.n_voltages = ARRAY_SIZE(ldo_volt_table), \
.volt_table = ldo_volt_table, \
.vsel_reg = vosel, \
.vsel_mask = vosel_mask, \
}, \
}
#define MT6332_LDO(match, vreg, ldo_volt_table, enreg, enbit, vosel, \
vosel_mask, _modeset_reg, _modeset_mask) \
[MT6332_ID_##vreg] = { \
.desc = { \
.name = #vreg, \
.of_match = of_match_ptr(match), \
.ops = &mt6332_volt_table_ops, \
.type = REGULATOR_VOLTAGE, \
.id = MT6332_ID_##vreg, \
Annotation
- Immediate include surface: `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/regmap.h`, `linux/mfd/mt6397/core.h`, `linux/mfd/mt6332/registers.h`, `linux/regulator/driver.h`, `linux/regulator/machine.h`.
- Detected declarations: `struct mt6332_regulator_info`, `function mt6332_get_status`, `function mt6332_ldo_set_mode`, `function mt6332_ldo_get_mode`, `function mt6332_set_buck_vosel_reg`, `function mt6332_regulator_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.