drivers/regulator/adp5055-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/adp5055-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/adp5055-regulator.c- Extension
.c- Size
- 11609 bytes
- Lines
- 425
- 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/bitfield.hlinux/device.hlinux/gpio/consumer.hlinux/i2c.hlinux/module.hlinux/mod_devicetable.hlinux/regmap.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/regulator/of_regulator.h
Detected Declarations
struct adp5055function adp5055_get_prop_indexfunction adp5055_parse_fwfunction adp5055_of_parse_cbfunction adp5055_set_modefunction adp5055_get_modefunction adp5055_probe
Annotated Snippet
struct adp5055 {
struct device *dev;
struct regmap *regmap;
u32 tset;
struct gpio_desc *en_gpiod[ADP5055_NUM_CH];
bool en_mode_software;
int dvs_limit_upper[ADP5055_NUM_CH];
int dvs_limit_lower[ADP5055_NUM_CH];
u32 fast_transient[ADP5055_NUM_CH];
bool mask_power_good[ADP5055_NUM_CH];
};
static const unsigned int adp5055_tset_vals[] = {
2600,
20800,
};
static const unsigned int adp5055_enable_delay_vals_2_6[] = {
0,
2600,
5200,
7800,
10400,
13000,
15600,
18200,
};
static const unsigned int adp5055_enable_delay_vals_20_8[] = {
0,
20800,
41600,
62400,
83200,
104000,
124800,
145600,
};
static const char * const adp5055_fast_transient_vals[] = {
"none",
"3G_1.5%",
"5G_1.5%",
"5G_2.5%",
};
static int adp5055_get_prop_index(const u32 *table, size_t table_size,
u32 value)
{
int i;
for (i = 0; i < table_size; i++)
if (table[i] == value)
return i;
return -EINVAL;
}
static const struct regmap_range adp5055_reg_ranges[] = {
regmap_reg_range(0xD1, 0xE0),
};
static const struct regmap_access_table adp5055_access_ranges_table = {
.yes_ranges = adp5055_reg_ranges,
.n_yes_ranges = ARRAY_SIZE(adp5055_reg_ranges),
};
static const struct regmap_config adp5055_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = 0xE0,
.wr_table = &adp5055_access_ranges_table,
.rd_table = &adp5055_access_ranges_table,
};
static const struct linear_range adp5055_voltage_ranges[] = {
REGULATOR_LINEAR_RANGE(ADP5055_MIN_VOUT, 0, 255, 1500),
};
static int adp5055_parse_fw(struct device *dev, struct adp5055 *adp5055)
{
int i, ret;
struct regmap *regmap = adp5055->regmap;
int val;
bool ocp_blanking;
bool delay_power_good;
ret = device_property_read_u32(dev, "adi,tset-us", &adp5055->tset);
if (!ret) {
ret = adp5055_get_prop_index(adp5055_tset_vals,
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/module.h`, `linux/mod_devicetable.h`, `linux/regmap.h`, `linux/regulator/driver.h`.
- Detected declarations: `struct adp5055`, `function adp5055_get_prop_index`, `function adp5055_parse_fw`, `function adp5055_of_parse_cb`, `function adp5055_set_mode`, `function adp5055_get_mode`, `function adp5055_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.