drivers/regulator/bcm590xx-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/bcm590xx-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/bcm590xx-regulator.c- Extension
.c- Size
- 27648 bytes
- Lines
- 1178
- 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/err.hlinux/init.hlinux/kernel.hlinux/mfd/bcm590xx.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/regulator/of_regulator.hlinux/slab.h
Detected Declarations
struct bcm590xx_reg_datastruct bcm590xx_regenum bcm590xx_reg_typefunction bcm590xx_probe
Annotated Snippet
struct bcm590xx_reg_data {
enum bcm590xx_reg_type type;
enum bcm590xx_regmap_type regmap;
const struct regulator_desc desc;
};
struct bcm590xx_reg {
struct bcm590xx *mfd;
unsigned int n_regulators;
const struct bcm590xx_reg_data *regs;
};
static const struct regulator_ops bcm590xx_ops_ldo = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.list_voltage = regulator_list_voltage_table,
.map_voltage = regulator_map_voltage_iterate,
};
/*
* LDO ops without voltage selection, used for MICLDO on BCM59054.
* (These are currently the same as VBUS ops, but will be different
* in the future once full PMMODE support is implemented.)
*/
static const struct regulator_ops bcm590xx_ops_ldo_novolt = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
};
static const struct regulator_ops bcm590xx_ops_dcdc = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.list_voltage = regulator_list_voltage_linear_range,
.map_voltage = regulator_map_voltage_linear_range,
};
static const struct regulator_ops bcm590xx_ops_vbus = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
};
#define BCM590XX_REG_DESC(_model, _name, _name_lower) \
.id = _model##_REG_##_name, \
.name = #_name_lower, \
.of_match = of_match_ptr(#_name_lower), \
.regulators_node = of_match_ptr("regulators"), \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE \
#define BCM590XX_LDO_DESC(_model, _model_lower, _name, _name_lower, _table) \
BCM590XX_REG_DESC(_model, _name, _name_lower), \
.ops = &bcm590xx_ops_ldo, \
.n_voltages = ARRAY_SIZE(_model_lower##_##_table), \
.volt_table = _model_lower##_##_table, \
.vsel_reg = _model##_##_name##CTRL, \
.vsel_mask = BCM590XX_LDO_VSEL_MASK, \
.enable_reg = _model##_##_name##PMCTRL1, \
.enable_mask = BCM590XX_REG_ENABLE, \
.enable_is_inverted = true
#define BCM590XX_SR_DESC(_model, _model_lower, _name, _name_lower, _ranges) \
BCM590XX_REG_DESC(_model, _name, _name_lower), \
.ops = &bcm590xx_ops_dcdc, \
.n_voltages = 64, \
.linear_ranges = _model_lower##_##_ranges, \
.n_linear_ranges = ARRAY_SIZE(_model_lower##_##_ranges), \
.vsel_reg = _model##_##_name##VOUT1, \
.vsel_mask = BCM590XX_SR_VSEL_MASK, \
.enable_reg = _model##_##_name##PMCTRL1, \
.enable_mask = BCM590XX_REG_ENABLE, \
.enable_is_inverted = true
#define BCM59056_REG_DESC(_name, _name_lower) \
BCM590XX_REG_DESC(BCM59056, _name, _name_lower)
#define BCM59056_LDO_DESC(_name, _name_lower, _table) \
BCM590XX_LDO_DESC(BCM59056, bcm59056, _name, _name_lower, _table)
#define BCM59056_SR_DESC(_name, _name_lower, _ranges) \
BCM590XX_SR_DESC(BCM59056, bcm59056, _name, _name_lower, _ranges)
#define BCM59054_REG_DESC(_name, _name_lower) \
BCM590XX_REG_DESC(BCM59054, _name, _name_lower)
#define BCM59054_LDO_DESC(_name, _name_lower, _table) \
Annotation
- Immediate include surface: `linux/err.h`, `linux/init.h`, `linux/kernel.h`, `linux/mfd/bcm590xx.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/regulator/driver.h`.
- Detected declarations: `struct bcm590xx_reg_data`, `struct bcm590xx_reg`, `enum bcm590xx_reg_type`, `function bcm590xx_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.