drivers/regulator/atc260x-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/atc260x-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/atc260x-regulator.c- Extension
.c- Size
- 17095 bytes
- Lines
- 544
- 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/mfd/atc260x/core.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/regmap.hlinux/regulator/driver.h
Detected Declarations
struct atc260x_regulator_dataenum atc2603c_reg_idsenum atc2609a_reg_idsfunction atc260x_dcdc_set_voltage_time_selfunction atc260x_ldo_set_voltage_time_selfunction atc260x_regulator_probe
Annotated Snippet
struct atc260x_regulator_data {
int voltage_time_dcdc;
int voltage_time_ldo;
};
static const struct linear_range atc2603c_dcdc_voltage_ranges[] = {
REGULATOR_LINEAR_RANGE(1300000, 0, 13, 50000),
REGULATOR_LINEAR_RANGE(1950000, 14, 15, 100000),
};
static const struct linear_range atc2609a_dcdc_voltage_ranges[] = {
REGULATOR_LINEAR_RANGE(600000, 0, 127, 6250),
REGULATOR_LINEAR_RANGE(1400000, 128, 232, 25000),
};
static const struct linear_range atc2609a_ldo_voltage_ranges0[] = {
REGULATOR_LINEAR_RANGE(700000, 0, 15, 100000),
REGULATOR_LINEAR_RANGE(2100000, 0, 12, 100000),
};
static const struct linear_range atc2609a_ldo_voltage_ranges1[] = {
REGULATOR_LINEAR_RANGE(850000, 0, 15, 100000),
REGULATOR_LINEAR_RANGE(2100000, 0, 11, 100000),
};
static const unsigned int atc260x_ldo_voltage_range_sel[] = {
0x0, 0x1,
};
static int atc260x_dcdc_set_voltage_time_sel(struct regulator_dev *rdev,
unsigned int old_selector,
unsigned int new_selector)
{
struct atc260x_regulator_data *data = rdev_get_drvdata(rdev);
if (new_selector > old_selector)
return data->voltage_time_dcdc;
return 0;
}
static int atc260x_ldo_set_voltage_time_sel(struct regulator_dev *rdev,
unsigned int old_selector,
unsigned int new_selector)
{
struct atc260x_regulator_data *data = rdev_get_drvdata(rdev);
if (new_selector > old_selector)
return data->voltage_time_ldo;
return 0;
}
static const struct regulator_ops atc260x_dcdc_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
.list_voltage = regulator_list_voltage_linear,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_time_sel = atc260x_dcdc_set_voltage_time_sel,
};
static const struct regulator_ops atc260x_ldo_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
.list_voltage = regulator_list_voltage_linear,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_time_sel = atc260x_ldo_set_voltage_time_sel,
};
static const struct regulator_ops atc260x_ldo_bypass_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
.list_voltage = regulator_list_voltage_linear,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_time_sel = atc260x_ldo_set_voltage_time_sel,
.set_bypass = regulator_set_bypass_regmap,
.get_bypass = regulator_get_bypass_regmap,
};
static const struct regulator_ops atc260x_ldo_bypass_discharge_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
.list_voltage = regulator_list_voltage_linear,
Annotation
- Immediate include surface: `linux/mfd/atc260x/core.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/regmap.h`, `linux/regulator/driver.h`.
- Detected declarations: `struct atc260x_regulator_data`, `enum atc2603c_reg_ids`, `enum atc2609a_reg_ids`, `function atc260x_dcdc_set_voltage_time_sel`, `function atc260x_ldo_set_voltage_time_sel`, `function atc260x_regulator_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.