drivers/regulator/mt6359-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/mt6359-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/mt6359-regulator.c- Extension
.c- Size
- 43033 bytes
- Lines
- 1153
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/platform_device.hlinux/mfd/mt6359/registers.hlinux/mfd/mt6359p/registers.hlinux/mfd/mt6397/core.hlinux/module.hlinux/of.hlinux/regmap.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/regulator/mt6359-regulator.hlinux/regulator/of_regulator.h
Detected Declarations
struct mt6359_regulator_infostruct mt6359_vcn33_regsfunction mt6359_map_modefunction mt6359_get_statusfunction mt6359_regulator_get_modefunction mt6359_regulator_set_modefunction mt6359p_vemc_set_voltage_selfunction mt6359p_vemc_get_voltage_selfunction mt6359_sync_vcn33_settingfunction mt6359_regulator_probe
Annotated Snippet
struct mt6359_regulator_info {
struct regulator_desc desc;
u32 status_reg;
u32 qi;
u32 modeset_reg;
u32 modeset_mask;
u32 lp_mode_reg;
u32 lp_mode_mask;
};
#define MT6359_BUCK(match, _name, supply, min, max, step, \
_enable_reg, _status_reg, \
_vsel_reg, _vsel_mask, \
_lp_mode_reg, _lp_mode_shift, \
_modeset_reg, _modeset_shift) \
[MT6359_ID_##_name] = { \
.desc = { \
.name = #_name, \
.supply_name = supply, \
.of_match = of_match_ptr(match), \
.regulators_node = of_match_ptr("regulators"), \
.ops = &mt6359_volt_linear_ops, \
.type = REGULATOR_VOLTAGE, \
.id = MT6359_ID_##_name, \
.owner = THIS_MODULE, \
.uV_step = (step), \
.n_voltages = ((max) - (min)) / (step) + 1, \
.min_uV = (min), \
.vsel_reg = _vsel_reg, \
.vsel_mask = _vsel_mask, \
.enable_reg = _enable_reg, \
.enable_mask = BIT(0), \
.of_map_mode = mt6359_map_mode, \
}, \
.status_reg = _status_reg, \
.qi = BIT(0), \
.lp_mode_reg = _lp_mode_reg, \
.lp_mode_mask = BIT(_lp_mode_shift), \
.modeset_reg = _modeset_reg, \
.modeset_mask = BIT(_modeset_shift), \
}
#define MT6359_LDO_LINEAR(match, _name, supply, min, max, step, \
_enable_reg, _status_reg, _vsel_reg, _vsel_mask) \
[MT6359_ID_##_name] = { \
.desc = { \
.name = #_name, \
.supply_name = supply, \
.of_match = of_match_ptr(match), \
.regulators_node = of_match_ptr("regulators"), \
.ops = &mt6359_volt_linear_ops, \
.type = REGULATOR_VOLTAGE, \
.id = MT6359_ID_##_name, \
.owner = THIS_MODULE, \
.uV_step = (step), \
.n_voltages = ((max) - (min)) / (step) + 1, \
.min_uV = (min), \
.vsel_reg = _vsel_reg, \
.vsel_mask = _vsel_mask, \
.enable_reg = _enable_reg, \
.enable_mask = BIT(0), \
}, \
.status_reg = _status_reg, \
.qi = BIT(0), \
}
#define MT6359_LDO(match, _name, supply, _volt_table, \
_enable_reg, _enable_mask, _status_reg, \
_vsel_reg, _vsel_mask, _en_delay) \
[MT6359_ID_##_name] = { \
.desc = { \
.name = #_name, \
.supply_name = supply, \
.of_match = of_match_ptr(match), \
.regulators_node = of_match_ptr("regulators"), \
.ops = &mt6359_volt_table_ops, \
.type = REGULATOR_VOLTAGE, \
.id = MT6359_ID_##_name, \
.owner = THIS_MODULE, \
.n_voltages = ARRAY_SIZE(_volt_table), \
.volt_table = _volt_table, \
.vsel_reg = _vsel_reg, \
.vsel_mask = _vsel_mask, \
.enable_reg = _enable_reg, \
.enable_mask = BIT(_enable_mask), \
.enable_time = _en_delay, \
}, \
.status_reg = _status_reg, \
.qi = BIT(0), \
}
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/mfd/mt6359/registers.h`, `linux/mfd/mt6359p/registers.h`, `linux/mfd/mt6397/core.h`, `linux/module.h`, `linux/of.h`, `linux/regmap.h`, `linux/regulator/driver.h`.
- Detected declarations: `struct mt6359_regulator_info`, `struct mt6359_vcn33_regs`, `function mt6359_map_mode`, `function mt6359_get_status`, `function mt6359_regulator_get_mode`, `function mt6359_regulator_set_mode`, `function mt6359p_vemc_set_voltage_sel`, `function mt6359p_vemc_get_voltage_sel`, `function mt6359_sync_vcn33_setting`, `function mt6359_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.