drivers/regulator/pv88080-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/pv88080-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/pv88080-regulator.c- Extension
.c- Size
- 15844 bytes
- Lines
- 548
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/i2c.hlinux/mod_devicetable.hlinux/module.hlinux/of.hlinux/init.hlinux/slab.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/regmap.hlinux/irq.hlinux/interrupt.hlinux/regulator/of_regulator.hpv88080-regulator.h
Detected Declarations
struct pv88080_regulatorstruct pv88080struct pv88080_buck_voltagestruct pv88080_buck_regmapstruct pv88080_compatible_regmapfunction pv88080_buck_get_modefunction pv88080_buck_set_modefunction pv88080_irq_handlerfunction pv88080_i2c_probe
Annotated Snippet
struct pv88080_regulator {
struct regulator_desc desc;
unsigned int mode_reg;
unsigned int conf2;
unsigned int conf5;
};
struct pv88080 {
struct device *dev;
struct regmap *regmap;
struct regulator_dev *rdev[PV88080_MAX_REGULATORS];
unsigned long type;
const struct pv88080_compatible_regmap *regmap_config;
};
struct pv88080_buck_voltage {
int min_uV;
int max_uV;
int uV_step;
};
struct pv88080_buck_regmap {
/* REGS */
int buck_enable_reg;
int buck_vsel_reg;
int buck_mode_reg;
int buck_limit_reg;
int buck_vdac_range_reg;
int buck_vrange_gain_reg;
/* MASKS */
int buck_enable_mask;
int buck_vsel_mask;
int buck_limit_mask;
};
struct pv88080_compatible_regmap {
/* BUCK1, 2, 3 */
struct pv88080_buck_regmap buck_regmap[PV88080_MAX_REGULATORS-1];
/* HVBUCK */
int hvbuck_enable_reg;
int hvbuck_vsel_reg;
int hvbuck_enable_mask;
int hvbuck_vsel_mask;
};
static const struct regmap_config pv88080_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
};
/* Current limits array (in uA) for BUCK1, BUCK2, BUCK3.
* Entry indexes corresponds to register values.
*/
static const unsigned int pv88080_buck1_limits[] = {
3230000, 5130000, 6960000, 8790000
};
static const unsigned int pv88080_buck23_limits[] = {
1496000, 2393000, 3291000, 4189000
};
static const struct pv88080_buck_voltage pv88080_buck_vol[2] = {
{
.min_uV = 600000,
.max_uV = 1393750,
.uV_step = 6250,
},
{
.min_uV = 1400000,
.max_uV = 2193750,
.uV_step = 6250,
},
};
static const struct pv88080_compatible_regmap pv88080_aa_regs = {
/* BUCK1 */
.buck_regmap[0] = {
.buck_enable_reg = PV88080AA_REG_BUCK1_CONF0,
.buck_vsel_reg = PV88080AA_REG_BUCK1_CONF0,
.buck_mode_reg = PV88080AA_REG_BUCK1_CONF1,
.buck_limit_reg = PV88080AA_REG_BUCK1_CONF1,
.buck_vdac_range_reg = PV88080AA_REG_BUCK1_CONF2,
.buck_vrange_gain_reg = PV88080AA_REG_BUCK1_CONF5,
.buck_enable_mask = PV88080_BUCK1_EN,
.buck_vsel_mask = PV88080_VBUCK1_MASK,
.buck_limit_mask = PV88080_BUCK1_ILIM_MASK,
},
/* BUCK2 */
.buck_regmap[1] = {
Annotation
- Immediate include surface: `linux/err.h`, `linux/i2c.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/of.h`, `linux/init.h`, `linux/slab.h`, `linux/regulator/driver.h`.
- Detected declarations: `struct pv88080_regulator`, `struct pv88080`, `struct pv88080_buck_voltage`, `struct pv88080_buck_regmap`, `struct pv88080_compatible_regmap`, `function pv88080_buck_get_mode`, `function pv88080_buck_set_mode`, `function pv88080_irq_handler`, `function pv88080_i2c_probe`.
- Atlas domain: Driver Families / drivers/regulator.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.