drivers/regulator/s5m8767.c
Source file repositories/reference/linux-study-clean/drivers/regulator/s5m8767.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/s5m8767.c- Extension
.c- Size
- 25096 bytes
- Lines
- 938
- 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/cleanup.hlinux/err.hlinux/of.hlinux/gpio/consumer.hlinux/module.hlinux/platform_device.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/mfd/samsung/core.hlinux/mfd/samsung/s5m8767.hlinux/regulator/of_regulator.hlinux/regmap.h
Detected Declarations
struct s5m8767_infostruct sec_voltage_descfunction s5m8767_get_registerfunction s5m8767_get_vsel_regfunction s5m8767_convert_voltage_to_selfunction s5m8767_set_highfunction s5m8767_set_lowfunction s5m8767_set_voltage_selfunction s5m8767_set_voltage_time_selfunction s5m8767_regulator_config_ext_controlfunction s5m8767_enable_ext_controlfunction s5m8767_pmic_dt_parse_pdatafunction s5m8767_pmic_dt_parse_pdatafunction s5m8767_pmic_probe
Annotated Snippet
struct s5m8767_info {
struct device *dev;
struct sec_pmic_dev *iodev;
int num_regulators;
struct sec_opmode_data *opmode;
int ramp_delay;
bool buck2_ramp;
bool buck3_ramp;
bool buck4_ramp;
bool buck2_gpiodvs;
bool buck3_gpiodvs;
bool buck4_gpiodvs;
u8 buck2_vol[8];
u8 buck3_vol[8];
u8 buck4_vol[8];
struct gpio_desc *buck_gpios[3];
struct gpio_desc *buck_ds[3];
int buck_gpioindex;
};
struct sec_voltage_desc {
int max;
int min;
int step;
};
static const struct sec_voltage_desc buck_voltage_val1 = {
.max = 2225000,
.min = 650000,
.step = 6250,
};
static const struct sec_voltage_desc buck_voltage_val2 = {
.max = 1600000,
.min = 600000,
.step = 6250,
};
static const struct sec_voltage_desc buck_voltage_val3 = {
.max = 3000000,
.min = 750000,
.step = 12500,
};
static const struct sec_voltage_desc ldo_voltage_val1 = {
.max = 3950000,
.min = 800000,
.step = 50000,
};
static const struct sec_voltage_desc ldo_voltage_val2 = {
.max = 2375000,
.min = 800000,
.step = 25000,
};
static const struct sec_voltage_desc *reg_voltage_map[] = {
[S5M8767_LDO1] = &ldo_voltage_val2,
[S5M8767_LDO2] = &ldo_voltage_val2,
[S5M8767_LDO3] = &ldo_voltage_val1,
[S5M8767_LDO4] = &ldo_voltage_val1,
[S5M8767_LDO5] = &ldo_voltage_val1,
[S5M8767_LDO6] = &ldo_voltage_val2,
[S5M8767_LDO7] = &ldo_voltage_val2,
[S5M8767_LDO8] = &ldo_voltage_val2,
[S5M8767_LDO9] = &ldo_voltage_val1,
[S5M8767_LDO10] = &ldo_voltage_val1,
[S5M8767_LDO11] = &ldo_voltage_val1,
[S5M8767_LDO12] = &ldo_voltage_val1,
[S5M8767_LDO13] = &ldo_voltage_val1,
[S5M8767_LDO14] = &ldo_voltage_val1,
[S5M8767_LDO15] = &ldo_voltage_val2,
[S5M8767_LDO16] = &ldo_voltage_val1,
[S5M8767_LDO17] = &ldo_voltage_val1,
[S5M8767_LDO18] = &ldo_voltage_val1,
[S5M8767_LDO19] = &ldo_voltage_val1,
[S5M8767_LDO20] = &ldo_voltage_val1,
[S5M8767_LDO21] = &ldo_voltage_val1,
[S5M8767_LDO22] = &ldo_voltage_val1,
[S5M8767_LDO23] = &ldo_voltage_val1,
[S5M8767_LDO24] = &ldo_voltage_val1,
[S5M8767_LDO25] = &ldo_voltage_val1,
[S5M8767_LDO26] = &ldo_voltage_val1,
[S5M8767_LDO27] = &ldo_voltage_val1,
[S5M8767_LDO28] = &ldo_voltage_val1,
[S5M8767_BUCK1] = &buck_voltage_val1,
[S5M8767_BUCK2] = &buck_voltage_val2,
[S5M8767_BUCK3] = &buck_voltage_val2,
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/err.h`, `linux/of.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/platform_device.h`, `linux/regulator/driver.h`, `linux/regulator/machine.h`.
- Detected declarations: `struct s5m8767_info`, `struct sec_voltage_desc`, `function s5m8767_get_register`, `function s5m8767_get_vsel_reg`, `function s5m8767_convert_voltage_to_sel`, `function s5m8767_set_high`, `function s5m8767_set_low`, `function s5m8767_set_voltage_sel`, `function s5m8767_set_voltage_time_sel`, `function s5m8767_regulator_config_ext_control`.
- 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.