drivers/regulator/bd71815-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/bd71815-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/bd71815-regulator.c- Extension
.c- Size
- 19872 bytes
- Lines
- 629
- 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/kernel.hlinux/module.hlinux/init.hlinux/err.hlinux/platform_device.hlinux/of.hlinux/gpio/consumer.hlinux/regulator/driver.hlinux/delay.hlinux/slab.hlinux/mfd/rohm-generic.hlinux/mfd/rohm-bd71815.hlinux/regulator/of_regulator.h
Detected Declarations
struct bd71815_regulatorfunction set_hw_dvs_levelsfunction buck12_set_hw_dvs_levelsfunction bd7181x_led_set_current_limitfunction bd7181x_buck12_get_voltage_selfunction bd7181x_buck12_set_voltage_selfunction bd7181x_probe
Annotated Snippet
struct bd71815_regulator {
struct regulator_desc desc;
const struct rohm_dvs_config *dvs;
};
static const int bd7181x_wled_currents[] = {
10, 20, 30, 50, 70, 100, 200, 300, 500, 700, 1000, 2000, 3000, 4000,
5000, 6000, 7000, 8000, 9000, 10000, 11000, 12000, 13000, 14000, 15000,
16000, 17000, 18000, 19000, 20000, 21000, 22000, 23000, 24000, 25000,
};
static const struct rohm_dvs_config buck1_dvs = {
.level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_SNVS |
ROHM_DVS_LEVEL_SUSPEND | ROHM_DVS_LEVEL_LPSR,
.run_reg = BD71815_REG_BUCK1_VOLT_H,
.run_mask = BD71815_VOLT_MASK,
.run_on_mask = BD71815_BUCK_RUN_ON,
.snvs_on_mask = BD71815_BUCK_SNVS_ON,
.suspend_reg = BD71815_REG_BUCK1_VOLT_L,
.suspend_mask = BD71815_VOLT_MASK,
.suspend_on_mask = BD71815_BUCK_SUSP_ON,
.lpsr_reg = BD71815_REG_BUCK1_VOLT_L,
.lpsr_mask = BD71815_VOLT_MASK,
.lpsr_on_mask = BD71815_BUCK_LPSR_ON,
};
static const struct rohm_dvs_config buck2_dvs = {
.level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_SNVS |
ROHM_DVS_LEVEL_SUSPEND | ROHM_DVS_LEVEL_LPSR,
.run_reg = BD71815_REG_BUCK2_VOLT_H,
.run_mask = BD71815_VOLT_MASK,
.run_on_mask = BD71815_BUCK_RUN_ON,
.snvs_on_mask = BD71815_BUCK_SNVS_ON,
.suspend_reg = BD71815_REG_BUCK2_VOLT_L,
.suspend_mask = BD71815_VOLT_MASK,
.suspend_on_mask = BD71815_BUCK_SUSP_ON,
.lpsr_reg = BD71815_REG_BUCK2_VOLT_L,
.lpsr_mask = BD71815_VOLT_MASK,
.lpsr_on_mask = BD71815_BUCK_LPSR_ON,
};
static const struct rohm_dvs_config buck3_dvs = {
.level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_SNVS |
ROHM_DVS_LEVEL_SUSPEND | ROHM_DVS_LEVEL_LPSR,
.run_reg = BD71815_REG_BUCK3_VOLT,
.run_mask = BD71815_VOLT_MASK,
.run_on_mask = BD71815_BUCK_RUN_ON,
.snvs_on_mask = BD71815_BUCK_SNVS_ON,
.suspend_on_mask = BD71815_BUCK_SUSP_ON,
.lpsr_on_mask = BD71815_BUCK_LPSR_ON,
};
static const struct rohm_dvs_config buck4_dvs = {
.level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_SNVS |
ROHM_DVS_LEVEL_SUSPEND | ROHM_DVS_LEVEL_LPSR,
.run_reg = BD71815_REG_BUCK4_VOLT,
.run_mask = BD71815_VOLT_MASK,
.run_on_mask = BD71815_BUCK_RUN_ON,
.snvs_on_mask = BD71815_BUCK_SNVS_ON,
.suspend_on_mask = BD71815_BUCK_SUSP_ON,
.lpsr_on_mask = BD71815_BUCK_LPSR_ON,
};
static const struct rohm_dvs_config ldo1_dvs = {
.level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_SNVS |
ROHM_DVS_LEVEL_SUSPEND | ROHM_DVS_LEVEL_LPSR,
.run_reg = BD71815_REG_LDO_MODE1,
.run_mask = BD71815_VOLT_MASK,
.run_on_mask = LDO1_RUN_ON,
.snvs_on_mask = LDO1_SNVS_ON,
.suspend_on_mask = LDO1_SUSP_ON,
.lpsr_on_mask = LDO1_LPSR_ON,
};
static const struct rohm_dvs_config ldo2_dvs = {
.level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_SNVS |
ROHM_DVS_LEVEL_SUSPEND | ROHM_DVS_LEVEL_LPSR,
.run_reg = BD71815_REG_LDO_MODE2,
.run_mask = BD71815_VOLT_MASK,
.run_on_mask = LDO2_RUN_ON,
.snvs_on_mask = LDO2_SNVS_ON,
.suspend_on_mask = LDO2_SUSP_ON,
.lpsr_on_mask = LDO2_LPSR_ON,
};
static const struct rohm_dvs_config ldo3_dvs = {
.level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_SNVS |
ROHM_DVS_LEVEL_SUSPEND | ROHM_DVS_LEVEL_LPSR,
.run_reg = BD71815_REG_LDO_MODE2,
.run_mask = BD71815_VOLT_MASK,
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/init.h`, `linux/err.h`, `linux/platform_device.h`, `linux/of.h`, `linux/gpio/consumer.h`, `linux/regulator/driver.h`.
- Detected declarations: `struct bd71815_regulator`, `function set_hw_dvs_levels`, `function buck12_set_hw_dvs_levels`, `function bd7181x_led_set_current_limit`, `function bd7181x_buck12_get_voltage_sel`, `function bd7181x_buck12_set_voltage_sel`, `function bd7181x_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.