drivers/regulator/max77650-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/max77650-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/max77650-regulator.c- Extension
.c- Size
- 13144 bytes
- Lines
- 406
- 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/of.hlinux/mfd/max77650.hlinux/module.hlinux/platform_device.hlinux/regmap.hlinux/regulator/driver.h
Detected Declarations
struct max77650_regulator_descfunction max77650_regulator_is_enabledfunction max77650_regulator_enablefunction max77650_regulator_disablefunction max77650_regulator_probe
Annotated Snippet
struct max77650_regulator_desc {
struct regulator_desc desc;
unsigned int regA;
unsigned int regB;
};
static const unsigned int max77651_sbb1_volt_range_sel[] = {
0x0, 0x1, 0x2, 0x3
};
static const struct linear_range max77651_sbb1_volt_ranges[] = {
/* range index 0 */
REGULATOR_LINEAR_RANGE(2400000, 0x00, 0x0f, 50000),
/* range index 1 */
REGULATOR_LINEAR_RANGE(3200000, 0x00, 0x0f, 50000),
/* range index 2 */
REGULATOR_LINEAR_RANGE(4000000, 0x00, 0x0f, 50000),
/* range index 3 */
REGULATOR_LINEAR_RANGE(4800000, 0x00, 0x09, 50000),
};
static const unsigned int max77650_current_limit_table[] = {
1000000, 866000, 707000, 500000,
};
static int max77650_regulator_is_enabled(struct regulator_dev *rdev)
{
const struct max77650_regulator_desc *rdesc;
struct regmap *map;
int val, rv, en;
rdesc = container_of_const(rdev->desc, struct max77650_regulator_desc, desc);
map = rdev_get_regmap(rdev);
rv = regmap_read(map, rdesc->regB, &val);
if (rv)
return rv;
en = MAX77650_REGULATOR_EN_CTRL_BITS(val);
return en != MAX77650_REGULATOR_DISABLED;
}
static int max77650_regulator_enable(struct regulator_dev *rdev)
{
const struct max77650_regulator_desc *rdesc;
struct regmap *map;
rdesc = container_of_const(rdev->desc, struct max77650_regulator_desc, desc);
map = rdev_get_regmap(rdev);
return regmap_update_bits(map, rdesc->regB,
MAX77650_REGULATOR_EN_CTRL_MASK,
MAX77650_REGULATOR_ENABLED);
}
static int max77650_regulator_disable(struct regulator_dev *rdev)
{
const struct max77650_regulator_desc *rdesc;
struct regmap *map;
rdesc = container_of_const(rdev->desc, struct max77650_regulator_desc, desc);
map = rdev_get_regmap(rdev);
return regmap_update_bits(map, rdesc->regB,
MAX77650_REGULATOR_EN_CTRL_MASK,
MAX77650_REGULATOR_DISABLED);
}
static const struct regulator_ops max77650_regulator_LDO_ops = {
.is_enabled = max77650_regulator_is_enabled,
.enable = max77650_regulator_enable,
.disable = max77650_regulator_disable,
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.set_active_discharge = regulator_set_active_discharge_regmap,
};
static const struct regulator_ops max77650_regulator_SBB_ops = {
.is_enabled = max77650_regulator_is_enabled,
.enable = max77650_regulator_enable,
.disable = max77650_regulator_disable,
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_current_limit = regulator_get_current_limit_regmap,
.set_current_limit = regulator_set_current_limit_regmap,
Annotation
- Immediate include surface: `linux/of.h`, `linux/mfd/max77650.h`, `linux/module.h`, `linux/platform_device.h`, `linux/regmap.h`, `linux/regulator/driver.h`.
- Detected declarations: `struct max77650_regulator_desc`, `function max77650_regulator_is_enabled`, `function max77650_regulator_enable`, `function max77650_regulator_disable`, `function max77650_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.