drivers/regulator/bd71828-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/bd71828-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/bd71828-regulator.c- Extension
.c- Size
- 56698 bytes
- Lines
- 1714
- 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/cleanup.hlinux/delay.hlinux/err.hlinux/interrupt.hlinux/kernel.hlinux/mfd/rohm-bd71828.hlinux/mfd/rohm-bd72720.hlinux/module.hlinux/mod_devicetable.hlinux/of.hlinux/platform_device.hlinux/regmap.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/regulator/of_regulator.h
Detected Declarations
struct reg_initstruct bd71828_regulator_datafunction buck_set_hw_dvs_levelsfunction bd71828_ldo6_parse_dtfunction bd72720_buck10_ldon_head_modefunction bd72720_dt_parsefunction bd71828_probe
Annotated Snippet
struct reg_init {
unsigned int reg;
unsigned int mask;
unsigned int val;
};
struct bd71828_regulator_data {
struct regulator_desc desc;
const struct rohm_dvs_config dvs;
const struct reg_init *reg_inits;
int reg_init_amnt;
};
static const struct reg_init bd71828_buck1_inits[] = {
/*
* DVS Buck voltages can be changed by register values or via GPIO.
* Use register accesses by default.
*/
{
.reg = BD71828_REG_PS_CTRL_1,
.mask = BD71828_MASK_DVS_BUCK1_CTRL,
.val = BD71828_DVS_BUCK1_CTRL_I2C,
},
};
static const struct reg_init bd71828_buck2_inits[] = {
{
.reg = BD71828_REG_PS_CTRL_1,
.mask = BD71828_MASK_DVS_BUCK2_CTRL,
.val = BD71828_DVS_BUCK2_CTRL_I2C,
},
};
static const struct reg_init bd71828_buck6_inits[] = {
{
.reg = BD71828_REG_PS_CTRL_1,
.mask = BD71828_MASK_DVS_BUCK6_CTRL,
.val = BD71828_DVS_BUCK6_CTRL_I2C,
},
};
static const struct reg_init bd71828_buck7_inits[] = {
{
.reg = BD71828_REG_PS_CTRL_1,
.mask = BD71828_MASK_DVS_BUCK7_CTRL,
.val = BD71828_DVS_BUCK7_CTRL_I2C,
},
};
#define BD72720_MASK_DVS_BUCK1_CTRL BIT(4)
#define BD72720_MASK_DVS_LDO1_CTRL BIT(5)
static const struct reg_init bd72720_buck1_inits[] = {
{
.reg = BD72720_REG_PS_CTRL_2,
.mask = BD72720_MASK_DVS_BUCK1_CTRL,
.val = 0, /* Disable "run-level" control */
},
};
static const struct reg_init bd72720_ldo1_inits[] = {
{
.reg = BD72720_REG_PS_CTRL_2,
.mask = BD72720_MASK_DVS_LDO1_CTRL,
.val = 0, /* Disable "run-level" control */
},
};
/* BD71828 Buck voltages */
static const struct linear_range bd71828_buck1267_volts[] = {
REGULATOR_LINEAR_RANGE(500000, 0x00, 0xef, 6250),
REGULATOR_LINEAR_RANGE(2000000, 0xf0, 0xff, 0),
};
static const struct linear_range bd71828_buck3_volts[] = {
REGULATOR_LINEAR_RANGE(1200000, 0x00, 0x0f, 50000),
REGULATOR_LINEAR_RANGE(2000000, 0x10, 0x1f, 0),
};
static const struct linear_range bd71828_buck4_volts[] = {
REGULATOR_LINEAR_RANGE(1000000, 0x00, 0x1f, 25000),
REGULATOR_LINEAR_RANGE(1800000, 0x20, 0x3f, 0),
};
static const struct linear_range bd71828_buck5_volts[] = {
REGULATOR_LINEAR_RANGE(2500000, 0x00, 0x0f, 50000),
REGULATOR_LINEAR_RANGE(3300000, 0x10, 0x1f, 0),
};
/* BD71828 LDO voltages */
static const struct linear_range bd71828_ldo_volts[] = {
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/delay.h`, `linux/err.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/mfd/rohm-bd71828.h`, `linux/mfd/rohm-bd72720.h`, `linux/module.h`.
- Detected declarations: `struct reg_init`, `struct bd71828_regulator_data`, `function buck_set_hw_dvs_levels`, `function bd71828_ldo6_parse_dt`, `function bd72720_buck10_ldon_head_mode`, `function bd72720_dt_parse`, `function bd71828_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.